123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671 |
- <?php
- /* Custom Colors: Redhill */
- // Background Color
- // $config-global--color-background-default
- add_color_rule(
- 'bg',
- '#FFFFFF',
- array(
- // Background-color
- array(
- '.screen-reader-text:focus,
- body,
- .wp-block-table.is-style-stripes tbody tr:nth-child(odd),
- table.is-style-stripes tbody tr:nth-child(odd),
- body .widget_eu_cookie_law_widget #eu-cookie-law,
- body .widget_eu_cookie_law_widget #eu-cookie-law.negative input.accept,
- .main-navigation > div,
- .main-navigation > div > ul > li > .sub-menu',
- '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,
- .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-search .wp-block-search__button,
- .wp-block-gallery .blocks-gallery-image figcaption,
- .wp-block-gallery .blocks-gallery-item figcaption,
- .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"],
- .main-navigation > div > ul > li.current-menu-item > a,
- .main-navigation > div > ul > li.current-menu-item li > a,
- .main-navigation > div > ul > li.focus > a,
- .main-navigation > div > ul > li.focus li > a,
- .main-navigation > div > ul > li:hover > a,
- .main-navigation > div > ul > li:hover li > a',
- 'color',
- ),
- // Background-color lightened
- array(
- '.wp-block-table.is-style-stripes tbody tr:nth-child(odd),
- table.is-style-stripes tbody tr:nth-child(odd)',
- 'background-color',
- '+1',
- ),
- // Border-bottom-color lightened
- array(
- '.comments-area .comment-list,
- .widget_archive ul,
- .widget_authors ul,
- .widget_categories ul,
- .widget_jp_blogs_i_follow ul,
- .widget_links ul,
- .widget_meta ul,
- .widget_nav_menu ul,
- .widget_pages ul,
- .widget_recent_comments ul,
- .widget_recent_entries ul,
- .widget_rss ul,
- .widget_rss_links ul,
- .widget_top-click ul,
- .widget_top-posts ul,
- .widget_upcoming_events_widget ul',
- 'border-bottom-color',
- '+1',
- ),
- // Border-bottom-color lightened
- array(
- '.comments-area .children > li,
- .comments-area .comment-list > li,
- .widget_archive li,
- .widget_authors li,
- .widget_categories li,
- .widget_jp_blogs_i_follow li,
- .widget_links li,
- .widget_meta li,
- .widget_nav_menu li,
- .widget_pages li,
- .widget_recent_comments li,
- .widget_recent_entries li,
- .widget_rss li,
- .widget_rss_links li,
- .widget_top-click li,
- .widget_top-posts li,
- .widget_upcoming_events_widget li',
- 'border-top-color',
- '+1',
- ),
- /**
- * Utility Classes
- */
- // Text-color
- array(
- '.has-primary-background-color[class],
- .has-primary-background-color.has-background-dim[class],
- .has-secondary-background-color[class],
- .has-secondary-background-color.has-background-dim[class],
- .has-foreground-background-color[class],
- .has-foreground-background-color.has-background-dim[class],
- .has-foreground-dark-background-color[class],
- .has-foreground-dark-background-color.has-background-dim[class],
- .has-foreground-light-background-color[class],
- .has-foreground-light-background-color.has-background-dim[class],
- .has-background-color[class],
- .has-background-dark-color[class],
- .has-background-light-color[class]',
- 'color',
- ),
- // Background-color
- array(
- '.has-background-background-color[class],
- .has-background-background-color.has-background-dim[class]',
- 'background-color',
- ),
- // Text-color darkened
- array(
- '.has-background-dark-color[class],
- .has-background-dark-color.has-background-dim[class]',
- 'color',
- '-1',
- ),
- // Background-color darkened
- array(
- '.has-background-dark-background-color[class],
- .has-background-dark-background-color.has-background-dim[class]',
- 'background-color',
- '-1',
- ),
- // Text-color lightened
- array(
- '.has-background-light-color[class],
- .has-background-light-color.has-background-dim[class]',
- 'color',
- '+1',
- ),
- // Background-color lightened
- array(
- '.has-background-light-background-color[class],
- .has-background-light-background-color.has-background-dim[class]',
- 'background-color',
- '+1',
- ),
- /**
- * Grays
- * Uses a slightly darker color
- */
- // Border-color
- array(
- '.wp-block-code,
- .wp-block-table td,
- .wp-block-table th,
- body .widget_eu_cookie_law_widget #eu-cookie-law,
- input[type="color"],
- input[type="date"],
- input[type="datetime"],
- input[type="datetime-local"],
- input[type="email"],
- input[type="month"],
- input[type="number"],
- input[type="password"],
- input[type="range"],
- input[type="search"],
- input[type="tel"],
- input[type="text"],
- input[type="time"],
- input[type="url"],
- input[type="week"],
- .wp-block-search .wp-block-search__input:focus,
- select,
- table td,
- table th,
- textarea,
- ',
- 'border-color',
- '-1',
- ),
- // Border-top-color
- array(
- '.comment-list .children > li,
- .comment-list > li,
- .entry-footer,
- .wp-block-pullquote,
- #jp-relatedposts h3.jp-relatedposts-headline em:before',
- 'border-top-color',
- '-1',
- ),
- // Border-bottom-color
- array(
- '.comment-list,
- .wp-block-pullquote,
- hr,
- hr.wp-block-separator',
- 'border-bottom-color',
- '-1',
- ),
- // Color
- array( 'hr.wp-block-separator.is-style-dots:before', 'color', '-1' ),
- // Background-color
- array(
- '.comments-area:before,
- .post-navigation:before,
- .pagination:before,
- body .widget_eu_cookie_law_widget #eu-cookie-law.negative input.accept.has-focus,
- body .widget_eu_cookie_law_widget #eu-cookie-law.negative input.accept:focus,
- body .widget_eu_cookie_law_widget #eu-cookie-law.negative input.accept:hover',
- 'background-color',
- '-1',
- ),
- ),
- __( 'Background Color' )
- );
- // Link Color
- // $config-global--color-primary-default
- add_color_rule(
- 'link',
- '#CA2017',
- array(
- // Background-color
- array(
- '.a8c-posts-list-item__featured span,
- .a8c-posts-list__view-all,
- .button,
- .main-navigation #toggle:focus + #toggle-menu,
- .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],
- .wp-block-search .wp-block-search__button,
- .wp-block-search .wp-block-search__button:focus,
- .wp-block-search .wp-block-search__button:hover,
- .wp-block-search .wp-block-search__button:not(.has-background-color):hover,
- input[type="submit"],
- .main-navigation > div > ul > li.current-menu-item > a,
- .main-navigation > div > ul > li.current-menu-item li.current-menu-item > a,
- .main-navigation > div > ul > li.current-menu-item li.focus > a,
- .main-navigation > div > ul > li.current-menu-item li:hover > a,
- .main-navigation > div > ul > li.focus > a,
- .main-navigation > div > ul > li.focus li.current-menu-item > a,
- .main-navigation > div > ul > li.focus li.focus > a,
- .main-navigation > div > ul > li.focus li:hover > a,
- .main-navigation > div > ul > li:hover > a,
- .main-navigation > div > ul > li:hover li.current-menu-item > a,
- .main-navigation > div > ul > li:hover li.focus > a,
- .main-navigation > div > ul > li:hover li:hover > a',
- 'background-color',
- ),
- // Text-color
- array(
- '.a8c-posts-list-item__title a:active,
- .a8c-posts-list-item__title a:focus,
- .a8c-posts-list-item__title a:hover,
- .comment-meta .comment-metadata a:active,
- .comment-meta .comment-metadata a:focus,
- .comment-meta .comment-metadata a:hover,
- .comment-navigation a:active,
- .comment-navigation a:focus,
- .comment-navigation a:hover,
- .footer-navigation .footer-menu a:hover,
- .main-navigation a:hover,
- .page-title a:active,
- .page-title a:focus,
- .page-title a:hover,
- .pagination .nav-links > *.current,
- .pagination .nav-links > *:active,
- .pagination .nav-links > *:focus,
- .pagination .nav-links > *:hover,
- .post-navigation a:active,
- .post-navigation a:focus,
- .post-navigation a:hover,
- .site-info a:hover,
- .site-title a:hover,
- .social-navigation a,
- .wp-block-button.is-style-outline.wp-block-button__link,
- .wp-block-button.is-style-outline .wp-block-button__link,
- .wp-block-button.is-style-outline:not(.has-text-color),
- .wp-block-button.is-style-outline:not(.has-text-color):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:not(.has-text-color):active,
- .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,
- article .entry-header .entry-title a:active,
- article .entry-header .entry-title a:focus,
- article .entry-header .entry-title a:hover',
- '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',
- ),
- /**
- * Utility Classes
- */
- // Text-color
- array(
- '.has-primary-color[class],
- .has-primary-color.has-background-dim[class]',
- 'color',
- ),
- // Background-color
- array(
- '.has-primary-background-color[class],
- .has-primary-background-color.has-background-dim[class]',
- 'background-color',
- ),
- ),
- __( 'Link Color' )
- );
- // Text Color (Gray)
- // $config-global--color-foreground-default
- add_color_rule(
- 'txt',
- '#222222',
- array(
- // Text-color
- array(
- '.a8c-posts-list__item .a8c-posts-list-item__meta a:active,
- .a8c-posts-list__item .a8c-posts-list-item__meta a:hover,
- .comment-meta .comment-metadata,
- .comment-meta .comment-metadata a:active,
- .comment-meta .comment-metadata a:hover,
- .entry-footer a:active,
- .entry-footer a:hover,
- .entry-meta a:active,
- .entry-meta a:hover,
- .main-navigation,
- .main-navigation a,
- .main-navigation a:link,
- .main-navigation a:visited,
- .post-navigation a,
- .screen-reader-text:focus,
- .social-navigation a:hover,
- .wp-block-button.is-style-outline .wp-block-button__link.has-focus,
- .wp-block-button.is-style-outline .wp-block-button__link:focus,
- .wp-block-button.is-style-outline .wp-block-button__link:hover,
- .wp-block-button.is-style-outline.wp-block-button__link.has-focus,
- .wp-block-button.is-style-outline.wp-block-button__link:focus,
- .wp-block-button.is-style-outline.wp-block-button__link:hover,
- .wp-block-code,
- .wp-block-code pre,
- .wp-block-newspack-blocks-homepage-articles article .cat-links a:active,
- .wp-block-newspack-blocks-homepage-articles article .cat-links a:hover,
- .wp-block-newspack-blocks-homepage-articles article .entry-meta a:active,
- .wp-block-newspack-blocks-homepage-articles article .entry-meta a:hover,
- .wp-block-newspack-blocks-homepage-articles article .entry-title a:hover,
- .wp-block-pullquote,
- .wp-block-table.is-style-stripes tbody tr:nth-child(odd),
- table.is-style-stripes tbody tr:nth-child(odd),
- a:hover,
- body,
- body .widget_eu_cookie_law_widget #eu-cookie-law,
- body .widget_eu_cookie_law_widget #eu-cookie-law.negative input.accept',
- 'color',
- ),
- // Background-color
- array(
- '.a8c-posts-list__view-all:focus,
- .a8c-posts-list__view-all:hover,
- .button:focus,
- .button:hover,
- .has-focus.a8c-posts-list__view-all,
- .has-focus.button,
- .has-focus.wp-block-button__link,
- .has-focus.wp-block-file__button,
- .has-foreground-background-color[class],
- .wp-block-button__link:focus,
- .wp-block-button__link:hover,
- .wp-block-file__button:focus,
- .wp-block-file__button:hover,
- 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.has-focus,
- button:focus,
- button:hover,
- input.has-focus[type="submit"],
- input:focus[type="submit"],
- input:hover[type="submit"],
- .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',
- 'background-color',
- ),
- // Border-color
- array(
- 'input[type="color"]:focus,
- input[type="date"]:focus,
- input[type="datetime"]:focus,
- input[type="datetime-local"]:focus,
- input[type="email"]:focus,
- input[type="month"]:focus,
- input[type="number"]:focus,
- input[type="password"]:focus,
- input[type="range"]:focus,
- input[type="search"]:focus,
- input[type="tel"]:focus,
- input[type="text"]:focus,
- input[type="time"]:focus,
- input[type="url"]:focus,
- input[type="week"]:focus,
- textarea:focus',
- 'border-color',
- ),
- // Border-top-color
- array( '.site', 'border-top-color' ),
- // Text-color brightened
- array(
- '.a8c-posts-list__item .a8c-posts-list-item__meta,
- .comment-meta .comment-metadata,
- .comment-navigation a,
- .entry-footer,
- .entry-meta,
- .footer-navigation .footer-menu,
- .pagination .nav-links > *,
- .post-navigation .meta-nav,
- .site-branding,
- .site-info,
- .wp-block-image figcaption,
- .wp-block-latest-comments .wp-block-latest-comments__comment-date,
- .wp-block-latest-posts .wp-block-latest-posts__post-date,
- .wp-block-newspack-blocks-homepage-articles article .cat-links,
- .wp-block-newspack-blocks-homepage-articles article .entry-meta,
- .wp-block-pullquote .wp-block-pullquote__citation,
- .wp-block-pullquote cite,
- .wp-block-pullquote footer,
- .wp-block-quote .wp-block-quote__citation,
- .wp-block-quote cite,
- .wp-block-quote footer,
- .wp-block-quote.is-large .wp-block-quote__citation,
- .wp-block-quote.is-large cite,
- .wp-block-quote.is-large footer,
- .wp-block-quote.is-style-large .wp-block-quote__citation,
- .wp-block-quote.is-style-large cite,
- .wp-block-quote.is-style-large footer,
- .wp-block-video figcaption,
- figcaption',
- 'color',
- '+2',
- ),
- // Text-color darkened
- array( '.site-title', 'color', '-1' ),
- // Border-color darkened
- array( 'body .widget_eu_cookie_law_widget #eu-cookie-law.negative', 'border-color', '-1' ),
- // Border-color with less opacity (dim)
- array( '.wp-block-search .wp-block-search__input', 'border-color', 0.8 ),
- /**
- * Utility Classes
- */
- // Foreground
- array(
- '.has-background-background-color[class],
- .has-background-background-color.has-background-dim[class],
- .has-background-dark-background-color[class],
- .has-background-dark-background-color.has-background-dim[class],
- .has-background-light-background-color[class],
- .has-background-light-background-color.has-background-dim[class],
- .has-foreground-color[class]',
- 'color',
- ),
- // Background-color
- array(
- '.has-background-dim[class],
- .has-foreground-background-color[class],
- .has-foreground-background-color.has-background-dim[class]',
- 'background-color',
- ),
- // Text-color darkened
- array(
- '.has-foreground-dark-color[class],
- .has-foreground-dark-color.has-background-dim[class]',
- 'color',
- '-1',
- ),
- // Background-color darkened
- array(
- '.has-foreground-dark-background-color[class],
- .has-foreground-dark-background-color.has-background-dim[class]',
- 'background-color',
- '-1',
- ),
- // Text-color brightened
- array(
- '.has-foreground-light-color[class],
- .has-foreground-light-color.has-background-dim[class]',
- 'color',
- '+2',
- ),
- // Background-color brightened
- array(
- '.has-foreground-light-background-color[class],
- .has-foreground-light-background-color.has-background-dim[class]',
- 'background-color',
- '+2',
- ),
- ),
- __( 'Text Color' )
- );
- // Accent Color
- // $config-global--color-secondary-default
- add_color_rule(
- 'fg1',
- '#007FDB',
- array(
- /**
- * Utility Classes
- */
- // Text-color
- array(
- '.has-secondary-color[class],
- .has-secondary-color.has-background-dim[class]',
- 'color',
- ),
- // Background-color
- array(
- '.has-secondary-background-color[class],
- .has-secondary-background-color.has-background-dim[class]',
- 'background-color',
- ),
- ),
- __( 'Secondary Color' )
- );
- /**
- * Custom CSS
- */
- function redhill_custom_colors_extra_css() { ?>
- @media screen and (max-width: 560px) {
- /* Prevent background color hovers on mobile */
- .site-header .main-navigation > div,
- .site-header .main-navigation > div > ul > li.current-menu-item > a,
- .site-header .main-navigation > div > ul > li.current-menu-item li.current-menu-item > a,
- .site-header .main-navigation > div > ul > li.current-menu-item li.focus > a,
- .site-header .main-navigation > div > ul > li.current-menu-item li:hover > a,
- .site-header .main-navigation > div > ul > li.focus > a,
- .site-header .main-navigation > div > ul > li.focus li.current-menu-item > a,
- .site-header .main-navigation > div > ul > li.focus li.focus > a,
- .site-header .main-navigation > div > ul > li.focus li:hover > a,
- .site-header .main-navigation > div > ul > li:hover > a,
- .site-header .main-navigation > div > ul > li:hover li.current-menu-item > a,
- .site-header .main-navigation > div > ul > li:hover li.focus > a,
- .site-header .main-navigation > div > ul > li:hover li:hover > a,
- .site-header .main-navigation > div > ul > li:hover li > a {
- background: transparent;
- color: inherit;
- }
- .site-header .main-navigation > div > ul > li.current-menu-item li.focus > a,
- .site-header .main-navigation > div > ul > li.current-menu-item li:hover > a,
- .site-header .main-navigation > div > ul > li.focus > a,
- .site-header .main-navigation > div > ul > li.focus li.current-menu-item > a,
- .site-header .main-navigation > div > ul > li.focus li.focus > a,
- .site-header .main-navigation > div > ul > li.focus li:hover > a,
- .site-header .main-navigation > div > ul > li:hover > a,
- .site-header .main-navigation > div > ul > li:hover li.current-menu-item > a,
- .site-header .main-navigation > div > ul > li:hover li.focus > a,
- .site-header .main-navigation > div > ul > li:hover li:hover > a {
- text-decoration: underline;
- }
- }
- <?php
- }
- add_theme_support( 'custom_colors_extra_css', 'redhill_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'
- );
|