瀏覽代碼

Merge pull request #1963 from Automattic/add/color-annotations-barnsbury

Barnsbury: Add Color Annotations.
Allan Cole 5 年之前
父節點
當前提交
d5ea8ceb5b
共有 6 個文件被更改,包括 599 次插入23 次删除
  1. 37 23
      barnsbury/functions.php
  2. 353 0
      barnsbury/inc/wpcom-colors.php
  3. 186 0
      barnsbury/inc/wpcom-editor-colors.php
  4. 21 0
      barnsbury/inc/wpcom.php
  5. 1 0
      theme-dev-utils
  6. 1 0
      twentytwenty

+ 37 - 23
barnsbury/functions.php

@@ -53,49 +53,52 @@ if ( ! function_exists( 'barnsbury_setup' ) ) :
 			)
 		);
 
-		// Add child theme editor color pallete to match Sass-map variables in `_config-child-theme-deep.scss`.
+		/*
+		 * Get customizer colors and add them to the editor color palettes
+		 *
+		 * - if the customizer color is empty, use the default
+		 */
+		$colors_array     = get_theme_mod( 'colors_manager' ); // color annotations array()
+		$primary          = ! empty( $colors_array ) ? $colors_array['colors']['link'] : '#20603C'; // $config-global--color-primary-default;
+		$secondary        = ! empty( $colors_array ) ? $colors_array['colors']['fg1'] : '#655441';  // $config-global--color-secondary-default;
+		$background       = ! empty( $colors_array ) ? $colors_array['colors']['bg'] : '#FFFDF6';   // $config-global--color-background-default;
+		$foreground       = ! empty( $colors_array ) ? $colors_array['colors']['txt'] : '#3C2323';  // $config-global--color-foreground-default;
+		$foreground_light = ( ! empty( $colors_array ) && $colors_array['colors']['txt'] != '#3C2323' ) ? $colors_array['colors']['txt'] : '#844d4d';  // $config-global--color-foreground-light-default;
+		$foreground_dark  = ( ! empty( $colors_array ) && $colors_array['colors']['txt'] != '#3C2323' ) ? $colors_array['colors']['txt'] : '#0D1B24';  // $config-global--color-foreground-dark-default;
+
+		// Editor color palette.
 		add_theme_support(
 			'editor-color-palette',
 			array(
 				array(
 					'name'  => __( 'Primary', 'barnsbury' ),
 					'slug'  => 'primary',
-					'color' => '#20603C',
+					'color' => $primary,
 				),
 				array(
 					'name'  => __( 'Secondary', 'barnsbury' ),
 					'slug'  => 'secondary',
-					'color' => '#655441',
+					'color' => $secondary,
 				),
 				array(
-					'name'  => __( 'Deep Blue', 'barnsbury' ),
-					'slug'  => 'foreground-dark',
-					'color' => '#0D1B24',
+					'name'  => __( 'Background', 'barnsbury' ),
+					'slug'  => 'background',
+					'color' => $background,
 				),
 				array(
-					'name'  => __( 'Brown', 'barnsbury' ),
+					'name'  => __( 'Foreground', 'barnsbury' ),
 					'slug'  => 'foreground',
-					'color' => '#3C2323',
+					'color' => $foreground,
 				),
 				array(
-					'name'  => __( 'Clay', 'barnsbury' ),
+					'name'  => __( 'Foreground Light', 'balasana' ),
 					'slug'  => 'foreground-light',
-					'color' => '#844D4D',
-				),
-				array(
-					'name'  => __( 'Light Gray', 'barnsbury' ),
-					'slug'  => 'background-dark',
-					'color' => '#DDDDDD',
-				),
-				array(
-					'name'  => __( 'Subtle Off White', 'barnsbury' ),
-					'slug'  => 'background-light',
-					'color' => '#FDF9EC',
+					'color' => $foreground_light,
 				),
 				array(
-					'name'  => __( 'Off White', 'barnsbury' ),
-					'slug'  => 'background',
-					'color' => '#FFFDF6',
+					'name'  => __( 'Foreground Dark', 'balasana' ),
+					'slug'  => 'foreground-dark',
+					'color' => $foreground_dark,
 				),
 			)
 		);
