Jump to content

Child theme - how to use scss and compile


Recommended Posts

I have created a child theme (parent: classic theme) but I don't understand what to do about assets and wepack compiling.

I'd like to use scss files and compile them to css.

Do I have to copy classic/_dev directory to my child theme?
Create a _dev directory in my theme and keep only overrides there?

Is there any guide about this?

parent: classic
name: mytheme
display_name: Mytheme
version: 1.0.0
assets:
  use_parent_assets: true
  css:
    all:
      - id: custom-styles
      path: assets/css/custom.css

 

Edited by pepperz (see edit history)
Link to comment
Share on other sites

I don't understand why presta would support sass only in parent themes. How is that supposed to help developers?

I thought that there would be a way to use sass files in a child theme and be able to compile it. 

Link to comment
Share on other sites

  On 1/29/2025 at 8:17 AM, pepperz said:

I don't understand why presta would support sass only in parent themes. How is that supposed to help developers? I thought that there would be a way to use sass files in a child theme and be able to compile it. 

Expand  

It's not an obligation, but you said you use use_parent_assets: true in your child theme config. You can set to false and create your own assets with _dev and use webpack and npm see doc.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...