--spacing--large: clamp(2rem, 7vw, 8rem); }'; } if ($theme === 'generatepress') { $settings = (array) get_option('generate_settings', []); if (! array_key_exists('background_color', $settings)) { $background = '#f7f8f9'; } else { $background = $settings['background_color']; } if (! array_key_exists('text_color', $settings)) { $foreground = '#222222'; } else { $foreground = $settings['text_color']; } if (! array_key_exists('link_color', $settings)) { $primary = '#1e73be'; } else { $primary = $settings['link_color']; } if (! array_key_exists('link_color', $settings)) { $primary = '#1e73be'; } else { $primary = $settings['link_color']; } $css = 'body, .editor-styles-wrapper { --wp--preset--color--background: ' . $background . '; --wp--preset--color--foreground: ' . $foreground . '; --wp--preset--color--primary: ' . $primary . '; --wp--preset--color--secondary: #636363; --wp--style--block-gap: 3rem; --wp--custom--spacing--large: clamp(2rem, 7vw, 8rem); --responsive--alignwide-width: 1120px; }'; }//end if if ($theme === 'twentytwentytwo') { $css = 'body, .editor-styles-wrapper { --extendify--spacing--large: clamp(2rem,8vw,8rem); }'; } if ($theme === 'twentytwentyone') { $css = 'body, .editor-styles-wrapper { --wp--preset--color--background: var(--global--color-background); --wp--preset--color--foreground: var(--global--color-primary); --wp--preset--color--primary: var(--global--color-gray); --wp--preset--color--secondary: #464b56; --wp--preset--color--tertiary: var(--global--color-light-gray); --wp--style--block-gap: var(--global--spacing-unit); --wp--preset--font-size--large: 2.5rem; --wp--preset--font-size--huge: var(--global--font-size-xxl); } .has-foreground-background-color, .has-primary-background-color, .has-secondary-background-color { --local--color-primary: var(--wp--preset--color--background); --local--color-background: var(--wp--preset--color--primary); }'; } if ($theme === 'twentytwenty') { $background = sanitize_hex_color_no_hash(get_theme_mod('background_color', 'f5efe0')); $primary = get_theme_mod( 'accent_accessible_colors', [ 'content' => [ 'accent' => '#cd2653' ], ] ); $primary = $primary['content']['accent']; $css = 'body, .editor-styles-wrapper { --wp--preset--color--background: #' . $background . '; --wp--preset--color--foreground: #000; --wp--preset--color--primary: ' . $primary . '; --wp--preset--color--secondary: #69603e; --wp--style--block-gap: 3rem; --wp--custom--spacing--large: clamp(2rem, 7vw, 8rem); --responsive--alignwide-width: 120rem; }'; }//end if if ($theme === 'twentynineteen') { /** * Use the color from Twenty Nineteen's customizer value. */ $primary = 199; if (get_theme_mod('primary_color', 'default') !== 'default') { $primary = absint(get_theme_mod('primary_color_hue', 199)); } /** * Filters Twenty Nineteen default saturation level. * * @since Twenty Nineteen 1.0 * * @param int $saturation Color saturation level. */ // phpcs:ignore $saturation = apply_filters('twentynineteen_custom_colors_saturation', 100); $saturation = absint($saturation) . '%'; /** * Filters Twenty Nineteen default lightness level. * * @since Twenty Nineteen 1.0 * * @param int $lightness Color lightness level. */ // phpcs:ignore $lightness = apply_filters('twentynineteen_custom_colors_lightness', 33); $lightness = absint($lightness) . '%'; $css = 'body, .editor-styles-wrapper { --wp--preset--color--foreground: #111; --wp--preset--color--primary: hsl( ' . $primary . ', ' . $saturation . ', ' . $lightness . ' ); --wp--preset--color--secondary: #767676; --wp--preset--color--tertiary: #f7f7f7; }'; }//end if // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents $content = file_get_contents(EXTENDIFY_PATH . 'public/build/extendify-utilities.css'); $version = Config::$environment === 'PRODUCTION' ? Config::$version : uniqid(); \wp_register_style(Config::$slug . '-utilities', false, [], $version); \wp_enqueue_style(Config::$slug . '-utilities'); \wp_add_inline_style(Config::$slug . '-utilities', $content . $css); // Adds inline to the live preview. \wp_add_inline_style('wp-components', $content . $css); } }