cancel
Showing results for 
Search instead for 
Did you mean: 

Changing a Sass variable in Snowdog/blank in a child theme

Changing a Sass variable in Snowdog/blank in a child theme

I'm trying to get 3 products per row on the category page, however it seems to be kept in a variable.

 

What is the correct way to overwrite it?

5 REPLIES 5

Re: Changing a Sass variable in Snowdog/blank in a child theme

As I mentioned on Github, you have to tell how you currently achieve theme inheritance in SASS themes.

The default option is to use Frontools, but you said, that you are not using them.

Re: Changing a Sass variable in Snowdog/blank in a child theme

Sorry, misread.

 

I'm achieving the inheritance simple by setting:

<parent>Snowdog/blank</parent>

in theme.xml.

 

When I need to overwrite something I copy it to Magento_Themodule/[layout/templates]/whatever.xxx

 

With the scss I create new files at Magento_Themodule/css/source/_module.scss (sometimes breaking that down in to /module/_nameoffile.scss) and write Sass to do what I need to do.

 

I'm then using a custom built gulpfile.js to compile the styles in to css.

 

Is there anything you need to know?

Re: Changing a Sass variable in Snowdog/blank in a child theme

"...to compile the styles in to css."

So you have to improve this, to handle compilation of parent and child theme partials in same time.

 

You can use "includePaths" or create somewhere temp directory with symlinks to all needed resources and then compile them to CSS.

 

At at it's not an problem with theme, it's just about tools to handle your needs.

 

Re: Changing a Sass variable in Snowdog/blank in a child theme

That would certainly explain what might be going wrong.

 

Would 

@import /vendor/snowdog/theme-blank-sass/web/css/styles.scss

at the top of my main scss file work to pull ALL the snowdog styles in, or does it need to be more specific to the module, in this case /vendor/snowdog/theme-blank-sass/Magento_Catalog/css/source/_module.scss

Re: Changing a Sass variable in Snowdog/blank in a child theme

This should compile fine, but I'll not recommend this way, b/c leads to duplications of styles and specificity wars / overriding selectors.