@@ -24,14 +24,6 @@ module.exports = class ClarkPlugin extends Plugin {
2424 // Use :enter, which is equal to :hover and :focus combined
2525 require ( 'postcss-pseudo-class-enter' ) ,
2626
27- // https://github.com/jonathantneal/postcss-pseudo-class-any-link
28- // Combination of :link and :visited
29- require ( 'postcss-pseudo-class-any-link' ) ,
30-
31- // https://github.com/postcss/postcss-custom-selectorsx
32- // @custom -selector :--heading h1, h2, h3;
33- require ( 'postcss-custom-selectors' ) ,
34-
3527 // https://github.com/jedmao/postcss-nested-props
3628 // Nest properties like `font: { size: 10px; family: Helvetica; }`
3729 // @TODO : https://github.com/jedmao/postcss-nested-props/issues/9
@@ -83,9 +75,34 @@ module.exports = class ClarkPlugin extends Plugin {
8375 // cubic-bezier() for linear-gradient()
8476 require ( 'postcss-easing-gradients' ) ,
8577
86- // https://github.com/postcss/autoprefixer
87- // Add vendor prefixes to rules by Can I Use
88- require ( 'autoprefixer' ) ( { browsers : this . browsers } )
78+ // https://github.com/csstools/postcss-preset-env
79+ // Adds vendor prefixes based on Can I Use and polyfills new features
80+ require ( 'postcss-preset-env' ) ( {
81+ browsers : this . browsers ,
82+
83+ // https://cssdb.org/
84+ stage : 4 ,
85+
86+ // Disable `preserve` so that the resulting CSS is consistent among all
87+ // browsers, diminishing the probability of discovering bugs only when
88+ // testing in older browsers
89+ preserve : false ,
90+
91+ // Enable features that we want, despite being proposals yet
92+ features : {
93+ 'custom-selectors' : true ,
94+ 'custom-properties' : true ,
95+ 'custom-media-queries' : true ,
96+ 'nesting-rules' : true ,
97+ 'pseudo-class-any-link' : true
98+ } ,
99+
100+ autoprefixer : {
101+ // We don't use prefixes unless they are really necessary, e.g. when
102+ // dealing with quirks therefore, we disable removing them.
103+ remove : false
104+ }
105+ } )
89106 ] ;
90107
91108 for ( const [ stage , plugins ] of Object . entries ( { before, after } ) ) {
0 commit comments