I am compiling scss to css using gulp-sass, but as shown in the title, it is difficult to understand how to erase blank lines in the block with css.
I thought I could erase it if I used a formatter, but I couldn't find a formatter with the function I wanted.
p {
background: pink;
color: red;
// blank line I want to erase
box-sizing: 5px;
-webkit-border-radius: 5px;
}
// blank lines you don't want to erase
p span {
background: skyblue;
color: blue;
}
In the above example, there is a blank line in the style specification for the p tag, and I want to delete it.
However, even if you can delete the above line using the formatter,// blank line you don't want to delete
betweenp
andp span
Only the formatter that erased until was found.
(Or it may be possible depending on the setting ...)
In other words, please tell me the formatter (or a package with a similar function) that deletes blank lines in blocks while keeping blank lines between blocks, and how to set it.
* By the way, the blank line I want to erase is thegulp-autoprefixer
comment/* autoprefixer: ignore next */
gulp-replace
Remnants deleted using. As a result of deleting the compiled file so that it does not include comments, a blank line was created.
-
Answer # 1
Related articles
- how to erase ruled lines in excel file using python
- css - box-shadow applied to ie and edge, but lines disappear when printed
- Jsp programming method to remove blank lines
- 4 ways to remove blank lines in the shell
- Angularjs example of removing blank lines in a page
- 4 ways to delete blank lines in a file in Linux
- jquery<li>method of adding blank or dashed lines every few lines
- How to clear blank lines in a file in Go
- css - how to use display: block;
- please tell me how to erase the column block in wordpress 5 goodenberg
- Solve the problem of blank lines when converting python file strings to lists
- python - i want to remove blank lines and get the specified value
- c - program to delete blank lines
- how to draw diagonal lines with css
- css - i want the height of a block element to be the height of another block
- how to insert as many blank lines in array as in gas
- jquery - i want to exclude blank lines from listjs
- [html/css] table display: block;
- Android programming method to erase a block in Bitmap
- html : The shadow adjusts to the button, not the picture inside
- How to get a list of classes from a .css file
- javascript : How to write a server that serves files from a folder?
- html : How and on what to write your grid?
- html : Border property not working in scss
- html : How do I implement this for a button?
- html : Element heights are not aligned in flexbox
- Css property /value hints for sass in VS Code
- windows - error that sass "nodejs" cannot be used nodejs 14153 lts
- css - sassc :: syntaxerror
An easy way is to specify the
fix
option ofgulp-stylelint
.For example, in the following directory structure,
package.json
,gulpfile.js
is as follows,.stylelintrc
isEach SCSS file looks like this:
style.scss
_mixins.scss
If you run the
default
task here, the output CSS file will be as follows, and you can confirm that the blank line with the comment has been deleted.