Skip to content

Commit a271639

Browse files
Add a no-ouput silent mode
This is so Gorko and a token config can be included and not generate a bundle CSS output which is handy for splitting
1 parent 75a12e8 commit a271639

File tree

4 files changed

+19
-9
lines changed

4 files changed

+19
-9
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ npm-debug.*
77
.sass-cache
88
node_modules
99
test.html
10+
tmp

gorko.scss

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
// the user hasn't yet set a config for their project
33
@import './src/default-config';
44

5+
// Set default feature flags
6+
$outputTokenCSS: true !default;
7+
58
@import './src/functions/functions';
69
@import './src/mixins/mixins';
710
@import './src/generator/generator';

package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
{
22
"name": "gorko",
3-
"version": "0.1.0",
3+
"version": "0.2.0",
44
"description": "A tiny Sass token class generator.",
55
"main": "gorko.scss",
66
"dependencies": {
77
"sass": "^1.26.5"
88
},
9+
"scripts": {
10+
"test": "npx sass gorko.scss tmp/gorko.css"
11+
},
912
"devDependencies": {},
1013
"repository": {
1114
"type": "git",

src/generator/_generator.scss

+11-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
@import 'workers/cycle';
22

3-
// Run the standard cycle first
4-
@include cycle('', false);
3+
// Only run if there should be an output
4+
@if ($outputTokenCSS == true) {
5+
// Run the standard cycle first
6+
@include cycle('', false);
57

6-
// For each breakpoint, generate a prefix and run the cycle
7-
@each $key, $value in map-get($gorko-config, 'breakpoints') {
8-
$prefix: #{$key + '\\:'};
9-
$is-breakpoint: true;
8+
// For each breakpoint, generate a prefix and run the cycle
9+
@each $key, $value in map-get($gorko-config, 'breakpoints') {
10+
$prefix: #{$key + '\\:'};
11+
$is-breakpoint: true;
1012

11-
@media screen and #{$value} {
12-
@include cycle($prefix, $is-breakpoint);
13+
@media screen and #{$value} {
14+
@include cycle($prefix, $is-breakpoint);
15+
}
1316
}
1417
}

0 commit comments

Comments
 (0)