@@ -171,5 +174,16 @@ function barnsbury_editor_styles() {
 
 	// Enqueue Google fonts in the editor, if necessary
 	wp_enqueue_style( 'barnsbury-editor-fonts', barnsbury_fonts_url(), array(), null );
+
+	// Hide duplicate palette colors
+	$colors_array = get_theme_mod('colors_manager', array( 'colors' => true )); // color annotations array()
+	if ( ! empty( $colors_array ) && $colors_array['colors']['txt'] != '#3C2323' ) { // $config-global--color-foreground-light-default;
+		$inline_palette_css = '.components-circular-option-picker__option-wrapper:nth-child(5),
+			.components-circular-option-picker__option-wrapper:nth-child(6) {
+				display: none;
+			}';
+		wp_add_inline_style( 'wp-edit-blocks', $inline_palette_css );
+	}
 }
 add_action( 'enqueue_block_editor_assets', 'barnsbury_editor_styles' );
+

+ 353 - 0
barnsbury/inc/wpcom-colors.php

@@ -0,0 +1,353 @@
+<?php
+/* Custom Colors: Barnsbury */
+
+// Background Color
+// $config-global--color-background-default
+add_color_rule( 'bg', '#FFFDF6', array(
+
+	// Background-color
+	array( '.has-background-background-color,
+			.has-background-background-color.has-background-dim,
+			.screen-reader-text:focus,
+			body,
+			body .widget_eu_cookie_law_widget #eu-cookie-law,
+			body .widget_eu_cookie_law_widget #eu-cookie-law.negative input.accept,
+			.main-navigation > div > ul > li > .sub-menu,
+			.main-navigation > div > ul > li.current-menu-item li > a,
+			.main-navigation > div > ul > li.focus li > a,
+			.main-navigation > div > ul > li:hover li > a,
+			.main-navigation > div > ul > li:hover li:hover > a, 
+			.main-navigation > div > ul > li:hover li.focus > a, 
+			.main-navigation > div > ul > li:hover li.current-menu-item > a,
+			.main-navigation > div > ul > li.focus li:hover > a, 
+			.main-navigation > div > ul > li.focus li.focus > a, 
+			.main-navigation > div > ul > li.focus li.current-menu-item > a,
+			.main-navigation > div > ul > li.current-menu-item li:hover > a,
+			.main-navigation > div > ul > li.current-menu-item li.focus > a,
+			.main-navigation > div > ul > li.current-menu-item li.current-menu-item > a', 'background-color' ),
+
+	// Text-color
+	array( '.a8c-posts-list-item__featured span,
+			.a8c-posts-list__view-all,
+			.a8c-posts-list__view-all:focus,
+			.a8c-posts-list__view-all:hover,
+			.button,
+			.button:focus,
+			.button:hover,
+			.has-background-color,
+			.has-background-dim,
+			.has-focus.a8c-posts-list__view-all,
+			.has-focus.button,
+			.has-focus.wp-block-button__link,
+			.has-focus.wp-block-file__button,
+			.sticky-post,
+			.wp-block-button__link,
+			.wp-block-button__link:focus,
+			.wp-block-button__link:hover,
+			.wp-block-file .wp-block-file__button,
+			.wp-block-file a.wp-block-file__button:active,
+			.wp-block-file a.wp-block-file__button:focus,
+			.wp-block-file a.wp-block-file__button:hover,
+			.wp-block-file a.wp-block-file__button:visited,
+			.wp-block-file__button,
+			.wp-block-file__button:focus,
+			.wp-block-file__button:hover,
+			.wp-block-pullquote.is-style-solid-color,			
+			body .widget_eu_cookie_law_widget #eu-cookie-law input.accept,
+			body .widget_eu_cookie_law_widget #eu-cookie-law input.accept:focus,
+			body .widget_eu_cookie_law_widget #eu-cookie-law input.accept:hover,
+			body .widget_eu_cookie_law_widget #eu-cookie-law input.has-focus.accept,
+			body .widget_eu_cookie_law_widget #eu-cookie-law.negative,
+			button,
+			button.has-focus,
+			button:focus,
+			button:hover,
+			button[data-load-more-btn],
+			input.has-focus[type="submit"],
+			input:focus[type="submit"],
+			input:hover[type="submit"],
+			input[type="submit"]', 'color' ),
+
+	/**
+	 * Utility Classes
+	 */
+	// Text-color
+	array( '.has-primary-background-color,
+			.has-secondary-background-color,
+			.has-foreground-background-color,
+			.has-foreground-dark-background-color,
+			.has-foreground-light-background-color,
+			.has-background-color', 'color' ),
+	// Background-color
+	array( '.has-background-background-color', 'background-color' ),
+	// Color darkened
+	array( '.has-background-dark-color', 'color', '-1' ),
+	// Background-color darkened
+	array( '.has-background-dark-background-color', 'background-color', '-1' ),
+	// Color lightened
+	array( '.has-background-light-color', 'color', '+1' ),
+	// Background-color lightened
+	array( '.has-background-light-background-color', 'background-color', '+1' ),
+
+	/**
+	 * Grays
+	 * Uses a slightly darker color
+	 */
+	// Border-color
+	array( '.main-navigation > div > ul > li > .sub-menu', 'border-color', '-1' ),
+
+), __( 'Background Color' ) );
+
+// Link Color
+// $config-global--color-primary-default
+add_color_rule( 'link', '#20603C', array(
+
+	// Background-color
+	array( '.a8c-posts-list-item__featured span,
+			.a8c-posts-list__view-all,
+			.button,
+			.sticky-post,
+			.wp-block-button__link,
+			.wp-block-file .wp-block-file__button,
+			.wp-block-file__button,
+			.wp-block-pullquote.is-style-solid-color,
+			body .widget_eu_cookie_law_widget #eu-cookie-law input.accept,
+			button,
+			button[data-load-more-btn],
+			input[type="submit"]', 'background-color' ),
+
+	// Text-color
+	array( '.a8c-posts-list .a8c-posts-list-item__title a:active,
+			.a8c-posts-list .a8c-posts-list-item__title a:focus,
+			.a8c-posts-list .a8c-posts-list-item__title a:hover,
+			.entry-footer a:active,
+			.entry-footer a:hover,
+			.entry-meta a:active,
+			.entry-meta a:hover,
+			.entry-title a:active,
+			.entry-title a:focus,
+			.entry-title a:hover,
+			.footer-navigation .footer-menu,
+			.page-title a:active,
+			.page-title a:focus,
+			.page-title a:hover,
+			.site-info,
+			.social-navigation a:hover,
+			.wp-block-button.is-style-outline .wp-block-button__link,
+			.wp-block-button.is-style-outline .wp-block-button__link:active,
+			.wp-block-button.is-style-outline .wp-block-button__link:not(.has-text-color),
+			.wp-block-button.is-style-outline .wp-block-button__link:hover, 
+			.wp-block-button.is-style-outline .wp-block-button__link:focus, 
+			.wp-block-button.is-style-outline .wp-block-button__link.has-focus,
+			.wp-block-button.is-style-outline.wp-block-button__link,
+			.wp-block-button.is-style-outline.wp-block-button__link:active,
+			.wp-block-button.is-style-outline.wp-block-button__link:not(.has-text-color),
+			.wp-block-button.is-style-outline.wp-block-button__link:hover, 
+			.wp-block-button.is-style-outline.wp-block-button__link:focus, 
+			.wp-block-button.is-style-outline.wp-block-button__link.has-focus, 			
+			.wp-block-latest-posts > li > a:active,
+			.wp-block-latest-posts > li > a:focus,
+			.wp-block-latest-posts > li > a:hover,
+			.wp-block-newspack-blocks-homepage-articles article .entry-title a,
+			.wp-block-newspack-blocks-homepage-articles article .entry-title a:active,
+			.wp-block-newspack-blocks-homepage-articles article .entry-title a:focus,
+			.wp-block-newspack-blocks-homepage-articles article .entry-title a:hover,
+			a,
+			.main-navigation > div > ul > li.current-menu-item > a,
+			.main-navigation > div > ul > li.focus > a,
+			.main-navigation > div > ul > li:hover > a,
+			.main-navigation > div > ul > li:hover li:hover > a, 
+			.main-navigation > div > ul > li:hover li.focus > a, 
+			.main-navigation > div > ul > li:hover li.current-menu-item > a,
+			.main-navigation > div > ul > li.focus li:hover > a, 
+			.main-navigation > div > ul > li.focus li.focus > a, 
+			.main-navigation > div > ul > li.focus li.current-menu-item > a,
+			.main-navigation > div > ul > li.current-menu-item li:hover > a,
+			.main-navigation > div > ul > li.current-menu-item li.focus > a,
+			.main-navigation > div > ul > li.current-menu-item li.current-menu-item > a', 'color' ),
+
+	// Border color left
+	array( '.wp-block-quote', 'border-left-color' ),
+
+	// Border color right
+	array( '.wp-block-quote[style*="text-align: right"],
+			.wp-block-quote[style*="text-align:right"]', 'border-right-color' ),
+
+	// Border color bottom
+	array( '.main-navigation > div > ul > li.current-menu-item > ul:before,
+			.main-navigation > div > ul > li.focus > ul:before,
+			.main-navigation > div > ul > li:hover > ul:before', 'border-bottom-color' ),
+
+	/**
+	 * Utility Classes
+	 */
+	// Background-color
+	array( '.has-primary-background-color', 'background-color' ),
+	// Text-color
+	array( '.has-primary-color', 'color' ),
+
+), __( 'Link Color' ) );
+
+// Text Color
+// $config-global--color-foreground-default
+add_color_rule( 'txt', '#3C2323', array(
+
+	// Text-color
+	array( '.comment-meta .comment-metadata,
+			.entry-footer,
+			.entry-meta,
+			.main-navigation,
+			.main-navigation a,
+			.main-navigation a:link,
+			.main-navigation a:visited,
+			.screen-reader-text:focus,
+			.social-navigation a,
+			.wp-block-code,
+			.wp-block-code pre,
+			.wp-block-latest-posts > li > a,
+			.wp-block-pullquote,
+			.wp-block-table.is-style-stripes tbody tr:nth-child(odd),
+			table.is-style-stripes tbody tr:nth-child(odd),
+			body,
+			body .widget_eu_cookie_law_widget #eu-cookie-law,
+			body .widget_eu_cookie_law_widget #eu-cookie-law.negative input.accept,
+			hr.wp-block-separator.is-style-dots:before,
+			.site-title,
+			.main-navigation > div > ul > li.current-menu-item li > a,
+			.main-navigation > div > ul > li.focus li > a,
+			.main-navigation > div > ul > li:hover li > a', 'color' ),
+
+	// Background-color
+	array( 'body .widget_eu_cookie_law_widget #eu-cookie-law.negative,
+			.wp-block-cover,
+			.wp-block-cover-image', 'background-color' ),
+
+	// Border-color
+	array( '.wp-block-code,
+			body .widget_eu_cookie_law_widget #eu-cookie-law,
+			body .widget_eu_cookie_law_widget #eu-cookie-law.negative', 'border-color' ),
+
+	// Border-top-color
+	array( '.comment-list .children > li,
+			.comment-list > li,
+			.wp-block-pullquote', 'border-top-color' ),
+
+	// Border-bottom-color
+	array( '.comment-list,
+			.wp-block-pullquote,
+			hr,
+			hr.wp-block-separator', 'border-bottom-color' ),
+
+	/**
+	 * Utility Classes
+	 */
+	// Text color
+	array( '.has-foreground-color,
+			.has-background-background-color[class],
+			.has-background-background-color.has-background-dim,
+			.has-background-dark-background-color[class],
+			.has-background-dark-background-color.has-background-dim,
+			.has-background-light-background-color[class],
+			.has-background-light-background-color.has-background-dim', 'color' ),
+
+	// Background-color
+	array( '.has-background-dim,
+			.has-foreground-background-color[class],
+			.has-foreground-background-color.has-background-dim', 'background-color' ),
+
+	// Text-color darkened
+	array( '.has-foreground-dark-color[class]', 'color', '-1' ),
+
+	// Background-color darkened
+	array( '.has-foreground-dark-background-color[class]', 'background-color', '-1' ),
+
+	// Text-color brightened
+	array( '.has-foreground-light-color[class]', 'color', '+2' ),
+
+	// Background-color brightened
+	array( '.has-foreground-light-background-color[class]', 'background-color', '+2' ),
+
+	/**
+	 * Gray (Same as text color)
+	 */
+	// Text-color
+	array( '', 'color' ),
+
+), __( 'Text Color' ) );
+
+// Accent Color
+// $config-global--color-secondary-default
+add_color_rule( 'fg1', '#655441', array(
+
+	// Text-color
+	array( '.wp-block-button.is-style-outline .wp-block-button__link:focus,
+			.wp-block-button.is-style-outline .wp-block-button__link:hover', 'color' ),
+
+	// Background-color
+	array( '.wp-block-button:not(.is-style-outline) .wp-block-button__link:focus,
+			.wp-block-button:not(.is-style-outline) .wp-block-button__link:hover', 'background-color' ),
+
+	/**
+	 * Utility Classes
+	 */
+	// Text-color
+	array( '.has-secondary-color', 'color' ),
+
+	// Background-color
+	array( '.has-secondary-background-color,
+			.has-secondary-background-color.has-background-dim', 'background-color' ),
+
+), __( 'Secondary Color' ) );
+
+/**
+ * Custom CSS
+ */
+
+function barnsbury_custom_colors_extra_css() { 
+	$colors_array = get_theme_mod( 'colors_manager' );
+	$bg           = $colors_array['colors']['bg'];
+?>
+	@media screen and (min-width: 560px) {
+		
+		.main-navigation > div > ul > li > .sub-menu {
+			background-color: <?php echo $bg; ?>;
+			border: 1px solid;
+		}
+		.main-navigation > div > ul > li.current-menu-item li > a,
+		.main-navigation > div > ul > li.focus li > a,
+		.main-navigation > div > ul > li:hover li > a {
+			color: <?php echo $bg; ?>;
+		}
+		.site-header .main-navigation > div > ul > li.current-menu-item > ul::before,
+		.site-header .main-navigation > div > ul > li.focus > ul::before,
+		.site-header .main-navigation > div > ul > li:hover > ul::before {
+			border: none;
+		}
+	}
+<?php }
+add_theme_support( 'custom_colors_extra_css', 'barnsbury_custom_colors_extra_css' ); 
+
+/**
+ * Featured Varia Palettes
+ */
+// Light
+add_color_palette( array(
+	'#FFFFFF',
+	'#1D1E1E',
+	'#C8133E',
+	'#4E2F4B',
+), 'Light' );
+// Medium
+add_color_palette( array(
+	'#EEF4F7',
+	'#242527',
+	'#35845D',
+	'#233252',
+), 'Medium' );
+// Dark
+add_color_palette( array(
+	'#1F2527',
+	'#FFFFFF',
+	'#9FD3E8',
+	'#FBE6AA',
+), 'Dark' );

+ 186 - 0
barnsbury/inc/wpcom-editor-colors.php

@@ -0,0 +1,186 @@
+<?php
+/*
+ * Custom Editor Colors: Barnsbury
+ */
+
+// Background Color (White)
+// $config-global--color-background-default
+add_editor_color_rule( 'bg', '#FFFDF6', array(
+
+	// Text-color
+	array( '#editor .editor-styles-wrapper .button,
+			#editor .editor-styles-wrapper .button.has-focus,
+			#editor .editor-styles-wrapper .button:focus,
+			#editor .editor-styles-wrapper .button:hover,
+			#editor .editor-styles-wrapper .wp-block-a8c-blog-posts + .button,
+			#editor .editor-styles-wrapper .wp-block-a8c-blog-posts + .button:focus,
+			#editor .editor-styles-wrapper .wp-block-a8c-blog-posts + .button:hover,
+			#editor .editor-styles-wrapper .wp-block-a8c-blog-posts + .has-focus.button,
+			#editor .editor-styles-wrapper .wp-block-button__link:not(.has-text-color),
+			#editor .editor-styles-wrapper .wp-block-button__link.has-focus:not(.has-text-color),
+			#editor .editor-styles-wrapper .wp-block-button__link:not(.has-text-color):focus,
+			#editor .editor-styles-wrapper .wp-block-button__link:not(.has-text-color):hover,
+			#editor .editor-styles-wrapper .wp-block-pullquote.is-style-solid-color', 'color' ),
+
+	// Background-color
+	array( '#editor .editor-styles-wrapper', 'background-color' ),
+
+	/**
+	 * Utility Classes
+	 */
+
+	// Text-color
+	array( '#editor .editor-styles-wrapper .has-primary-background-color,
+			#editor .editor-styles-wrapper .wp-block .has-primary-background-color,
+			#editor .editor-styles-wrapper .has-secondary-background-color,
+			#editor .editor-styles-wrapper .wp-block .has-secondary-background-color,
+			#editor .editor-styles-wrapper .has-foreground-background-color,
+			#editor .editor-styles-wrapper .wp-block .has-foreground-background-color,
+			#editor .editor-styles-wrapper .has-foreground-dark-background-color,
+			#editor .editor-styles-wrapper .wp-block .has-foreground-dark-background-color,
+			#editor .editor-styles-wrapper .has-foreground-light-background-color,
+			#editor .editor-styles-wrapper .wp-block .has-foreground-light-background-color,
+			#editor .editor-styles-wrapper .has-background-color,
+			#editor .editor-styles-wrapper .wp-block .has-background-color', 'color' ),
+
+	// Background-color
+	array( '#editor .editor-styles-wrapper .has-background-background-color,
+			#editor .editor-styles-wrapper .wp-block .has-background-background-color', 'background-color' ),
+
+	// Text-color darkened
+	array( '#editor .editor-styles-wrapper .has-background-dark-color,
+			#editor .editor-styles-wrapper .wp-block .has-background-dark-color', 'color', '-1'  ),
+
+	// Background-color darkened
+	array( '#editor .editor-styles-wrapper .has-background-dark-background-color,
+			#editor .editor-styles-wrapper .wp-block .has-background-dark-background-color', 'background-color', '-1' ),
+
+	// Text-color lightened
+	array( '#editor .editor-styles-wrapper .has-background-light-color,
+			#editor .editor-styles-wrapper .wp-block .has-background-light-color', 'color', '+1'  ),
+
+	// Background-color lightened
+	array( '#editor .editor-styles-wrapper .has-background-light-background-color,
+			#editor .editor-styles-wrapper .wp-block .has-background-light-background-color', 'background-color', '+1' ),
+
+), __( 'Background Color' ) );
+
+// Link Color (Blue)
+// $config-global--color-primary-default
+add_editor_color_rule( 'link', '#20603C', array(
+
+	// Text-color
+	array( '#editor .editor-styles-wrapper .wp-block-button.is-style-outline .wp-block-button__link:not(.has-text-color),
+			#editor .editor-styles-wrapper .wp-block-button__link.is-style-outline:not(.has-text-color),
+			#editor .editor-styles-wrapper .wp-block-a8c-blog-posts .entry-title a,
+			#editor .editor-styles-wrapper .wp-block-a8c-blog-posts .entry-title a:active,
+			#editor .editor-styles-wrapper .wp-block-a8c-blog-posts .entry-title a:focus,
+			#editor .editor-styles-wrapper .wp-block-a8c-blog-posts .entry-title a:hover,
+			#editor .editor-styles-wrapper .wp-block-latest-posts > li > a:active,
+			#editor .editor-styles-wrapper .wp-block-latest-posts > li > a:focus,
+			#editor .editor-styles-wrapper .wp-block-latest-posts > li > a:hover', 'color' ),
+
+	// Background-color
+	array( '#editor .editor-styles-wrapper .button,
+			#editor .editor-styles-wrapper .wp-block-a8c-blog-posts + .button,
+			#editor .editor-styles-wrapper .wp-block-button:not(.is-style-outline) .wp-block-button__link:not(.has-background),
+			#editor .editor-styles-wrapper .wp-block-button__link.is-style-outline,
+			#editor .editor-styles-wrapper .wp-block-pullquote.is-style-solid-color', 'background-color' ),
+
+	// Border-left-color
+	array( '#editor .editor-styles-wrapper .wp-block-quote', 'border-left-color' ),
+
+	/**
+	 * Utility Classes
+	 */
+
+	// Background-color
+	array( '#editor .editor-styles-wrapper .has-primary-background-color,
+			#editor .editor-styles-wrapper .wp-block .has-primary-background-color', 'background-color' ),
+
+	// Text-color
+	array( '#editor .editor-styles-wrapper .has-primary-color,
+			#editor .editor-styles-wrapper .wp-block .has-primary-color', 'color' ),
+
+), __( 'Link Color' ) );
+
+// Text Color
+// $config-global--color-foreground-default
+add_editor_color_rule( 'txt', '#3C2323', array(
+
+	// Text-color
+	array( '#editor .editor-styles-wrapper .editor-post-title__block .editor-post-title__input,
+		#editor .editor-styles-wrapper .wp-block-latest-posts > li > a,
+		#editor .editor-styles-wrapper .wp-block-pullquote,
+		#editor .editor-styles-wrapper .wp-block-separator.is-style-dots:before,
+		#editor .editor-styles-wrapper hr.is-style-dots:before,
+		#editor .editor-styles-wrapper table.is-style-stripes tbody tr:nth-child(odd),
+		#editor .editor-styles-wrapper', 'color' ),
+
+	// Border-top-color
+	array( '#editor .editor-styles-wrapper .wp-block-pullquote', 'border-top-color' ),
+
+	// Border-bottom-color
+	array( '#editor .editor-styles-wrapper .wp-block-pullquote,
+			#editor .editor-styles-wrapper .wp-block-separator,
+			#editor .editor-styles-wrapper hr', 'border-bottom-color' ),
+
+	// Border-right-color
+	array( '#editor .editor-styles-wrapper .wp-block-separator[style*="text-align: right"],
+			#editor .editor-styles-wrapper .wp-block-separator[style*="text-align:right"],
+			#editor .editor-styles-wrapper hr[style*="text-align: right"],
+			#editor .editor-styles-wrapper hr[style*="text-align:right"]', 'border-right-color' ),
+
+	/**
+	 * Utility Classes
+	 */
+
+	// Text-color
+	array( '#editor .editor-styles-wrapper .has-background-background-color,
+			#editor .editor-styles-wrapper .wp-block .has-background-background-color,
+			#editor .editor-styles-wrapper .has-background-dark-background-color,
+			#editor .editor-styles-wrapper .wp-block .has-background-dark-background-color,
+			#editor .editor-styles-wrapper .has-background-light-background-color,
+			#editor .editor-styles-wrapper .wp-block .has-background-light-background-color,
+			#editor .editor-styles-wrapper .has-foreground-color,
+			#editor .editor-styles-wrapper .wp-block .has-foreground-color', 'color' ),
+
+	// Background-color
+	array( '#editor .editor-styles-wrapper .has-foreground-background-color,
+			#editor .editor-styles-wrapper .wp-block .has-foreground-background-color', 'background-color' ),
+
+	// Text-color darkened
+	array( '#editor .editor-styles-wrapper .has-foreground-dark-color,
+			#editor .editor-styles-wrapper .wp-block .has-foreground-dark-color', 'color', '-1' ),
+
+	// Background-color darkened
+	array( '#editor .editor-styles-wrapper .has-foreground-dark-background-color,
+			#editor .editor-styles-wrapper .wp-block .has-foreground-dark-background-color', 'background-color', '-1' ),
+
+	// Text-color brightened
+	array( '#editor .editor-styles-wrapper .has-foreground-light-color,
+			#editor .editor-styles-wrapper .wp-block .has-foreground-light-color', 'color', '+2' ),
+
+	// Background-color brightened
+	array( '#editor .editor-styles-wrapper .has-foreground-light-background-color,
+			#editor .editor-styles-wrapper .wp-block .has-foreground-light-background-color', 'background-color', '+2' ),
+
+), __( 'Text Color' ) );
+
+// Accent Color
+// $config-global--color-secondary-default
+add_editor_color_rule( 'fg1', '#655441', array(
+
+	/**
+	 * Utility Classes
+	 */
+
+	// Text-color
+	array( '#editor .editor-styles-wrapper .has-secondary-color,
+			#editor .editor-styles-wrapper .wp-block .has-secondary-color', 'color' ),
+
+	// Background-color
+	array( '#editor .editor-styles-wrapper .has-secondary-background-color,
+			#editor .editor-styles-wrapper .wp-block .has-secondary-background-color', 'background-color' ),
+
+), __( 'Secondary Color' ) );

+ 21 - 0
barnsbury/inc/wpcom.php

@@ -0,0 +1,21 @@
+<?
+/**
+ * Adds support for wp.com-specific theme functions.
+ *
+ * @global array $themecolors
+ */
+function barnsbury_wpcom_setup() {
+	global $themecolors;
+
+	// Set theme colors for third party services.
+	if ( ! isset( $themecolors ) ) {
+		$themecolors = array(
+			'bg'     => 'FFFDF6', // $config-global--color-background-default
+			'border' => '3C2323', // $config-global--color-border-default
+			'text'   => '3C2323', // $config-global--color-foreground-default
+			'link'   => '20603C', // $config-global--color-primary-default
+			'url'    => '20603C', // $config-global--color-primary-default
+		);
+	}
+}
+add_action( 'after_setup_theme', 'barnsbury_wpcom_setup' );

+ 1 - 0
theme-dev-utils

@@ -0,0 +1 @@
+/Users/allancole/GitHub/Automattic/theme-dev-utils

+ 1 - 0
twentytwenty

@@ -0,0 +1 @@
+/Users/allancole/GitHub/WordPress/twentytwenty