0

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

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.

1
  • Thanks for that....I tried pasting in my scss into the style.scss file and still nothing. So I'm thinking it's somewhere else. For a test I added a random style to the style.css file and it's still not recognizing anything. I don't feel like i'm getting the style.css file to connect with the site
    – user55555
    Jun 28 '19 at 17:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.