Created
May 29, 2017 07:20
-
-
Save lydell/4aed77086bc1c0a16193e73380908c5f to your computer and use it in GitHub Desktop.
Prettier SCSS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@font-face { | |
src: url(if($bootstrap-sass-asset-helper, twbs-font-path('#{$icon-font-path}#{$icon-font-name}.eot'), '#{$icon-font-path}#{$icon-font-name}.eot')); | |
} | |
// Catchall baseclass | |
.glyphicon {} | |
// Individual icons | |
.glyphicon-asterisk {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_glyphicons.scss: prettier(input) !== prettier(prettier(input)) | |
Index: | |
=================================================================== | |
--- | |
+++ | |
@@ -6,10 +6,9 @@ | |
)); | |
} | |
- | |
-// Catchall baseclass | |
+ '#{$icon-font-pat | |
.glyphicon { | |
} | |
-// Individual icons | |
+// Catchall basecla | |
.glyphicon-asterisk { | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import url('foo'); | |
$dir: 'fonts'; | |
@font-face {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
font-face.scss: Error: unknown type: "media-url" | |
at genericPrintNoParens (/home/lydell/forks/prettier/src/printer.js:2796:13) | |
at genericPrint (/home/lydell/forks/prettier/src/printer.js:68:30) | |
at comments.printComments.p (/home/lydell/forks/prettier/src/printer.js:4743:12) | |
at Object.printComments (/home/lydell/forks/prettier/src/comments.js:929:19) | |
at printGenerically (/home/lydell/forks/prettier/src/printer.js:4741:21) | |
at FastPath.map (/home/lydell/forks/prettier/src/fast-path.js:123:19) | |
at genericPrintNoParens (/home/lydell/forks/prettier/src/printer.js:2612:30) | |
at genericPrint (/home/lydell/forks/prettier/src/printer.js:68:30) | |
at comments.printComments.p (/home/lydell/forks/prettier/src/printer.js:4743:12) | |
at Object.printComments (/home/lydell/forks/prettier/src/comments.js:929:19) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin Hamburger($bar: 5px, $gap: 3px, $color: currentColor) { | |
background-image: | |
linear-gradient( | |
to bottom, | |
$color $bar, | |
transparent 0, | |
transparent ($bar + $gap), | |
$color 0, | |
$color ($bar * 2 + $gap), | |
transparent 0, | |
transparent ($bar * 2 + $gap * 2), | |
$color 0 | |
); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hamburger.scss: ast(input) !== ast(prettier(input)) | |
Index: | |
=================================================================== | |
--- | |
+++ | |
@@ -95,49 +95,43 @@ | |
}, | |
{ | |
- "groups": [ | |
- { | |
- "value": "transparent", | |
- "type": "value-word", | |
- "isHex": false, | |
- "isColor": false | |
+ "value": "transparent", | |
+ "type": "value-func", | |
+ "unbalanced": 0, | |
+ "group": { | |
+ "open": { | |
+ "value": "(", | |
+ "type": "value-paren", | |
+ "parenType": "" | |
}, | |
- { | |
- "open": { | |
- "value": "(", | |
- "type": "value-paren", | |
- "parenType": "" | |
- }, | |
- "close": { | |
- "value": ")", | |
- "type": "value-paren", | |
- "parenType": "" | |
- }, | |
- "groups": [ | |
- { | |
- "groups": [ | |
- { | |
- "value": "$bar", | |
- "type": "value-word", | |
- "isHex": false, | |
- "isColor": false | |
- }, | |
- { | |
- "value": "+", | |
- "type": "value-operator" | |
- }, | |
- { | |
- "value": "$gap", | |
- "type": "value-word", | |
- "isHex": false, | |
- "isColor": false | |
- } | |
- ], | |
- "type": "value-comma_group" | |
- } | |
- ], | |
- "type": "value-paren_group" | |
- } | |
- ], | |
- "type": "value-comma_group" | |
+ "close": { | |
+ "value": ")", | |
+ "type": "value-paren", | |
+ "parenType": "" | |
+ }, | |
+ "groups": [ | |
+ { | |
+ "groups": [ | |
+ { | |
+ "value": "$bar", | |
+ "type": "value-word", | |
+ "isHex": false, | |
+ "isColor": false | |
+ }, | |
+ { | |
+ "value": "+", | |
+ "type": "value-operator" | |
+ }, | |
+ { | |
+ "value": "$gap", | |
+ "type": "value-word", | |
+ "isHex": false, | |
+ "isColor": false | |
+ } | |
+ ], | |
+ "type": "value-comma_group" | |
+ } | |
+ ], | |
+ "type": "value-paren_group" | |
+ } | |
}, | |
{ | |
@@ -158,58 +152,52 @@ | |
}, | |
{ | |
- "groups": [ | |
- { | |
- "value": "$color", | |
- "type": "value-word", | |
- "isHex": false, | |
- "isColor": false | |
+ "value": "$color", | |
+ "type": "value-func", | |
+ "unbalanced": 0, | |
+ "group": { | |
+ "open": { | |
+ "value": "(", | |
+ "type": "value-paren", | |
+ "parenType": "" | |
}, | |
- { | |
- "open": { | |
- "value": "(", | |
- "type": "value-paren", | |
- "parenType": "" | |
- }, | |
- "close": { | |
- "value": ")", | |
- "type": "value-paren", | |
- "parenType": "" | |
- }, | |
- "groups": [ | |
- { | |
- "groups": [ | |
- { | |
- "value": "$bar", | |
- "type": "value-word", | |
- "isHex": false, | |
- "isColor": false | |
- }, | |
- { | |
- "value": "*", | |
- "type": "value-operator" | |
- }, | |
- { | |
- "value": "2", | |
- "unit": "", | |
- "type": "value-number" | |
- }, | |
- { | |
- "value": "+", | |
- "type": "value-operator" | |
- }, | |
- { | |
- "value": "$gap", | |
- "type": "value-word", | |
- "isHex": false, | |
- "isColor": false | |
- } | |
- ], | |
- "type": "value-comma_group" | |
- } | |
- ], | |
- "type": "value-paren_group" | |
- } | |
- ], | |
- "type": "value-comma_group" | |
+ "close": { | |
+ "value": ")", | |
+ "type": "value-paren", | |
+ "parenType": "" | |
+ }, | |
+ "groups": [ | |
+ { | |
+ "groups": [ | |
+ { | |
+ "value": "$bar", | |
+ "type": "value-word", | |
+ "isHex": false, | |
+ "isColor": false | |
+ }, | |
+ { | |
+ "value": "*", | |
+ "type": "value-operator" | |
+ }, | |
+ { | |
+ "value": "2", | |
+ "unit": "", | |
+ "type": "value-number" | |
+ }, | |
+ { | |
+ "value": "+", | |
+ "type": "value-operator" | |
+ }, | |
+ { | |
+ "value": "$gap", | |
+ "type": "value-word", | |
+ "isHex": false, | |
+ "isColor": false | |
+ } | |
+ ], | |
+ "type": "value-comma_group" | |
+ } | |
+ ], | |
+ "type": "value-paren_group" | |
+ } | |
}, | |
{ | |
@@ -230,67 +218,61 @@ | |
}, | |
{ | |
- "groups": [ | |
- { | |
- "value": "transparent", | |
- "type": "value-word", | |
- "isHex": false, | |
- "isColor": false | |
+ "value": "transparent", | |
+ "type": "value-func", | |
+ "unbalanced": 0, | |
+ "group": { | |
+ "open": { | |
+ "value": "(", | |
+ "type": "value-paren", | |
+ "parenType": "" | |
}, | |
- { | |
- "open": { | |
- "value": "(", | |
- "type": "value-paren", | |
- "parenType": "" | |
- }, | |
- "close": { | |
- "value": ")", | |
- "type": "value-paren", | |
- "parenType": "" | |
- }, | |
- "groups": [ | |
- { | |
- "groups": [ | |
- { | |
- "value": "$bar", | |
- "type": "value-word", | |
- "isHex": false, | |
- "isColor": false | |
- }, | |
- { | |
- "value": "*", | |
- "type": "value-operator" | |
- }, | |
- { | |
- "value": "2", | |
- "unit": "", | |
- "type": "value-number" | |
- }, | |
- { | |
- "value": "+", | |
- "type": "value-operator" | |
- }, | |
- { | |
- "value": "$gap", | |
- "type": "value-word", | |
- "isHex": false, | |
- "isColor": false | |
- }, | |
- { | |
- "value": "*", | |
- "type": "value-operator" | |
- }, | |
- { | |
- "value": "2", | |
- "unit": "", | |
- "type": "value-number" | |
- } | |
- ], | |
- "type": "value-comma_group" | |
- } | |
- ], | |
- "type": "value-paren_group" | |
- } | |
- ], | |
- "type": "value-comma_group" | |
+ "close": { | |
+ "value": ")", | |
+ "type": "value-paren", | |
+ "parenType": "" | |
+ }, | |
+ "groups": [ | |
+ { | |
+ "groups": [ | |
+ { | |
+ "value": "$bar", | |
+ "type": "value-word", | |
+ "isHex": false, | |
+ "isColor": false | |
+ }, | |
+ { | |
+ "value": "*", | |
+ "type": "value-operator" | |
+ }, | |
+ { | |
+ "value": "2", | |
+ "unit": "", | |
+ "type": "value-number" | |
+ }, | |
+ { | |
+ "value": "+", | |
+ "type": "value-operator" | |
+ }, | |
+ { | |
+ "value": "$gap", | |
+ "type": "value-word", | |
+ "isHex": false, | |
+ "isColor": false | |
+ }, | |
+ { | |
+ "value": "*", | |
+ "type": "value-operator" | |
+ }, | |
+ { | |
+ "value": "2", | |
+ "unit": "", | |
+ "type": "value-number" | |
+ } | |
+ ], | |
+ "type": "value-comma_group" | |
+ } | |
+ ], | |
+ "type": "value-paren_group" | |
+ } | |
}, | |
{ | |
Index: | |
=================================================================== | |
--- | |
+++ | |
@@ -1,14 +1,13 @@ | |
@mixin Hamburger($bar: 5px, $gap: 3px, $color: currentColor) { | |
- background-image: | |
- linear-gradient( | |
- to bottom, | |
- $color $bar, | |
- transparent 0, | |
- transparent ($bar + $gap), | |
- $color 0, | |
- $color ($bar * 2 + $gap), | |
- transparent 0, | |
- transparent ($bar * 2 + $gap * 2), | |
- $color 0 | |
- ); | |
+ background-image: linear-gradient( | |
+ to bottom, | |
+ $color $bar, | |
+ transparent 0, | |
+ transparent($bar + $gap), | |
+ $color 0, | |
+ $color($bar * 2 + $gap), | |
+ transparent 0, | |
+ transparent($bar * 2 + $gap * 2), | |
+ $color 0 | |
+ ); | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a { | |
box-shadow: inset 0 $size $size (-$size) black; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parens.scss: ast(input) !== ast(prettier(input)) | |
Index: | |
=================================================================== | |
--- | |
+++ | |
@@ -34,39 +34,38 @@ | |
{ | |
"value": "$size", | |
- "type": "value-word", | |
- "isHex": false, | |
- "isColor": false | |
+ "type": "value-func", | |
+ "unbalanced": 0, | |
+ "group": { | |
+ "open": { | |
+ "value": "(", | |
+ "type": "value-paren", | |
+ "parenType": "" | |
+ }, | |
+ "close": { | |
+ "value": ")", | |
+ "type": "value-paren", | |
+ "parenType": "" | |
+ }, | |
+ "groups": [ | |
+ { | |
+ "groups": [ | |
+ { | |
+ "value": "-", | |
+ "type": "value-operator" | |
+ }, | |
+ { | |
+ "value": "$size", | |
+ "type": "value-word", | |
+ "isHex": false, | |
+ "isColor": false | |
+ } | |
+ ], | |
+ "type": "value-comma_group" | |
+ } | |
+ ], | |
+ "type": "value-paren_group" | |
+ } | |
}, | |
{ | |
- "open": { | |
- "value": "(", | |
- "type": "value-paren", | |
- "parenType": "" | |
- }, | |
- "close": { | |
- "value": ")", | |
- "type": "value-paren", | |
- "parenType": "" | |
- }, | |
- "groups": [ | |
- { | |
- "groups": [ | |
- { | |
- "value": "-", | |
- "type": "value-operator" | |
- }, | |
- { | |
- "value": "$size", | |
- "type": "value-word", | |
- "isHex": false, | |
- "isColor": false | |
- } | |
- ], | |
- "type": "value-comma_group" | |
- } | |
- ], | |
- "type": "value-paren_group" | |
- }, | |
- { | |
"value": "black", | |
"type": "value-word", | |
Index: | |
=================================================================== | |
--- | |
+++ | |
@@ -1,3 +1,3 @@ | |
a { | |
- box-shadow: inset 0 $size $size (-$size) black; | |
+ box-shadow: inset 0 $size $size(-$size) black; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment