Skip to content

Commit 56d8efd

Browse files
committed
fix(@angular/cli): remove postcss-custom-properties
We currently use a fallback for CSS custom properties on older browsers. This approach has a few problems: - does not work if the custom property declaration is not part of the same of the same file that uses it (multiple global stylesheets, component css). - does not work at all for component CSS in AOT. @clydin suggested a browserlist based approach for enabling this functionality, but that requires a new feature that we don't have. Since currently taking advantage of the custom property fallback is flaky even in the best case scenario, and potentially broken in prod (AOT), I think it's better to remove it altogether until we can actually do it right. Fix #8289
1 parent 00bc1f0 commit 56d8efd

File tree

4 files changed

+0
-39
lines changed

4 files changed

+0
-39
lines changed

package-lock.json

Lines changed: 0 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@
7575
"nopt": "^4.0.1",
7676
"opn": "~5.1.0",
7777
"portfinder": "~1.0.12",
78-
"postcss-custom-properties": "^6.1.0",
7978
"postcss-loader": "^2.0.8",
8079
"postcss-url": "^7.1.2",
8180
"raw-loader": "^0.5.1",

packages/@angular/cli/models/webpack-configs/styles.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ const cssnano = require('cssnano');
1111
const postcssUrl = require('postcss-url');
1212
const autoprefixer = require('autoprefixer');
1313
const ExtractTextPlugin = require('extract-text-webpack-plugin');
14-
const customProperties = require('postcss-custom-properties');
1514

1615
/**
1716
* Enumerate loaders and their dependencies from this file to let the dependency validator
@@ -86,7 +85,6 @@ export function getStylesConfig(wco: WebpackConfigOptions) {
8685
}
8786
]),
8887
autoprefixer(),
89-
customProperties({ preserve: true })
9088
].concat(
9189
minimizeCss ? [cssnano(minimizeOptions)] : []
9290
);
@@ -96,7 +94,6 @@ export function getStylesConfig(wco: WebpackConfigOptions) {
9694
'autoprefixer': 'autoprefixer',
9795
'postcss-url': 'postcssUrl',
9896
'cssnano': 'cssnano',
99-
'postcss-custom-properties': 'customProperties'
10097
},
10198
variables: { minimizeCss, baseHref, deployUrl }
10299
};

packages/@angular/cli/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
"nopt": "^4.0.1",
6060
"opn": "~5.1.0",
6161
"portfinder": "~1.0.12",
62-
"postcss-custom-properties": "^6.1.0",
6362
"postcss-loader": "^2.0.8",
6463
"postcss-url": "^7.1.2",
6564
"raw-loader": "^0.5.1",

0 commit comments

Comments
 (0)