Hi, I’m building a theme with Sage and was wondering how can I use a SCSS file to load only on a specific landing page?
I have the landing page : Medical Treatments
I have the SCSS file: medical-treatments.scss
I included it into
main.scss and it’s loaded on all pages but I want it to load only on
Medical Treatments template
Create a SCSS file next to main.scss and it should be compiled to a separate file in dist/, too.
I would separate style files on template level, so when you use a specific template for medial-treatments page, enqueue the medial-treatments.css file for this template.
When this is purely page-specific you may want to think about reusable classes and html elements in editor to make it more theme agnostic and ease updates or replacing themes in future.