I have css file. I want to set prettier vs code so that after writing a comma, the selector I wrote remained in line with the previous selector. But when i save the file, the selector will be entered to next line
I want to save the code like this (my expectation)
But prettier set the code like this (h3 entered to next line)
How to fix this problem? I set trailling comma to none but it doesn't work.
I think that config you changed only applies to JavaScript files (notice the reference to ES5).
As far as CSS, prettier is opinionated and they decided that each selector should have its own line ( this PR implements that behaviour ). I don't think there's a config to change that behaviour.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.