cancel
Showing results for 
Search instead for 
Did you mean: 

Compiling Sass files in Custom Modules

Compiling Sass files in Custom Modules

Does this have the same file structure and compile as magnetos LESS? Eg when I run gulp styles the file

app/code/Vendor_Name/Module_name/styles/styles.scss

will compile? 

Or do I have to add the styles in 

app/design/Vendor_Name/Theme_Name/Module_Name/styles/_modules.scss

?

17 REPLIES

Re: Compiling Sass files in Custom Modules

Up from version 1.3.0 of Frontools you can compile styles directly from modules, without moving them to the theme.

 

It's not well described anywhere yet (I'm just bussy :<), but you can check sample configuration, "modules" parameter.

 

Re: Compiling Sass files in Custom Modules

Thanks man, you're a legend. 

Re: Compiling Sass files in Custom Modules

In a Custom Module what is the path so that sass get successfully compiled?

Re: Compiling Sass files in Custom Modules

nvm Smiley Happy , you listed above

Re: Compiling Sass files in Custom Modules

Actually nope, the following doesnt work.

{
  "blank": {
    "src": "vendor/snowdog/theme-blank-sass",
    "dest": "pub/static/frontend/Snowdog/blank",
    "locale": ["en_US"]
  },
  "zymo": {
    "src": "vendor/gigasavvy/theme-frontend-zymo",
    "dest": "pub/static/frontend/Gigasavvy/zymo",
    "locale": ["en_US"],
    "stylesDir": "styles",
    "postcss": ["plugins.autoprefixer()"],
    "parent": "blank",
    "modules": {
      "Gigasavvy_DockedMiniCart": "app/code/gigasavvy-dockedminicart"
    }
  }
}

Re: Compiling Sass files in Custom Modules

Could you show me files structure inside "app/code/gigasavvy-dockedminicart" and shortly describe what you want to achieve (import partial / compile styles from the module)?

Re: Compiling Sass files in Custom Modules

Screen Shot 2017-03-02 at 9.12.32 AM.png

i just want the sass in styles.scss to be compiled into the main styles.css

Re: Compiling Sass files in Custom Modules

Let's try to change your config to:

    "modules": {
      "Gigasavvy_DockedMiniCart": "app/code/gigasavvy-dockedminicart/view/frontend"
    }

But at all somewhere in "pub/static/frontend/Gigasavvy/zymo/Gigasavvy_DockedMiniCart" should be compiled "styles.css"

Re: Compiling Sass files in Custom Modules

unfortunately, no luck with changing the themes.json to the latter. Also no sign of compiled styles.css in the DockedMiniCart module.