Answer the question
In order to leave comments, you need to log in
Is it possible in VS Code to format the declaration block (in curly braces) to one line when one property is set?
Hello.
For code formatting in VS Code I use Beautify (I tried Prettier )
I did not find a setting in any of the extensions that defines a rule that prohibits formatting a CSS block consisting of a single property.
For example, so that the line
does not turn into a
Question:
Please help me find an extension or setting that allows you to prohibit formatting such situations.
Thanks
Answer the question
In order to leave comments, you need to log in
Something like stylelint with an option --fix
should solve your problem. See https://stylelint.io/user-guide/rules for documentation on all stylelint rules.
Here, the following stylelint rules will be most relevant:
Relevant stylelint documentation pages:
Also in VSCode there is an extension stylefmt , it can format styles according to the Stylelint config.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question