Home > Development Tools > VSCode > body text

How to compile sass with vscode

Release: 2019-12-31 14:38:53
Original
3673 people have browsed it

How to compile sass with vscode

Use vscode to compile sass

The first step is to install easy sass in vscode. The picture below shows the successful installation status

How to compile sass with vscode

The second step, modify the configuration of vscode

"easysass.compileAfterSave": true, 
 "easysass.formats": [ //nested:嵌套缩进的 css 代码。
//expanded:没有缩进的、扩展的css代码。
//compact:简洁格式的 css 代码。
//compressed:压缩后的 css 代码

        {
            "format": "expanded",
            "extension": ".css"
        },
        {
            "format": "compressed",
            "extension": ".min.css"
        }
    ],
    "easysass.targetDir": "css/" //路径
Copy after login

The third step, create a new folder, create two new folders in the folder, one sass and one css, if you have not created css folder, a folder will be automatically created after compilation

How to compile sass with vscode

The fourth step, then create demo.sass under sass, and then write the

Five steps, press ctrl s to compile directly. Because you set easysass.compileAfterSave to true when setting up before, so it will be compiled once after saving. This is also to improve development efficiency

Finally you will find There is an additional css file below the css, a min.css file. This is related to the settings you have set, one without indentation and one compressed

How to compile sass with vscode

This article comes from the PHP Chinese websitevscode tutorial column.

The above is the detailed content of How to compile sass with vscode. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template