Skip to content

Commit

Permalink
Use the postcss-custom-properties config to define fallback colors (W…
Browse files Browse the repository at this point in the history
…ordPress#24408)

Co-authored-by: Riad Benguella <benguella@gmail.com>
  • Loading branch information
jasmussen and youknowriad authored Aug 28, 2020
1 parent 535c9ea commit 125fc59
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
6 changes: 0 additions & 6 deletions packages/base-styles/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -677,9 +677,3 @@
}
/* stylelint-enable function-comma-space-after */
}

// It is important to include these styles in all built stylesheets.
// This allows to CSS variables post CSS plugin to generate fallbacks.
:root {
@include admin-scheme(#007cba);
}
12 changes: 11 additions & 1 deletion packages/postcss-plugins-preset/lib/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
module.exports = [
require( 'postcss-custom-properties' )(),
require( 'postcss-custom-properties' )( {
importFrom: [
{
customProperties: {
'--wp-admin-theme-color': '#007cba',
'--wp-admin-theme-color-darker-10': '#006ba1',
'--wp-admin-theme-color-darker-20': '#005a87',
},
},
],
} ),
require( 'autoprefixer' )( { grid: true } ),
];

0 comments on commit 125fc59

Please sign in to comment.