postcss-scss
postcss-scss copied to clipboard
Support !default and !global as !important
Example
$var: /* comment 1 */ all /* comment 2 */ !import /* comment 3 */ ; /* comment 4 */
Parse as
Declaration {
raws:
{ before: '',
between: ': /* comment 1 */ ',
important: ' !important /* comment 3 */ ',
value: { value: 'all ', raw: 'all /* comment 2 */' } },
type: 'css-decl',
source:
{ start: { line: 1, column: 1 },
input:
Input {
css: '$var: /* comment 1 */ all /* comment 2 */ !important /* comment 3 */ ; /* comment 4 */\n',
id: '<input css 1>' },
end: { line: 1, column: 70 } },
prop: '$var',
important: true,
value: 'all ' }
It should be easy for implement, if you accept i will do PR.
Use case - for prettier, don't eat comment and don't parse inside package. Thanks!
We can set Declaration#raws.scssGlobal and scssDefault if property name is started with $.
I think it will be better to not remove !global from value (in this case CSS stringifier will stringify it back).
PR is welcome :).
@ai we add !global when have flag scssGlobal, maybe we can add value have with global and add scssValue without !global ?
Yeap, raws.scssValue is good idea.