Home > Development Tools > VSCode > body text

How does vscode run scss files?

青灯夜游
Release: 2019-12-31 17:17:25
Original
4883 people have browsed it

How does vscode run scss files?

How does vscode compile and run scss files?

1. The compilation of sass depends on the Ruby environment, so install ruby ​​first

2. After installing Ruby, enter gem sass on the command line to install Sass

3. Find the easy sass plug-in in the vscode extension and install

How does vscode run scss files?

4. Next, configure: Click "File Preference Settings" in the vs code menu bar, open the settings.json global configuration file

How does vscode run scss files?

"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

5, create a new folder, and Create two new folders in the folder, one for sass and one for css. If you have not created a css folder, a folder will be automatically created after compilation

How does vscode run scss files?

6. Then Create demo.sass under sass, then write

.box
    color: red
    .img
        width: 100%;
        display: block;
Copy after login

7, press ctrl s, and it will be compiled directly. Because you set easysass.compileAfterSave to true when you set it before, it will be compiled once after saving. This is also to improve development efficiency

Finally, you will find that there is an additional css file under the css, and a min.css file. This is related to the settings you have set. One has no indentation, and the other Compressed

How does vscode run scss files?

Related recommendations: vscode basic tutorial

The above is the detailed content of How does vscode run scss files?. 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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!