What is the easiest way to use scss?

i Tried the wp-scss plugin but it doesnt seems to work for me:

In my theme: root: css -> style.css scss -> style.scss

settings for scss and css location are '/scss/' and '/css/'.

style.scss $pink : #7e40e4;

style.css .bg {background:$pink}

doesn't work, what am i missing?

Thanks

WordPress core by itself doesn't support SCSS, even though it is actually used in core development now.

The issue with "plugin" type solutions to add such support transparently is that they rely on "ports" of preprocessors. SCSS is not natively developed for PHP, running it in such environment is only possible with third party re–implementations. While ports mostly work, from my experience they are plagued with issues and routinely lag behind in version updates.

The more practical approach is too compile your SCSS during development (using native engine and maybe tools that extend it for convenience) and use build results as regular CSS.

I suggest you start with the WP Bones theme startup theme. It's actually how i got into scss for the first time. It explains all you need to understand about scss and sets you up directly in a good file system and scss configuration for Wordpress.

Also, you may feel more comfortable using a software like Codekit to handle the configuration and compilation tasks of your scss files. There are free alternatives (but i find Codekit to be worth the small investment).

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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