• I’m taking over a site from a previous dev and I don’t have a lot of experience working with SASS. It looks like the files are set up properly but there are some issues with how a component is displaying so I suspect something isn’t being included properly.

    In the style.scss file it looks like the partials are imported correctly but I’m thinking the style.scss file itself might not be enqueued properly in the functions.php file, if SASS works similarly to vanilla CSS.

    How do you enqueue the style.scss file? Do I need to install a compiler for this?

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must process the SASS with a compiler which will generate CSS files which are then loaded onto your site and enqueued by the theme (or plugin).

    Thread Starter pfbarnet

    (@pfbarnet)

    Okay, I went in and installed SASS via the command line but still no luck. Am I missing something? Does it just automatically enqueue after I have SASS installed?

    No. SASS is outside the scope of the website. You have to use CSS for the web. SASS is not understood by the browser.

    Thread Starter pfbarnet

    (@pfbarnet)

    Right so after I install the compiler, what exactly do I need to do with the theme files in order to make it work? Or is there nothing I need to do? Or do I need to enqueue a style.css because that’s what the functions file will understand?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    but I’m thinking the style.scss file itself might not be enqueued properly in the functions.php file

    What do you mean by not enqueued properly; I recommend exploring that further before getting lost in your sass setup which sounds like it’s not documented.

    Thread Starter pfbarnet

    (@pfbarnet)

    Well I’m not accustomed to working with CSS preprocessors so normally I would enqueue the style.css using wp_enqueue_style. How does one get the SCSS to actually play nice with WordPress?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    You would really notice if the style.css file wasn’t being included properly. I do not think that’s the issue and I do not think you need to worry about scss right now. At least not before you’ve identified the issue.

    When you compile the scss file it will produce a css file. You don’t enqueue the scss file. You want to compile it into a css file. You should be able to find some tutorials on youtube for this.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Enqueue SASS stylesheet’ is closed to new replies.