Skip to content

Commit 4827bd1

Browse files
filipesilvaclydin
authored andcommitted
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 a2e9e00 commit 4827bd1

File tree

4 files changed

+0
-39
lines changed

4 files changed

+0
-39
lines changed

package-lock.json

-34
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

-1
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-import": "^11.0.0",
8079
"postcss-loader": "^2.0.10",
8180
"postcss-url": "^7.1.2",

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

-3
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
const postcssImports = require('postcss-import');
1615

1716
/**
@@ -127,7 +126,6 @@ export function getStylesConfig(wco: WebpackConfigOptions) {
127126
}
128127
]),
129128
autoprefixer(),
130-
customProperties({ preserve: true })
131129
].concat(
132130
minimizeCss ? [cssnano(minimizeOptions)] : []
133131
);
@@ -137,7 +135,6 @@ export function getStylesConfig(wco: WebpackConfigOptions) {
137135
'autoprefixer': 'autoprefixer',
138136
'postcss-url': 'postcssUrl',
139137
'cssnano': 'cssnano',
140-
'postcss-custom-properties': 'customProperties',
141138
'postcss-import': 'postcssImports',
142139
},
143140
variables: { minimizeCss, baseHref, deployUrl, projectRoot }

packages/@angular/cli/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@
6060
"nopt": "^4.0.1",
6161
"opn": "~5.1.0",
6262
"portfinder": "~1.0.12",
63-
"postcss-custom-properties": "^6.1.0",
6463
"postcss-import": "^11.0.0",
6564
"postcss-loader": "^2.0.10",
6665
"postcss-url": "^7.1.2",

0 commit comments

Comments
 (0)