question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multiline declaration of maps in SASS

See original GitHub issue

Looking 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:closed
  • Created 10 years ago
  • Reactions:23
  • Comments:15 (2 by maintainers)

github_iconTop GitHub Comments

19reactions
ghostcommented, Feb 27, 2015

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.

17reactions
lolmauscommented, Jan 22, 2014

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:

indented_vs_bracketed

It’s also much easier to do copy-pasting.

So Sass maintainers, PLEASE don’t let the indented syntax fall behind!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found