Open raduluchian opened 9 years ago
So, the space shouldn't be added, but is?
Nope, quite the opposite: the space should be added but isn't.
Oh, okay. :smile: What would you expect to see if "selector_separator" were set to "\n"?
I suppose to see each selector on a separate line, even if they are part of the same rule. So I would expect this code:
.one .two .three {
...
}
to be formatted into this:
.one
.two
.three {
...
}
What about your original example?
a>b {
...
}
would turn into this:
a
>
b {
...
}
This issue had it's one year birthday yesterday. :) Any updates on it?
Nope. This project is widely used and I devote what time I can to it, but it needs more contributors.
@raduluchian - Have you tried setting space_around_selector_separator = true
?
The name is odd, but I think that will do what you want.
@bitwiseman The space_around_selector_separator
parameter set to true
fix this issue.
Though, it should be like that by default: I cannot think of a situation where you wouldn't want js-beautify-css not to add (or maintain existing spaces) between +
or >
relationship separators because it breaks your CSS rules (I mean, it is not an "aesthetic" bug).
For anyone wondering, this has been update to space_around_combinator
For anyone wondering, this has been update to
space_around_combinator
Woo woo woo ~ tks tks tks very!
For anyone wondering, this has been update to
space_around_combinator
Sob~ this property configuration still doesn't work... Then I found this related update adjustment Implement option to support adding spaces between CSS selectors
For anyone wondering, this has been update to
space_around_combinator
Sob~ this property configuration still doesn't work... Then I found this related update adjustment Implement option to support adding spaces between CSS selectors
After a walk, I came back and found that this attribute is effective. I found that my writing was wrong.
It was written like this before:
But in fact the correct configuration is:
~🤡🤡🤡~
:)
@dosicker
Could you open a new issue for this.
I think it would make sense if one of the beautifier modules sees a JSON element matching itself it should drill into that.
The fact that they don't is not an outright bug, but it's behavior that could be improved.
@dosicker Could you open a new issue for this. I think it would make sense if one of the beautifier modules sees a JSON element matching itself it should drill into that. The fact that they don't is not an outright bug, but it's behavior that could be improved.
Thanks you reply! and...Yeah, maybe you misunderstood me. My statement above was to say that I was stupid... which led to the wrong use of the property...
But what you meant by this sentence is that the configuration of this property should actually be written in the CSS object, not in the top-level configuration, that right?
@dosicker
It's okay that it works in the root object, that is reasonable behavior.
It is a bug that it doesn't work when inside the css
object.
@dosicker It's okay that it works in the root object, that is reasonable behavior. It is a bug that it doesn't work when inside the
css
object.
yeah, ok~ got it. I'll take time to create a new issue.
Altought the CSS rule for "selector_separator" is set to " " (space character) this doesn't apply to rules that use direct descendant selectors or adjacent selectors. For example the following code...
... doesn't get formatted into this: