stylefmt
stylefmt copied to clipboard
Variables declared as Map are forcely inlined.
SCSS has the ability to define variables as maps (https://codepen.io/jakealbaugh/post/using-sass-functions-to-access-complex-variable-maps), but actually, the Formatter enforces that all variables should be on the same line.
e.g.:
Something like this:
$buttonColors: (
'primary': $primary-color,
'success': $success-color,
'warning': $warning-color,
'danger': $danger-color,
'info': $info-color
);
will become:
$buttonColors: (
'primary': $primary-color, 'success': $success-color, 'warning': $warning-color, 'danger': $danger-color, 'info': $info-color
);
Which obviously, is not so readable.
This is very frustrating. How to prevent inlining?
I have currently solved this by commenting out the following line. Someone more experineced JS developer should make an exception for sass:maps.
https://github.com/morishitter/stylefmt/blob/875c9037590fa201bdd7698fbfa5c1943137cc86/lib/formatSassVariables.js#L46