Importing sass into underscores theme

admin2025-01-07  3

I am developing a new theme using Underscores. I am starting the process of migrating in the code from the already built site in html/css. I built it using .scss files and am not sure where to copy in my main styles. I see there is a Sass directory already in underscores, but do I then still need to enque the .scss file.

Sorry, I'm obviously a bit confused how to handle sass and wordpress....any help is appreciated.

Thanks

I am developing a new theme using Underscores. I am starting the process of migrating in the code from the already built site in html/css. I built it using .scss files and am not sure where to copy in my main styles. I see there is a Sass directory already in underscores, but do I then still need to enque the .scss file.

Sorry, I'm obviously a bit confused how to handle sass and wordpress....any help is appreciated.

Thanks

Share Improve this question asked Jun 27, 2019 at 20:34 user55555user55555 111 silver badge4 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Underscores is primarily built so that you put your styles in style.css. This stylesheet is compiled from the main SASS file at sass/style.scss. Additionally, woocommerce.css is compiled from sass/woocommerce.scss.

If you want to take advantage of SASS yourself, you can either add your styles to sass/style.scss, or import a file into it that has your styles. You can see that it already imports some other files from the sass/ directory, as an example.

However, you should not enqueue the .scss file. Browsers cannot read SASS, so the .scss file needs to be compiled into the style.css file. Underscores does not provide any tools for doing this though, so you would need to add your own build tools for compiling SASS so that sass/style.scss can be compiled to style.css. If you're previous HTML site was built with SASS, then whatever process you used to compile the stylesheet would also work here.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1736264652a984.html

最新回复(0)