Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS CSS to Sass Debugging, Best Practices, and Production Moving Forward with Sass

Juliette Tworsey
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Juliette Tworsey
Front End Web Development Techdegree Graduate 32,425 Points

Integrating Sass with PHP and WordPress/Drupal/etc...

Great class!

I was wondering:

Is there a way to integrate Sass projects with Wordpress and other PHP based content management systems? If so, what would be the best approach?

Thanks!

1 Answer

Kevin Korte
Kevin Korte
28,149 Points

Sure, I'd recommend using a javascript task runner to watch your sass files for changes, automatically compile them into css. Than in your wordpress functions.php file, you en queue the css file that the task runner generates.

There are two task runners that come to mind.

http://gruntjs.com/

http://gulpjs.com/

I've used both, both get the job done, just a different syntax. I'm kinda impartial to both, I don't have a favorite, they both work.

Juliette Tworsey
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Juliette Tworsey
Front End Web Development Techdegree Graduate 32,425 Points

Thanks Kevin. Actually, I have just finished a Gulp course here (I need to go back and review it again to retain what I learned) and I am currently learning about Compass here @ Treehouse.

Do you mean the functions.php file that is located within the main theme(s) folder? Would it still work in the event of a theme (ie., the main theme, not the generated child theme) update? Or maybe this would work better if I built my own theme w/php from the ground up?

Thanks again. I'm new to all of this and I'm feeling a bit discombobulated at the moment. I've learned quite a bit here, now I just need to figure out how all of the pieces fit together:-)