Adjust colors.

This commit is contained in:
Kjell Reigstad 2021-01-05 12:36:21 -05:00
parent f4734badd1
commit e7b5d0657d
2 changed files with 43 additions and 0 deletions

View file

@ -23,6 +23,45 @@ if ( ! function_exists( 'blank_page_setup' ) ) :
// Enqueue editor styles.
add_editor_style( 'variables.css' );
// Editor color palette.
$colors_theme_mod = get_theme_mod( 'custom_colors_active' );
$primary = ( ! empty( $colors_theme_mod ) && 'default' === $colors_theme_mod || empty( get_theme_mod( 'seedlet_--global--color-primary' ) ) ) ? '#000000' : get_theme_mod( 'seedlet_--global--color-primary' );
$secondary = ( ! empty( $colors_theme_mod ) && 'default' === $colors_theme_mod || empty( get_theme_mod( 'seedlet_--global--color-secondary' ) ) ) ? '#007cba' : get_theme_mod( 'seedlet_--global--color-secondary' );
$foreground = ( ! empty( $colors_theme_mod ) && 'default' === $colors_theme_mod || empty( get_theme_mod( 'seedlet_--global--color-foreground' ) ) ) ? '#333333' : get_theme_mod( 'seedlet_--global--color-foreground' );
$tertiary = ( ! empty( $colors_theme_mod ) && 'default' === $colors_theme_mod || empty( get_theme_mod( 'seedlet_--global--color-tertiary' ) ) ) ? '#FAFAFA' : get_theme_mod( 'seedlet_--global--color-tertiary' );
$background = ( ! empty( $colors_theme_mod ) && 'default' === $colors_theme_mod || empty( get_theme_mod( 'seedlet_--global--color-background' ) ) ) ? '#FFFFFF' : get_theme_mod( 'seedlet_--global--color-background' );
add_theme_support(
'editor-color-palette',
array(
array(
'name' => __( 'Primary', 'blank-page' ),
'slug' => 'primary',
'color' => $primary,
),
array(
'name' => __( 'Secondary', 'blank-page' ),
'slug' => 'secondary',
'color' => $secondary,
),
array(
'name' => __( 'Foreground', 'blank-page' ),
'slug' => 'foreground',
'color' => $foreground,
),
array(
'name' => __( 'Tertiary', 'blank-page' ),
'slug' => 'tertiary',
'color' => $tertiary,
),
array(
'name' => __( 'Background', 'blank-page' ),
'slug' => 'background',
'color' => $background,
),
)
);
}
endif;
add_action( 'after_setup_theme', 'blank_page_setup', 11 );

View file

@ -3,4 +3,8 @@
/* Font Family */
--global--font-primary: var(--font-headings, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif);
--global--font-secondary: var(--font-base, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif);
/* Colors */
--global--color-secondary: #007cba;
--global--color-secondary-hover: #006ba1;
--global--color-tertiary: #FAFAFA;
}