Merge pull request #2032 from IanDelMar/editor-color-palette

Add editor-color-palette-bootstrap4.json
This commit is contained in:
Brian Coords 2023-10-13 07:49:40 -07:00 committed by GitHub
commit cf16154caa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 2 deletions

View File

@ -43,7 +43,11 @@ if ( ! function_exists( 'understrap_generate_color_palette' ) ) {
$color_palette = array();
// Grabs the autogenerated color palette that we're pulling from our compiled bootstrap stylesheets.
$color_palette_json = file_get_contents( get_theme_file_path( '/inc/editor-color-palette.json' ) ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
$file_path = get_theme_file_path( '/inc/editor-color-palette.json' );
if ( 'bootstrap4' === get_theme_mod( 'understrap_bootstrap_version', 'bootstrap4' ) ) {
$file_path = get_theme_file_path( '/inc/editor-color-palette-bootstrap4.json' );
}
$color_palette_json = file_get_contents( $file_path ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
if ( $color_palette_json ) {
$color_palette_json = json_decode( $color_palette_json, true );

View File

@ -0,0 +1 @@
{"--blue":"#007bff","--indigo":"#6610f2","--purple":"#5533ff","--pink":"#e83e8c","--red":"#dc3545","--orange":"#fd7e14","--yellow":"#ffc107","--green":"#28a745","--teal":"#20c997","--cyan":"#17a2b8","--white":"#fff","--gray":"#6c757d","--gray-dark":"#343a40"}

View File

@ -1 +1 @@
{"--blue":"#007bff","--indigo":"#6610f2","--purple":"#5533ff","--pink":"#e83e8c","--red":"#dc3545","--orange":"#fd7e14","--yellow":"#ffc107","--green":"#28a745","--teal":"#20c997","--cyan":"#17a2b8","--white":"#fff","--gray":"#6c757d","--gray-dark":"#343a40"}
{"--bs-blue":"#0d6efd","--bs-indigo":"#6610f2","--bs-purple":"#5533ff","--bs-pink":"#d63384","--bs-red":"#dc3545","--bs-orange":"#fd7e14","--bs-yellow":"#ffc107","--bs-green":"#198754","--bs-teal":"#20c997","--bs-cyan":"#0dcaf0","--bs-white":"#fff","--bs-gray":"#6c757d","--bs-gray-dark":"#343a40"}

View File

@ -20,6 +20,7 @@ const colors = [
const BS4 = process.argv[ process.argv.length - 1 ] === 'BS4';
const colorInfix = BS4 ? '' : 'bs-';
const output = 'inc/editor-color-palette' + ( BS4 ? '-bootstrap4' : '' ) + '.json';
module.exports = ( ctx ) => {
return {
@ -35,6 +36,7 @@ module.exports = ( ctx ) => {
},
'postcss-understrap-palette-generator': {
colors: colors.map( ( x ) => `--${ colorInfix }${ x }` ),
output: output,
},
},
};