Preserve space between selector and > combinator
See original GitHub issueWhen beautifying a CSS rule containing a >
combinator, the combinator got stuck to the previous selector. Actually, even if it already formatted correctly, the space is removed. It makes quite difficult to use js-beautify
in CSS files containing > combinators because it will produce selectors that won’t work.
Input
The code looked like this before beautification:
.foo > h3 {
...
}
Expected Output
I would expect the input to not change. The code should have looked like this after beautification:
/* Space here
V */
.foo > h3 {
...
}
Actual Output
The code actually looked like this after beautification:
/* No space
V */
.foo> h3 {
...
}
Environment
OS: Archlinux with Emacs web-beautify.el
Also tested under command line only outside of Emacs.
Settings
Defaults
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
selector-combinator-space-before - Stylelint
Combinators are used to combine several different selectors into new and more specific ones.
Read more >CSS combinator precedence? - Stack Overflow
No, there is no notion of precedence in combinators. However, there is a notion of order of elements in a complex selector.
Read more >Understanding Combinators in CSS - Level Up Coding
A combinator is a way to define the relation between selectors. By using combinators, for example, we can target only child elements of...
Read more >CSS Combinators - W3Schools
A combinator is something that explains the relationship between the selectors. A CSS selector can contain more than one simple selector.
Read more >General sibling combinator - CSS: Cascading Style Sheets
The general sibling combinator (~) separates two selectors and matches all iterations of the second element, that are following the first ...
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
It has been fixed in
1.6.4
, it don’t happen anymore since I setspace_around_combinator
to true, my bad. This param should be true by default though.Hello! I still have a “no space” around any sibiling selector when I beautify a css file. I actually use atom-beautify.