How Do I Add SCSS to WordPress?

In this article, we will show you how to add SCSS to WordPress. SCSS is a style sheet language used for styling HTML and XML documents.

WordPress already supports a variety of styles, including SCSS, so adding SCSS is not difficult.

To begin, open up your WordPress editor and navigate to the WordPress theme you want to style. In this example, we will be styling the Twenty Seventeen theme.

Once you are in the theme’s directory, locate the style.scss file.

This file contains all of the SCSS style rules for the theme.

To add a SCSS rule, open the style.scss file in your editor and locate the line that says @import “style.

css”;. At the beginning of this line, insert the following SCSS code:.

@import “style.scss”;

After the @import line, add the SCSS code you want to style. In this example, we will be adding a rule to style the

element.

To do this, locate the

element in the style.scss file and add the following code:.

h1 {

font-family: “Avenir”, Helvetica, Arial, sans-serif;

font-size: 1.5em;

}

Save the style.scss file and reload the WordPress editor.

Your changes should now be visible in the theme.

If you want to add multiple SCSS rules to style different elements in the theme, you can do so by opening the style.scss file in your editor and separating the rules with a comma.

For example, if you want to style the

and

elements, you would add the following code to the style.scss file:.

h1, h2 {

Conclusion

Adding SCSS to your WordPress theme is not difficult, and it can help you to style your theme in a more organized and consistent manner.