Problem/Motivation
ES6 in CORE introduced a build process into CORE. Additional, we also using Stylelint to lint our CSS. NODEJS became a must in the CORE Development.
In the past day, #1310698: Add a CSS preprocessor library to core suggested adding CSS preprocessor to Drupal CORE Backend. However, the non-official PHP compiler always has buggy. And it's an old-fashioned development way in modern PHP development. And I believed we all left comments over there has different new thoughts also.
To optimize the frontend workflow in 2017 and the future, I suggested introducing more NODEJS FRONTEND Tools into DRUPAL CORE Development.
Proposed resolution
- Use PostCSS autoprefixer
Patching broswer vendor automactailly. No more human work: #2492335: Drop more browser specific prefixes -
Use SCSS ( https://github.com/sass/libsass )
I suggested to keep it simple at the beginning. We need not convert every CSS files to SCSS syntax (, or creates many SCSS style rules). For example,
-- just enabled Custom Properties to keep our CSS more consistency. More easy to override from contribs. e.g. change whole color theme
-- then adding common @mixins
(We could learn from Bootstrap) - ( auto RTL tool )
- (You name it)
OLD SUMMARY:
------------
There was a post #1310698: Add a CSS preprocessor library to core proposes to add CSS preprocessor library to CORE BACKEND. But the non-official PHP Compiler always lack behind the development and with buggy.
The post #1310698: Add a CSS preprocessor library to core proposes add CSS preprocessor library to CORE BACKEND. But non-official PHP Compiler always lack behind development and with buggy.
In this post, we focus on just move SCSS (and NODEJS build tool) into Development Stage.
Comments
Comment #3
Jeff Burnz commentedI don't understand the issue or how the Proposed resolution relates to the issue. Are you saying we convert all of cores CSS to SCSS, or that we just add something to package.json etc?
Comment #4
droplet commentedConvert all CSS to SCSS.
Comment #5
Jeff Burnz commentedAn argument in the past has always been that SCSS/SASS would reduce core dev/themer participation, I always argued that it's the other way around since every front ender is using preprocessing these days, no one actually writes CSS anymore, do they?
Comment #7
joelpittetWe'd need to write guidelines around writing SCSS to prevent people from those nasty habits like over nesting and fragmented selectors between files no? I use SCSS daily but not sure this is a great idea for core, anyways this needs a bit more thought put into it.
Also looks like a duplicate of #1310698: Add a CSS preprocessor library to core which does have a lot of discussion and thought put in already.
Comment #8
droplet commentedComment #9
droplet commentedI re-open this issue with a more clear idea. SCSS isn't the only thing I wanted to push here.
Comment #11
joelpittet@droplet what would you like to do with this?
Comment #14
andypostIf you gonna use autoprefixer (which is postCSS) then no reason to add sass/less
Comment #15
andypostComment #19
anruetherCan this be closed as outdated? See CR: Drupal core using PostCSS for development | Drupal.org