Progress continues on No Frills Magento 2 Layout, with Patrons receiving full access to the rough draft and initial source code samples. I just finished the section on Magento 2’s Less handling – basically an update to my article on the same topic last year. Here’s an excerpt that wraps up the section.
For folks working for a certain sort of interactive agency, Magento 2’s choice of Less was somewhat disappointing. Other processors like Sass and Stylus seem more popular with this set of developers. Because of this, we’ve seen some efforts to create alternate CSS workflows using these systems.
While these are interesting projects, and do create a workable alternative for folks heavily invested in these stacks, these projects (along with things like “headless” API only implementations) end up sacrificing a huge chunk of Magento’s value as a software ecosystem.
There’s no such thing as a pre-processor standard – each of these toolsets is capable of different things. So far, each alternative pre-processor project ends up outputting CSS that’s different from the Less generated CSS. They also often need to (or want to) implement changes to the layout handle files or generated HTML.
While all of this is OK on an individual system, the tradeoff is the wealth of third party code (open source and commercial) that relies on the existing Less/CSS rules, the existing layout structure, or the existing HTML structure may end up not working. It’s hard to overstate the value that consistency in the available layout blocks, style rules, and HTML code brings for folks making redistributable Magento code.
Even if these alternate pre-processors somehow manage to maintain compatibility with the Less versions of Magento’s themes – extension developers are placed in an odd position: Do they adopt Less rules and provide Sass/Stylus alternatives? Do they do this for each individual Sass or Stylus project?
Unfortunately, there aren’t easy answers here. While it’s possible to use pure CSS (and therefore your own CSS workflows) by adding new files to Magento, most working Magento developers won’t be able to avoid working with Less CSS, and it seems unlikely Magento 2 will rip out the guts of a system that’s already taken countless developer hours to build.
Still no solid release date on No Frills – but we’re 15,000 words into what should be a 40,000 word book. A huge thanks to my Patrons for giving me the needed space to work on this instead of the madcap freelance dance.