Use sass/scss in WeChat developer tools

Foreword:

Because it is necessary to use wxss to write style sheets in WeChat developer tools, the efficiency is low, so it is necessary to introduce sass/scss preprocessor to speed up development efficiency

Import steps:

1. Download the extension Easy Sass vs code domestic download address in the vs code editor

insert image description here

2. Expand and install the Easy Sass plugin of VS code in the WeChat applet
insert image description here

Select the easysass folder
insert image description here
3. Modify the easysass configuration file
Edit - Open the editor directory
insert image description here

Modify package.json

insert image description here

Delete one of the previous two objects and change the extension to .wxss (important)

insert image description here

4. Restart the WeChat developer tools

scss use:

Take my project as an example: We only need to create meber.scss
Note: Here we need to create a .scss file, do not create a .sass file (.sass has no code hints)
insert image description here
member.wxss will be automatically generated and hot updated according to the content of .scss
Compiled successfully :
insert image description here
member.wxss:
insert image description here

Guess you like

Origin blog.csdn.net/qq_39549013/article/details/124735282