Merge pull request #26993 from robintown/compound-theming

Allow Element Web to use cascade layers
pull/27004/head
Robin 2024-02-12 13:34:42 +00:00 committed by GitHub
commit 09dff6ab05
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 588 additions and 492 deletions

View File

@ -179,13 +179,13 @@
"postcss": "^8.4.31", "postcss": "^8.4.31",
"postcss-easings": "^2.0.0", "postcss-easings": "^2.0.0",
"postcss-hexrgba": "2.0.1", "postcss-hexrgba": "2.0.1",
"postcss-import": "^12.0.1", "postcss-import": "^16.0.0",
"postcss-loader": "^3.0.0", "postcss-loader": "^8.1.0",
"postcss-mixins": "^6.2.3", "postcss-mixins": "^6.2.3",
"postcss-nested": "^4.2.3", "postcss-nested": "^4.2.3",
"postcss-preset-env": "^6.7.0", "postcss-preset-env": "^9.3.0",
"postcss-scss": "^4.0.4", "postcss-scss": "^4.0.4",
"postcss-simple-vars": "^5.0.2", "postcss-simple-vars": "^7.0.1",
"prettier": "3.2.4", "prettier": "3.2.4",
"process": "^0.11.10", "process": "^0.11.10",
"proxy-agent": "^6.3.0", "proxy-agent": "^6.3.0",

View File

@ -330,35 +330,37 @@ module.exports = (env, argv) => {
loader: "postcss-loader", loader: "postcss-loader",
ident: "postcss", ident: "postcss",
options: { options: {
"sourceMap": true, sourceMap: true,
"plugins": () => [ postcssOptions: () => ({
// Note that we use significantly fewer plugins on the plain "plugins": [
// CSS parser. If we start to parse plain CSS, we end with all // Note that we use significantly fewer plugins on the plain
// kinds of nasty problems (like stylesheets not loading). // CSS parser. If we start to parse plain CSS, we end with all
// // kinds of nasty problems (like stylesheets not loading).
// You might have noticed that we're also sending regular CSS //
// through PostCSS. This looks weird, and in fact is probably // You might have noticed that we're also sending regular CSS
// not what you'd expect, however in order for our CSS build // through PostCSS. This looks weird, and in fact is probably
// to work nicely we have to do this. Because down the line // not what you'd expect, however in order for our CSS build
// our SCSS stylesheets reference plain CSS we have to load // to work nicely we have to do this. Because down the line
// the plain CSS through PostCSS so it can find it safely. This // our SCSS stylesheets reference plain CSS we have to load
// also acts like a babel-for-css by transpiling our (S)CSS // the plain CSS through PostCSS so it can find it safely. This
// down/up to the right browser support (prefixes, etc). // also acts like a babel-for-css by transpiling our (S)CSS
// Further, if we don't do this then PostCSS assumes that our // down/up to the right browser support (prefixes, etc).
// plain CSS is SCSS and it really doesn't like that, even // Further, if we don't do this then PostCSS assumes that our
// though plain CSS should be compatible. The chunking options // plain CSS is SCSS and it really doesn't like that, even
// at the top of this webpack config help group the SCSS and // though plain CSS should be compatible. The chunking options
// plain CSS together for the bundler. // at the top of this webpack config help group the SCSS and
// plain CSS together for the bundler.
require("postcss-simple-vars")(), require("postcss-simple-vars")(),
require("postcss-hexrgba")(), require("postcss-hexrgba")(),
// It's important that this plugin is last otherwise we end // It's important that this plugin is last otherwise we end
// up with broken CSS. // up with broken CSS.
require("postcss-preset-env")({ stage: 3, browsers: "last 2 versions" }), require("postcss-preset-env")({ stage: 3, browsers: "last 2 versions" }),
], ],
"parser": "postcss-scss", "parser": "postcss-scss",
"local-plugins": true, "local-plugins": true,
}),
}, },
}, },
], ],
@ -413,22 +415,24 @@ module.exports = (env, argv) => {
loader: "postcss-loader", loader: "postcss-loader",
ident: "postcss", ident: "postcss",
options: { options: {
"sourceMap": true, sourceMap: true,
"plugins": () => [ postcssOptions: () => ({
// Note that we use slightly different plugins for PostCSS. "plugins": [
require("postcss-import")(), // Note that we use slightly different plugins for PostCSS.
require("postcss-mixins")(), require("postcss-import")(),
require("postcss-simple-vars")(), require("postcss-mixins")(),
require("postcss-nested")(), require("postcss-simple-vars")(),
require("postcss-easings")(), require("postcss-nested")(),
require("postcss-hexrgba")(), require("postcss-easings")(),
require("postcss-hexrgba")(),
// It's important that this plugin is last otherwise we end // It's important that this plugin is last otherwise we end
// up with broken CSS. // up with broken CSS.
require("postcss-preset-env")({ stage: 3, browsers: "last 2 versions" }), require("postcss-preset-env")({ stage: 3, browsers: "last 2 versions" }),
], ],
"parser": "postcss-scss", "parser": "postcss-scss",
"local-plugins": true, "local-plugins": true,
}),
}, },
}, },
], ],

984
yarn.lock

File diff suppressed because it is too large Load Diff