CSS: Preserve Newlines
See original GitHub issueMaybe I’m not configuring it correctly, or maybe it’s missing, but I have a great need for preserving my newlines in my css and can’t seem to get it to work.
Here’s my config:
"css": {
"allowed_file_extensions": ["css", "scss", "sass", "less"],
"end_with_newline": true,
"indent_char": " ",
"indent_size": 2,
"selector_separator": " ",
"selector_separator_newline": false,
"preserve_newlines": true
}
Issue Analytics
- State:
- Created 9 years ago
- Reactions:11
- Comments:17 (3 by maintainers)
Top Results From Across the Web
white-space
The CSS white-space property controls how text is handled on the element ... As per the CSS 2.1 spec: “Lines are broken at...
Read more >How to preserve line breaks in <code> block? - css
How to preserve line breaks in <code> block? · If the line breaks are meaningful, then they are "content," not "style," and should...
Read more >Preserve new lines and spacing in CSS - Dev Diary
See how you can preserve the new lines and spacing of text in HTML by using the white-space CSS property.
Read more >How to Render an HTML String Preserving Spaces and ...
In this tutorial, you can learn how to render an HTML text preserving spaces and line breaks. You need to use the HTML...
Read more >Preserve Newlines
Preserve line-breaks. Configuration option for beautifiers JS-Beautify and languages CSS, EJS, HTML, Handlebars, JSX, JavaScript, Liquid, Mustache, XML.
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
+1² for SCSS files.
Issue #563 also has a similar problem. When I save/format a .scss file, the variables at the top and the import calls are all put together, making it hard to maintain. Would be super to just detect empty lines and keep them 👍
Just for reference:
… goes like this:
@reza3vi What are you +1-ing? This is fixed.