magento 2 community project - moving from less to sass
TRANSCRIPT
C O M M E R C E & M O B I L E S O LU T I O N S
Magento 2 Community Project Moving from LESS to SASS
BARTEK IGIELSKILEAD FRONT-END DEVELOPER
LESS is waaaay too „soft” It let’s you do so many bad things,
instead of yealing: „YOU STUPID BASTARD, I CAN’T HANDLE THIS”
You can set value of variable after place where use that variable
// LESS Code@variable: red;body { color: @variable; }@variable: blue;
// CSS Outputbody { color: blue; }
Quantity of global variables defined: Magento UI - 1216
Admin theme - 1233 Blank theme - 320 Luma theme - 355
Ability to create „array of mixins”// LESS Code.mixin() { /* 1 */ }.mixin() { /* 2 */ }.mixin() { /* 3 */ }body { .mixin(); }
// CSS Outputbody { /* 1 + 2 + 3 */}
Weird conditional statements
.mixin() when (condition) { … }selector when (condition) { … }selector { & when (condition) { … }}
• How to simplify code and refactoring? • How to get self-documenting code? • How to start reusing code without letting
components influence each other?
Magento UIIt should to provide ready to use
components, not only set of (little bit overcomplicated) mixins.
Partners in crime• Interactiv4 • Magento • MindMagnet • Rocket Web • Snowdog • Vinai Kopp
• Atwix • Blue Acorn • CTI Digital • Demac Media • Fooman • Gravity Department • Inchoo
How to stay updated?Twitter @Igloczek <- it’s me :) @SnowdogApps <- Snowdog (you don’t say!)
GitHub https://github.com/SnowdogApps/magento2-theme-blank-sass https://github.com/SnowdogApps/magento2-frontools
Magento Forums https://community.magento.com/t5/Less-to-Sass-Community-Project/bd-p/less-to-sass