- Timestamp:
- 10/22/2019 06:25:45 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentytwenty/inc/custom-css.php
r46446 r46571 56 56 57 57 // Get variables. 58 $body = sanitize_hex_color( twentytwenty_get_color_for_area( 'content', 'text' ) ); 59 $body_default = '#000000'; 60 $accent = sanitize_hex_color( twentytwenty_get_color_for_area( 'content', 'accent' ) ); 61 $accent_default = '#cd2653'; 58 $body = sanitize_hex_color( twentytwenty_get_color_for_area( 'content', 'text' ) ); 59 $body_default = '#000000'; 60 $secondary = sanitize_hex_color( twentytwenty_get_color_for_area( 'content', 'secondary' ) ); 61 $secondary_default = '#6d6d6d'; 62 $borders = sanitize_hex_color( twentytwenty_get_color_for_area( 'content', 'borders' ) ); 63 $borders_default = '#dcd7ca'; 64 $accent = sanitize_hex_color( twentytwenty_get_color_for_area( 'content', 'accent' ) ); 65 $accent_default = '#cd2653'; 66 62 67 /** 63 68 * Filters the CSS selectors targeting button component on frontend to apply common css … … 70 75 71 76 // Header. 72 $header_footer_ text = sanitize_hex_color( twentytwenty_get_color_for_area( 'header-footer', 'text' ) );73 $header_footer_ accent = sanitize_hex_color( twentytwenty_get_color_for_area( 'header-footer', 'accent' ) );77 $header_footer_background = sanitize_hex_color( twentytwenty_get_color_for_area( 'header-footer', 'background' ) ); 78 $header_footer_background_default = '#ffffff'; 74 79 75 80 // Cover. … … 127 132 // Accent color. 128 133 if ( $accent && $accent !== $accent_default ) { 129 twentytwenty_generate_css( '.editor-styles-wrapper a, .editor-styles-wrapper .has-drop-cap:not(:focus):first-letter', 'color', $accent ); 130 twentytwenty_generate_css( '.editor-styles-wrapper blockquote, .editor-styles-wrapper .wp-block-quote', 'border-color', $accent, '', ' !important' ); 131 twentytwenty_generate_css( '.editor-styles-wrapper .wp-block-file .wp-block-file__textlink', 'color', $accent ); 132 twentytwenty_generate_css( $buttons_targets, 'background', $accent ); 133 twentytwenty_generate_css( '.editor-styles-wrapper .wp-block-button.is-style-outline .wp-block-button__link', 'border-color', $accent ); 134 twentytwenty_generate_css( '.editor-styles-wrapper .wp-block-button.is-style-outline .wp-block-button__link', 'color', $accent ); 134 twentytwenty_generate_css( '.has-accent-color, .editor-styles-wrapper .editor-block-list__layout a, .editor-styles-wrapper .has-drop-cap:not(:focus)::first-letter, .editor-styles-wrapper .wp-block-button.is-style-outline .wp-block-button__link, .editor-styles-wrapper .wp-block-pullquote::before, .editor-styles-wrapper .wp-block-file .wp-block-file__textlink', 'color', $accent ); 135 twentytwenty_generate_css( '.editor-styles-wrapper .wp-block-quote', 'border-color', $accent, '' ); 136 twentytwenty_generate_css( '.has-accent-background-color, .editor-styles-wrapper .wp-block-button__link, .editor-styles-wrapper .wp-block-file__button', 'background-color', $accent ); 135 137 } 136 138 … … 140 142 } 141 143 144 // Borders color. 145 if ( $borders && $borders !== $borders_default ) { 146 twentytwenty_generate_css( '.editor-styles-wrapper .wp-block-code, .editor-styles-wrapper pre, .editor-styles-wrapper .wp-block-preformatted pre, .editor-styles-wrapper .wp-block-verse pre, .editor-styles-wrapper fieldset, .editor-styles-wrapper .wp-block-table, .editor-styles-wrapper .wp-block-table *, .editor-styles-wrapper .wp-block-table.is-style-stripes, .editor-styles-wrapper .wp-block-latest-posts.is-grid li', 'border-color', $borders ); 147 twentytwenty_generate_css( '.editor-styles-wrapper .wp-block-table caption, .editor-styles-wrapper .wp-block-table.is-style-stripes tbody tr:nth-child(odd)', 'background-color', $borders ); 148 } 149 142 150 // Text color. 143 151 if ( $body && $body !== $body_default ) { 144 twentytwenty_generate_css( 'body .editor-styles-wrapper, body .editor-post-title__block, body .editor-post-title__input, body textarea, .editor-post-title__block .editor-post-title__input', 'color', $body ); 152 twentytwenty_generate_css( 'body .editor-styles-wrapper, .editor-post-title__block .editor-post-title__input, .editor-post-title__block .editor-post-title__input:focus', 'color', $body ); 153 } 154 155 // Secondary color. 156 if ( $secondary && $secondary !== $secondary_default ) { 157 twentytwenty_generate_css( '.editor-styles-wrapper figcaption, .editor-styles-wrapper cite, .editor-styles-wrapper .wp-block-quote__citation, .editor-styles-wrapper .wp-block-quote cite, .editor-styles-wrapper .wp-block-quote footer, .editor-styles-wrapper .wp-block-pullquote__citation, .editor-styles-wrapper .wp-block-pullquote cite, .editor-styles-wrapper .wp-block-pullquote footer, .editor-styles-wrapper ul.wp-block-archives li, .editor-styles-wrapper ul.wp-block-categories li, .editor-styles-wrapper ul.wp-block-latest-posts li, .editor-styles-wrapper ul.wp-block-categories__list li, .editor-styles-wrapper .wp-block-latest-comments time, .editor-styles-wrapper .wp-block-latest-posts time', 'color', $secondary ); 158 } 159 160 // Header Footer Background Color. 161 if ( $header_footer_background && $header_footer_background !== $header_footer_background_default ) { 162 twentytwenty_generate_css( '.editor-styles-wrapper .wp-block-pullquote::before', 'background-color', $header_footer_background ); 145 163 } 146 164 } elseif ( 'classic-editor' === $type ) {
Note: See TracChangeset
for help on using the changeset viewer.