- Timestamp:
- 11/02/2018 11:52:16 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.0/src/wp-content/themes/twentynineteen/inc/color-patterns.php
r43842 r43860 13 13 function twentynineteen_custom_colors_css() { 14 14 15 $default_primary_color = 199; 16 $primary_color = absint( get_theme_mod( 'colorscheme_hue', $default_primary_color ) ); 15 if ( 'default' === get_theme_mod( 'colorscheme', 'default' ) ) { 16 $primary_color = 199; 17 } else { 18 $primary_color = absint( get_theme_mod( 'colorscheme_primary_hue', 199 ) ); 19 } 17 20 18 21 /** … … 24 27 */ 25 28 26 $saturation = absint( apply_filters( 'twentynineteen_custom_colors_saturation', 100 ) ); 27 $reduced_saturation = ( .8 * $saturation ) . '%'; 28 $saturation = $saturation . '%'; 29 $saturation = absint( apply_filters( 'twentynineteen_custom_colors_saturation', 100 ) ); 30 $saturation = $saturation . '%'; 31 32 $lightness = absint( apply_filters( 'twentynineteen_custom_colors_lightness', 33 ) ); 33 $lightness = $lightness . '%'; 34 35 $lightness_hover = absint( apply_filters( 'twentynineteen_custom_colors_lightness_hover', 23 ) ); 36 $lightness_hover = $lightness_hover . '%'; 29 37 30 38 $theme_css = ' … … 55 63 .entry-content > *[class^="wp-block-"].is-style-solid-color .has-primary-background-color, 56 64 .entry-content .wp-block-file .wp-block-file__button { 57 background-color: hsl( ' . $primary_color . ', ' . $saturation . ', 33%); /* base: #0073a8; */65 background-color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */ 58 66 } 59 67 … … 90 98 .entry-content > *[class^="wp-block-"] .has-primary-color, 91 99 .entry-content > *[class^="wp-block-"].is-style-solid-color .has-primary-color { 92 color: hsl( ' . $primary_color . ', ' . $saturation . ', 33%); /* base: #0073a8; */100 color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */ 93 101 } 94 102 … … 100 108 .entry-content .wp-block-quote:not(.is-large), 101 109 .entry-content .wp-block-quote:not(.is-style-large) { 102 border-left-color: hsl( ' . $primary_color . ', ' . $saturation . ', 33%); /* base: #0073a8; */110 border-left-color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */ 103 111 } 104 112 … … 123 131 input[type="color"]:focus, 124 132 textarea:focus { 125 border-color: hsl( ' . $primary_color . ', ' . $saturation . ', 33%); /* base: #0073a8; */133 border-color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */ 126 134 } 127 135 128 136 .gallery-item > div > a:focus { 129 box-shadow: 0 0 0 2px hsl( ' . $primary_color . ', ' . $saturation . ', 33%); /* base: #0073a8; */137 box-shadow: 0 0 0 2px hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */ 130 138 } 131 139 … … 140 148 #cancel-comment-reply-link:hover, 141 149 .widget a:hover { 142 color: hsl( ' . $primary_color . ', ' . $saturation . ', 23%); /* base: #005177; */150 color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness_hover . ' ); /* base: #005177; */ 143 151 } 144 152 … … 149 157 .main-navigation .sub-menu > li > a:not(.mobile-submenu-expand):hover, 150 158 .main-navigation .sub-menu > li > a:not(.mobile-submenu-expand):focus { 151 background: hsl( ' . $primary_color . ', ' . $saturation . ', 23%); /* base: #005177; */159 background: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness_hover . ' ); /* base: #005177; */ 152 160 }'; 153 161 … … 165 173 .editor-block-list__layout .editor-block-list__block .wp-block-button.is-style-outline:focus .wp-block-button__link:not(.has-text-color), 166 174 .editor-block-list__layout .editor-block-list__block .wp-block-button.is-style-outline:active .wp-block-button__link:not(.has-text-color) { 167 color: hsl( ' . $primary_color . ', ' . $saturation . ', 33%); /* base: #0073a8; */175 color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */ 168 176 } 169 177 170 178 .editor-block-list__layout .editor-block-list__block .wp-block-quote:not(.is-large):not(.is-style-large), 171 179 .editor-styles-wrapper .editor-block-list__layout .wp-block-freeform blockquote { 172 border-left: 2px solid hsl( ' . $primary_color . ', ' . $saturation . ', 33%); /* base: #0073a8; */180 border-left: 2px solid hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */ 173 181 } 174 182 175 183 .editor-block-list__layout .editor-block-list__block .wp-block-pullquote.is-style-solid-color:not(.has-background-color) { 176 background-color: hsl( ' . $primary_color . ', ' . $saturation . ', 33%); /* base: #0073a8; */184 background-color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */ 177 185 } 178 186 … … 182 190 .editor-block-list__layout .editor-block-list__block .wp-block-button:not(.is-style-outline) .wp-block-button__link:focus, 183 191 .editor-block-list__layout .editor-block-list__block .wp-block-button:not(.is-style-outline) .wp-block-button__link:hover { 184 background-color: hsl( ' . $primary_color . ', ' . $saturation . ', 33%); /* base: #0073a8; */192 background-color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */ 185 193 } 186 194 … … 188 196 .editor-block-list__layout .editor-block-list__block a:hover, 189 197 .editor-block-list__layout .editor-block-list__block a:active { 190 color: hsl( ' . $primary_color . ', ' . $saturation . ', 23%); /* base: #005177; */198 color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness_hover . ' ); /* base: #005177; */ 191 199 } 192 200
Note: See TracChangeset
for help on using the changeset viewer.