Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variables declared as Map are forcely inlined. #331

Open
danfma-daitan opened this issue Dec 28, 2017 · 2 comments
Open

Variables declared as Map are forcely inlined. #331

danfma-daitan opened this issue Dec 28, 2017 · 2 comments

Comments

@danfma-daitan
Copy link

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.

@ronilaukkarinen
Copy link

This is very frustrating. How to prevent inlining?

@ronilaukkarinen
Copy link

ronilaukkarinen commented Mar 5, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants