It's my understanding that Wordpress now processes SASS files but for some reason mine don't work.

I'm trying to call it using wp_enqueue_style directly in header.php via the head tag:

<?php wp_enqueue_style('stylesheet', get_template_directory_uri() . '/style.css', $ver = false, $media = 'screen') ?>

Instead, the file gets called as a normal CSS doc.

I attempted to rename style.css to style.scss but then the file doesn't load at all, so I guess the sass pre-processor just isn't firing.

  • It's my understanding that Wordpress now processes SASS files … why do you think it does?
    – fuxia
    Jun 8 '16 at 23:19
  • @toscho core.trac.wordpress.org/changeset/26137
    – nipponese
    Jun 8 '16 at 23:24
  • I think that's only for a user's choice of colourscheme in the admin screens. Jun 8 '16 at 23:39
  • You're probably better to enqueue the styles using the wp_enqueue_scripts hook, too. Check the User Contributed Notes » Using a Hook section on this page.
    – Pat J
    Jun 9 '16 at 1:28
  • 2
    @nipponese That was for preprocessing core files on the wordpress.org server. It happens before WordPress is packed and distributed. That has no relevance for themes.
    – fuxia
    Jun 9 '16 at 2:20

@nipponese is right. WordPress doesn't process Sass for themes. That was just for core files on wordpress.org.

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.