I've played around with Sass a bit but am afraid to fully commit in my Magento projects. The reason for this is that I am concerned that as I pull in updates from Magento or extensions (most extensions do not provide the Sass files) the process of updating my Sass files may become overwhelming.
Am I looking at this the wrong way? Any insight into how this could be manage would be greatly appreciated.
Solved! Go to Solution.
Actually the thing is that you don't manage third party CSS, LESS or SASS files because it's a bad idea. Because it may cause issues when you want to upgrade third party stuff later on.
You never use SASS & LESS files directly; before browser can do anything with them they must be compiled to CSS files first. For that you need an external tool. Building an extension that compiles it to CSS doesn't make much sense because you edit SCSS externally anyway. Personally I use SASS and whenever I make changes I also compile everything. I have both CSS and SCSS files in my repository and whenever I deploy something to live, I use already compiled files.
As of third party CSS stuff -- I don't change them. I overload the styles they describe with my own files (such as local.scss / local.css).
Hi @tmillsmonin
I do not have knowledge about LESS and SAAS , both are new to me but I think @snowdog should be able to answer your question.
Also visit following topic written by them Migrating Magento 2 theme from less to sass
hey tmillsmonin, great to see more people interested in moving M front into right direction
Please check https://github.com/SnowdogApps/magento2-theme-blank-sass , feel free to send your pull requests or just feedback. More info about that semi-official community project at https://alankent.me/2016/05/21/magento-2-community-project-moving-from-less-to-sass/
@snowdog, this is in regards to Magento 1. I'm curious about what the best practices are around managing SASS, LESS, etc... when dealing with third party extentions, upgrades, etc... It is really the only thing keeping me from moving as much of our M1 instance to SASS as is possible.
Actually the thing is that you don't manage third party CSS, LESS or SASS files because it's a bad idea. Because it may cause issues when you want to upgrade third party stuff later on.
You never use SASS & LESS files directly; before browser can do anything with them they must be compiled to CSS files first. For that you need an external tool. Building an extension that compiles it to CSS doesn't make much sense because you edit SCSS externally anyway. Personally I use SASS and whenever I make changes I also compile everything. I have both CSS and SCSS files in my repository and whenever I deploy something to live, I use already compiled files.
As of third party CSS stuff -- I don't change them. I overload the styles they describe with my own files (such as local.scss / local.css).
Hi @Pronto, you answered my question in your last sentence. I know how to properly edit and compile LESS, SASS, etc... and have no intentions of writing a module to do this. I just want to be sure that module stylesheets remain upgradable as modules are updated without having to back-sync(?) too much work.
Well, it's how I do it anyway. However since folk around here have different expectations (sometimes wildly unrealistic) and different backgrounds (and sometimes have qualifications nowhere near what's required) I spent some extra time explaining.
In M1 we use also base theme converted to sass. There are to approaches in integrating third party modules frontend. Easy way for small shops is just adding css files and combining them with merging tools (like fooman speedster). Second approach for bigger sites is much more time consuming and basically require to rewrite most of modules frontend scripts. We hope to have much better solution in M2.