Multiline declaration of maps in SASS
See original GitHub issueLooking at the documentation and commits I see many examples of maps but always in scss syntax. The multiline declaration is really scalable and clear so I would like to use somthing similar in sass.
For instance this scss syntax:
$layout: (
columns: 12,
gutters: 20px
);
In sass I have only found a “one line” syntax. Eventually with a lot of properties this become unreadable.
$layout: (columns: 12, gutters: 20px, ...)
Is there an existing syntax for multiline map declaration in .sass?
Issue Analytics
- State:
- Created 10 years ago
- Reactions:23
- Comments:15 (2 by maintainers)
Top Results From Across the Web
Does a SASS map has to be on one line? - Stack Overflow
Multi-lines are not allowed in SASS maps, but aren't they though? In my project I have much larger maps and this results in...
Read more >sass:map
Sass libraries and design systems tend to share and override configurations that are represented as nested maps (maps that contain maps that contain...
Read more >Python Multi Line Comments - W3Schools
Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, Python, PHP,...
Read more >SASS · GitBook - Hash Labs
Sass. One of the simplest goals of this style guide is setting your ... Z-MAP. This file contain a SASS function to declare...
Read more >Sass/SCSS Variables - Quasar Framework
How to use the Sass/SCSS variables defined by Quasar. ... we need .sass and it doesn't support multi-line list $h-tags: (h1: map-get($headings, "h1"), ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I noticed this issue just recently and it was a real draw back from using the indented version of sass. A recent solution i’ve been using to get over this is to store any maps in a separate .scss file, and then import that file into my .sass document. This allows the maps to be visually organized and still be usable inside of the indented version. I thought i’d post this solution to help anybody who loves the indented flavor but hates this issue.
There’s a number of issues with the indented syntax, and Sass maintainers aren’t going to fix them. 😦 They say, the .sass parser is weird and hard to refactor.
I find Sass syntax to be quicker to type and easier to read. It is deprived of the visual noise:
It’s also much easier to do copy-pasting.
So Sass maintainers, PLEASE don’t let the indented syntax fall behind!