From 7c47128621e088b614dc50d9e6e0752517522161 Mon Sep 17 00:00:00 2001 From: devuri Date: Tue, 25 Feb 2025 00:30:40 -0500 Subject: [PATCH 01/17] fix: no page titles needed --- templates/page.html | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/page.html b/templates/page.html index c9408fc0..c55e8c66 100644 --- a/templates/page.html +++ b/templates/page.html @@ -5,7 +5,6 @@
-
From 3e1a8228d2ee3aed00e168b80ccbb35d06a051bb Mon Sep 17 00:00:00 2001 From: devuri Date: Tue, 25 Feb 2025 21:40:53 -0500 Subject: [PATCH 02/17] feat: add style heather --- styles/electric.json | 4 +- styles/heather.json | 171 +++++++++++++++++++++++++++++++++++++++++++ styles/pitch.json | 124 ------------------------------- 3 files changed, 173 insertions(+), 126 deletions(-) create mode 100644 styles/heather.json diff --git a/styles/electric.json b/styles/electric.json index 319b32a0..783fd000 100644 --- a/styles/electric.json +++ b/styles/electric.json @@ -11,7 +11,7 @@ "slug": "base" }, { - "color": "#2500ff", + "color": "#30343b", "name": "Contrast", "slug": "contrast" }, @@ -21,7 +21,7 @@ "slug": "primary" }, { - "color": "#2500ff", + "color": "#30343b", "name": "Secondary", "slug": "secondary" }, diff --git a/styles/heather.json b/styles/heather.json new file mode 100644 index 00000000..e1fdd236 --- /dev/null +++ b/styles/heather.json @@ -0,0 +1,171 @@ +{ + "version": 3, + "$schema": "https://schemas.wp.org/wp/6.7/theme.json", + "title": "Heather", + "settings": { + "color": { + "palette": [ + { "slug": "heather-50", "color": "#f6f7f8", "name": "Heather 50" }, + { "slug": "heather-100", "color": "#e9edf0", "name": "Heather 100" }, + { "slug": "heather-200", "color": "#d9dfe4", "name": "Heather 200" }, + { "slug": "heather-300", "color": "#bfc9d1", "name": "Heather 300" }, + { "slug": "heather-400", "color": "#abb8c3", "name": "Heather 400" }, + { "slug": "heather-500", "color": "#8898a9", "name": "Heather 500" }, + { "slug": "heather-600", "color": "#76849a", "name": "Heather 600" }, + { "slug": "heather-700", "color": "#6a768b", "name": "Heather 700" }, + { "slug": "heather-800", "color": "#5a6273", "name": "Heather 800" }, + { "slug": "heather-900", "color": "#4a515e", "name": "Heather 900" }, + { "slug": "heather-950", "color": "#30343b", "name": "Heather 950" } + ], + "gradients": [ + { + "slug": "heather-gradient", + "gradient": "linear-gradient(135deg, #e9edf0 0%, #8898a9 100%)", + "name": "Heather Gradient" + } + ], + "duotone": [ + { + "slug": "heather-duotone", + "colors": ["#76849a", "#f6f7f8"], + "name": "Heather Duotone" + } + ] + }, + "typography": { + "fontFamilies": [ + { + "slug": "primary", + "fontFamily": "Inter, sans-serif", + "name": "Inter" + }, + { + "slug": "secondary", + "fontFamily": "Georgia, serif", + "name": "Georgia" + }, + { + "slug": "dm-sans", + "fontFamily": "'DM Sans', sans-serif", + "name": "DM Sans" + } + ], + "fontSizes": [ + { "slug": "small", "size": "14px", "name": "Small" }, + { "slug": "normal", "size": "16px", "name": "Normal" }, + { "slug": "medium", "size": "18px", "name": "Medium" }, + { "slug": "large", "size": "24px", "name": "Large" }, + { "slug": "x-large", "size": "30px", "name": "X-Large" }, + { "slug": "xx-large", "size": "36px", "name": "XX-Large" }, + { "slug": "huge", "size": "48px", "name": "Huge" } + ] + } + }, + "styles": { + "typography": { + "fontFamily": "var(--wp--preset--font-family--dm-sans)", + "fontSize": "var(--wp--preset--font-size--medium)", + "lineHeight": "1.7" + }, + "elements": { + "h1": { + "typography": { + "fontSize": "var(--wp--preset--font-size--huge)", + "lineHeight": "1.1" + } + }, + "h2": { + "typography": { + "fontSize": "var(--wp--preset--font-size--xx-large)", + "lineHeight": "1.2" + } + }, + "h3": { + "typography": { + "fontSize": "var(--wp--preset--font-size--x-large)", + "lineHeight": "1.2" + } + }, + "h4": { + "typography": { + "fontSize": "var(--wp--preset--font-size--large)", + "fontWeight": "600" + } + }, + "h5": { + "typography": { + "fontStyle": "normal", + "fontWeight": "600", + "textTransform": "none" + } + }, + "h6": { + "typography": { + "fontSize": "var(--wp--preset--font-size--normal)", + "fontStyle": "normal", + "fontWeight": "600" + } + }, + "link": { + "color": { + "text": "var(--wp--preset--color--heather-600)" + }, + ":hover": { + "color": { + "text": "var(--wp--preset--color--heather-950)" + } + } + }, + "heading": { + "color": { + "text": "var(--wp--preset--color--heather-800)" + } + } + }, + "blocks": { + "core/group": { + "border": { + "radius": "0px" + }, + "color": { + "text": "var(--wp--preset--color--heather-950)" + }, + "spacing": { + "padding": { + "top": "20px", + "right": "0px", + "bottom": "0px", + "left": "0px" + } + } + }, + "core/button": { + "border": { + "radius": "6px" + }, + "color": { + "background": "var(--wp--preset--color--heather-700)", + "text": "#ffffff" + }, + ":hover": { + "color": { + "text": "var(--wp--preset--color--heather-950)" + } + } + }, + "core/paragraph": { + "typography": { + "fontSize": "var(--wp--preset--font-size--medium)", + "lineHeight": "1.7" + } + }, + "core/list": { + "spacing": { + "margin": { + "bottom": "1em" + } + } + } + } + } +} diff --git a/styles/pitch.json b/styles/pitch.json index a40d47a8..2d99f683 100644 --- a/styles/pitch.json +++ b/styles/pitch.json @@ -32,48 +32,6 @@ } ] }, - "spacing": { - "spacingScale": { - "steps": 7 - }, - "spacingSizes": [ - { - "size": "calc(8px + 1.5625vw)", - "slug": "20", - "name": "1" - }, - { - "size": "calc(12px + 1.5625vw)", - "slug": "30", - "name": "2" - }, - { - "size": "calc(16px + 1.5625vw)", - "slug": "40", - "name": "3" - }, - { - "size": "calc(20px + 1.5625vw)", - "slug": "50", - "name": "4" - }, - { - "size": "calc(24px + 1.5625vw)", - "slug": "60", - "name": "5" - }, - { - "size": "calc(28px + 1.5625vw)", - "slug": "70", - "name": "6" - }, - { - "size": "calc(32px + 1.5625vw)", - "slug": "80", - "name": "7" - } - ] - }, "typography": { "fontSizes": [ { @@ -140,88 +98,6 @@ } } }, - "elements": { - "button": { - "border": { - "radius": "0", - "style": "solid", - "width": "2px", - "color": "var(--wp--preset--color--primary)" - }, - "color": { - "background": "var(--wp--preset--color--primary)", - "text": "var(--wp--preset--color--base)" - }, - "spacing": { - "padding": { - "top": "min(1.125rem, 3vw) !important", - "right": "min(2.125rem, 5vw) !important", - "bottom": "min(1.125rem, 3vw) !important", - "left": "min(2.125rem, 5vw) !important" - } - }, - "typography": { - "fontSize": "var(--wp--preset--font-size--small)", - "fontWeight": "600", - "textTransform": "uppercase", - "letterSpacing": "0.01em" - }, - ":hover": { - "border": { - "color": "var(--wp--preset--color--contrast)" - }, - "color": { - "background": "var(--wp--preset--color--contrast)", - "text": "var(--wp--preset--color--tertiary)" - } - }, - ":focus": { - "border": { - "color": "var(--wp--preset--color--contrast)" - }, - "color": { - "background": "var(--wp--preset--color--contrast)", - "text": "var(--wp--preset--color--tertiary)" - } - }, - ":active": { - "border": { - "color": "var(--wp--preset--color--contrast)" - }, - "color": { - "background": "var(--wp--preset--color--contrast)", - "text": "var(--wp--preset--color--tertiary)" - } - }, - ":visited": { - "color": { - "text": "var(--wp--preset--color--base)" - } - } - }, - "h1": { - "typography": { - "fontSize": "var(--wp--preset--font-size--xx-large)", - "lineHeight": "1.1" - } - }, - "h2": { - "typography": { - "fontSize": "var(--wp--preset--font-size--x-large)", - "lineHeight": "1.1" - } - }, - "h3": { - "typography": { - "fontSize": "var(--wp--preset--font-size--large)" - } - }, - "heading": { - "typography": { - "fontWeight": "500" - } - } - }, "spacing": { "blockGap": "var(--wp--preset--spacing--40)", "padding": { From 6691d7ccac9ca1d5fad1c2853ce249bf85bec537 Mon Sep 17 00:00:00 2001 From: devuri Date: Wed, 26 Feb 2025 09:14:54 -0500 Subject: [PATCH 03/17] fix: simpler format for hot swaps --- styles/heather.json | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/styles/heather.json b/styles/heather.json index e1fdd236..d88068c7 100644 --- a/styles/heather.json +++ b/styles/heather.json @@ -5,17 +5,17 @@ "settings": { "color": { "palette": [ - { "slug": "heather-50", "color": "#f6f7f8", "name": "Heather 50" }, - { "slug": "heather-100", "color": "#e9edf0", "name": "Heather 100" }, - { "slug": "heather-200", "color": "#d9dfe4", "name": "Heather 200" }, - { "slug": "heather-300", "color": "#bfc9d1", "name": "Heather 300" }, - { "slug": "heather-400", "color": "#abb8c3", "name": "Heather 400" }, - { "slug": "heather-500", "color": "#8898a9", "name": "Heather 500" }, - { "slug": "heather-600", "color": "#76849a", "name": "Heather 600" }, - { "slug": "heather-700", "color": "#6a768b", "name": "Heather 700" }, - { "slug": "heather-800", "color": "#5a6273", "name": "Heather 800" }, - { "slug": "heather-900", "color": "#4a515e", "name": "Heather 900" }, - { "slug": "heather-950", "color": "#30343b", "name": "Heather 950" } + { "slug": "brisko-50", "color": "#f6f7f8", "name": "Heather 50" }, + { "slug": "brisko-100", "color": "#e9edf0", "name": "Heather 100" }, + { "slug": "brisko-200", "color": "#d9dfe4", "name": "Heather 200" }, + { "slug": "brisko-300", "color": "#bfc9d1", "name": "Heather 300" }, + { "slug": "brisko-400", "color": "#abb8c3", "name": "Heather 400" }, + { "slug": "brisko-500", "color": "#8898a9", "name": "Heather 500" }, + { "slug": "brisko-600", "color": "#76849a", "name": "Heather 600" }, + { "slug": "brisko-700", "color": "#6a768b", "name": "Heather 700" }, + { "slug": "brisko-800", "color": "#5a6273", "name": "Heather 800" }, + { "slug": "brisko-900", "color": "#4a515e", "name": "Heather 900" }, + { "slug": "brisko-950", "color": "#30343b", "name": "Heather 950" } ], "gradients": [ { @@ -108,17 +108,17 @@ }, "link": { "color": { - "text": "var(--wp--preset--color--heather-600)" + "text": "var(--wp--preset--color--brisko-600)" }, ":hover": { "color": { - "text": "var(--wp--preset--color--heather-950)" + "text": "var(--wp--preset--color--brisko-950)" } } }, "heading": { "color": { - "text": "var(--wp--preset--color--heather-800)" + "text": "var(--wp--preset--color--brisko-800)" } } }, @@ -128,7 +128,7 @@ "radius": "0px" }, "color": { - "text": "var(--wp--preset--color--heather-950)" + "text": "var(--wp--preset--color--brisko-950)" }, "spacing": { "padding": { @@ -144,12 +144,12 @@ "radius": "6px" }, "color": { - "background": "var(--wp--preset--color--heather-700)", + "background": "var(--wp--preset--color--brisko-700)", "text": "#ffffff" }, ":hover": { "color": { - "text": "var(--wp--preset--color--heather-950)" + "text": "var(--wp--preset--color--brisko-950)" } } }, From c139beed70ad8692b1e3cf5ee4c0f759c09e5c21 Mon Sep 17 00:00:00 2001 From: devuri Date: Wed, 26 Feb 2025 09:15:25 -0500 Subject: [PATCH 04/17] fic: adds new constants --- functions.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/functions.php b/functions.php index fdd85bae..4769832a 100644 --- a/functions.php +++ b/functions.php @@ -17,6 +17,9 @@ // Theme version. \define( 'BRISKO_VERSION', brisko()->version() ); +// \define( 'BRISKO_DEBUG', defined( 'WP_DEBUG' ) && true === constant('WP_DEBUG') ); +// \define( 'BRISKO_DIR', trailingslashit( get_template_directory() ) ); +// \define( 'BRISKO_URL', trailingslashit( get_template_directory_uri() ) ); // Theme setup. brisko()->setup(); From cbe8d1b612c5a018e5e2843aea32951a113d40d0 Mon Sep 17 00:00:00 2001 From: devuri Date: Wed, 26 Feb 2025 09:16:12 -0500 Subject: [PATCH 05/17] feat: adds Palette-style Generator --- src/Palette.php | 119 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 src/Palette.php diff --git a/src/Palette.php b/src/Palette.php new file mode 100644 index 00000000..7435f2ee --- /dev/null +++ b/src/Palette.php @@ -0,0 +1,119 @@ + 0.05, + 100 => 0.1, + 200 => 0.2, + 300 => 0.3, + 400 => 0.4, + 500 => 0.5, + 600 => 0.6, + 700 => 0.7, + 800 => 0.8, + 900 => 0.9, + 950 => 0.95, + ]; + + $palette = []; + + foreach ($shades as $shade => $factor) { + $palette[$shade] = self::rgbToHex( + self::adjustColorComponent($r, $factor), + self::adjustColorComponent($g, $factor), + self::adjustColorComponent($b, $factor) + ); + } + + return [$colorName => $palette]; + } + + /** + * Sanitize and normalize a hex color code. + * + * @param string $hex The input hex color. + * + * @throws InvalidArgumentException If the hex format is invalid. + * + * @return string The sanitized 6-character hex code. + */ + private static function sanitizeHex(string $hex): string + { + $hex = ltrim($hex, '#'); + + // Convert 3-character hex to 6-character hex + if (3 === \strlen($hex)) { + $hex = preg_replace('/(.)/', '$1$1', $hex); + } + + if ( ! preg_match('/^[a-fA-F0-9]{6}$/', $hex)) { + throw new InvalidArgumentException('Invalid hex color format.'); + } + + return strtolower($hex); + } + + /** + * Convert a hex color to an RGB array. + * + * @param string $hex The hex color. + * + * @return array An array containing RGB values. + */ + private static function hexToRgb(string $hex): array + { + return sscanf($hex, "%02x%02x%02x"); + } + + /** + * Convert RGB values to a hex color string. + * + * @param int $r Red component (0-255). + * @param int $g Green component (0-255). + * @param int $b Blue component (0-255). + * + * @return string The hex color. + */ + private static function rgbToHex(int $r, int $g, int $b): string + { + return \sprintf("#%02x%02x%02x", $r, $g, $b); + } + + /** + * Adjust an RGB color component based on a lightness factor. + * + * @param int $component The original color component (0-255). + * @param float $factor The lightness factor (0.0 - 1.0). + * + * @return int The adjusted color component. + */ + private static function adjustColorComponent(int $component, float $factor): int + { + return max(0, min(255, round($component * $factor + (255 * (1 - $factor))))); + } +} + +// Example usage: +// $palette = Palette::generate('#04e200', 'deep-fir'); +// print_r($palette); From fa6d029b9122b8dac983dd6263edb063a3abdd58 Mon Sep 17 00:00:00 2001 From: devuri Date: Wed, 26 Feb 2025 09:17:15 -0500 Subject: [PATCH 06/17] feat: add more basic styles --- styles/pewter.json | 157 +++++++++++++++++++++++++++++++++++++++++++++ styles/red.json | 157 +++++++++++++++++++++++++++++++++++++++++++++ styles/stone.json | 157 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 471 insertions(+) create mode 100644 styles/pewter.json create mode 100644 styles/red.json create mode 100644 styles/stone.json diff --git a/styles/pewter.json b/styles/pewter.json new file mode 100644 index 00000000..03273896 --- /dev/null +++ b/styles/pewter.json @@ -0,0 +1,157 @@ +{ + "version": 3, + "$schema": "https://schemas.wp.org/wp/6.7/theme.json", + "title": "Pewter", + "settings": { + "color": { + "palette": [ + { "slug": "pewter-50", "color": "#f9f9fa", "name": "Pewter 50" }, + { "slug": "pewter-100", "color": "#f1f1f3", "name": "Pewter 100" }, + { "slug": "pewter-150", "color": "#e4e4e7", "name": "Pewter 150" }, + { "slug": "pewter-200", "color": "#d3d3d8", "name": "Pewter 200" }, + { "slug": "pewter-250", "color": "#aeaeb6", "name": "Pewter 250" }, + { "slug": "pewter-300", "color": "#8e8e99", "name": "Pewter 300" }, + { "slug": "pewter-350", "color": "#6f6f7c", "name": "Pewter 350" }, + { "slug": "pewter-400", "color": "#55555f", "name": "Pewter 400" }, + { "slug": "pewter-450", "color": "#3d3d44", "name": "Pewter 450" }, + { "slug": "pewter-500", "color": "#27272c", "name": "Pewter 500" }, + { "slug": "pewter-550", "color": "#17171a", "name": "Pewter 550" } + ] + }, + "typography": { + "fontFamilies": [ + { + "slug": "primary", + "fontFamily": "Inter, sans-serif", + "name": "Inter" + }, + { + "slug": "secondary", + "fontFamily": "Georgia, serif", + "name": "Georgia" + }, + { + "slug": "dm-sans", + "fontFamily": "'DM Sans', sans-serif", + "name": "DM Sans" + } + ], + "fontSizes": [ + { "slug": "small", "size": "14px", "name": "Small" }, + { "slug": "normal", "size": "16px", "name": "Normal" }, + { "slug": "medium", "size": "18px", "name": "Medium" }, + { "slug": "large", "size": "24px", "name": "Large" }, + { "slug": "x-large", "size": "30px", "name": "X-Large" }, + { "slug": "xx-large", "size": "36px", "name": "XX-Large" }, + { "slug": "huge", "size": "48px", "name": "Huge" } + ] + } + }, + "styles": { + "typography": { + "fontFamily": "var(--wp--preset--font-family--dm-sans)", + "fontSize": "var(--wp--preset--font-size--medium)", + "lineHeight": "1.7" + }, + "elements": { + "h1": { + "typography": { + "fontSize": "var(--wp--preset--font-size--huge)", + "lineHeight": "1.1" + } + }, + "h2": { + "typography": { + "fontSize": "var(--wp--preset--font-size--xx-large)", + "lineHeight": "1.2" + } + }, + "h3": { + "typography": { + "fontSize": "var(--wp--preset--font-size--x-large)", + "lineHeight": "1.2" + } + }, + "h4": { + "typography": { + "fontSize": "var(--wp--preset--font-size--large)", + "fontWeight": "600" + } + }, + "h5": { + "typography": { + "fontStyle": "normal", + "fontWeight": "600", + "textTransform": "none" + } + }, + "h6": { + "typography": { + "fontSize": "var(--wp--preset--font-size--normal)", + "fontStyle": "normal", + "fontWeight": "600" + } + }, + "link": { + "color": { + "text": "var(--wp--preset--color--pewter-400)" + }, + ":hover": { + "color": { + "text": "var(--wp--preset--color--pewter-550)" + } + } + }, + "heading": { + "color": { + "text": "var(--wp--preset--color--pewter-500)" + } + } + }, + "blocks": { + "core/group": { + "border": { + "radius": "0px" + }, + "color": { + "text": "var(--wp--preset--color--pewter-550)" + }, + "spacing": { + "padding": { + "top": "20px", + "right": "0px", + "bottom": "0px", + "left": "0px" + } + } + }, + "core/button": { + "border": { + "radius": "6px" + }, + "color": { + "background": "var(--wp--preset--color--pewter-450)", + "text": "#ffffff" + }, + ":hover": { + "color": { + "text": "var(--wp--preset--color--pewter-550)" + } + } + }, + "core/paragraph": { + "typography": { + "fontSize": "var(--wp--preset--font-size--medium)", + "lineHeight": "1.7" + } + }, + "core/list": { + "spacing": { + "margin": { + "bottom": "1em" + } + } + } + } + } +} diff --git a/styles/red.json b/styles/red.json new file mode 100644 index 00000000..1218578f --- /dev/null +++ b/styles/red.json @@ -0,0 +1,157 @@ +{ + "version": 3, + "$schema": "https://schemas.wp.org/wp/6.7/theme.json", + "title": "Red", + "settings": { + "color": { + "palette": [ + { "slug": "brisko-50", "color": "#fff0f0", "name": "Red 50" }, + { "slug": "brisko-100", "color": "#ffdddd", "name": "Red 100" }, + { "slug": "brisko-200", "color": "#ffc0c0", "name": "Red 200" }, + { "slug": "brisko-300", "color": "#ff9494", "name": "Red 300" }, + { "slug": "brisko-400", "color": "#ff5757", "name": "Red 400" }, + { "slug": "brisko-500", "color": "#ff2323", "name": "Red 500" }, + { "slug": "brisko-600", "color": "#ff0000", "name": "Red 600" }, + { "slug": "brisko-700", "color": "#d70000", "name": "Red 700" }, + { "slug": "brisko-800", "color": "#b10303", "name": "Red 800" }, + { "slug": "brisko-900", "color": "#920a0a", "name": "Red 900" }, + { "slug": "brisko-950", "color": "#500000", "name": "Red 950" } + ] + }, + "typography": { + "fontFamilies": [ + { + "slug": "primary", + "fontFamily": "Inter, sans-serif", + "name": "Inter" + }, + { + "slug": "secondary", + "fontFamily": "Georgia, serif", + "name": "Georgia" + }, + { + "slug": "dm-sans", + "fontFamily": "'DM Sans', sans-serif", + "name": "DM Sans" + } + ], + "fontSizes": [ + { "slug": "small", "size": "14px", "name": "Small" }, + { "slug": "normal", "size": "16px", "name": "Normal" }, + { "slug": "medium", "size": "18px", "name": "Medium" }, + { "slug": "large", "size": "24px", "name": "Large" }, + { "slug": "x-large", "size": "30px", "name": "X-Large" }, + { "slug": "xx-large", "size": "36px", "name": "XX-Large" }, + { "slug": "huge", "size": "48px", "name": "Huge" } + ] + } + }, + "styles": { + "typography": { + "fontFamily": "var(--wp--preset--font-family--dm-sans)", + "fontSize": "var(--wp--preset--font-size--medium)", + "lineHeight": "1.7" + }, + "elements": { + "h1": { + "typography": { + "fontSize": "var(--wp--preset--font-size--huge)", + "lineHeight": "1.1" + } + }, + "h2": { + "typography": { + "fontSize": "var(--wp--preset--font-size--xx-large)", + "lineHeight": "1.2" + } + }, + "h3": { + "typography": { + "fontSize": "var(--wp--preset--font-size--x-large)", + "lineHeight": "1.2" + } + }, + "h4": { + "typography": { + "fontSize": "var(--wp--preset--font-size--large)", + "fontWeight": "600" + } + }, + "h5": { + "typography": { + "fontStyle": "normal", + "fontWeight": "600", + "textTransform": "none" + } + }, + "h6": { + "typography": { + "fontSize": "var(--wp--preset--font-size--normal)", + "fontStyle": "normal", + "fontWeight": "600" + } + }, + "link": { + "color": { + "text": "var(--wp--preset--color--brisko-600)" + }, + ":hover": { + "color": { + "text": "var(--wp--preset--color--brisko-950)" + } + } + }, + "heading": { + "color": { + "text": "var(--wp--preset--color--brisko-800)" + } + } + }, + "blocks": { + "core/group": { + "border": { + "radius": "0px" + }, + "color": { + "text": "var(--wp--preset--color--brisko-950)" + }, + "spacing": { + "padding": { + "top": "20px", + "right": "0px", + "bottom": "0px", + "left": "0px" + } + } + }, + "core/button": { + "border": { + "radius": "6px" + }, + "color": { + "background": "var(--wp--preset--color--brisko-700)", + "text": "#ffffff" + }, + ":hover": { + "color": { + "text": "var(--wp--preset--color--brisko-950)" + } + } + }, + "core/paragraph": { + "typography": { + "fontSize": "var(--wp--preset--font-size--medium)", + "lineHeight": "1.7" + } + }, + "core/list": { + "spacing": { + "margin": { + "bottom": "1em" + } + } + } + } + } +} diff --git a/styles/stone.json b/styles/stone.json new file mode 100644 index 00000000..4b691366 --- /dev/null +++ b/styles/stone.json @@ -0,0 +1,157 @@ +{ + "version": 3, + "$schema": "https://schemas.wp.org/wp/6.7/theme.json", + "title": "Stone", + "settings": { + "color": { + "palette": [ + { "slug": "stone-50", "color": "#fafaf9", "name": "Stone 50" }, + { "slug": "stone-100", "color": "#f5f5f4", "name": "Stone 100" }, + { "slug": "stone-150", "color": "#e7e5e4", "name": "Stone 150" }, + { "slug": "stone-200", "color": "#d6d3d1", "name": "Stone 200" }, + { "slug": "stone-250", "color": "#a8a29e", "name": "Stone 250" }, + { "slug": "stone-300", "color": "#78716c", "name": "Stone 300" }, + { "slug": "stone-350", "color": "#57534e", "name": "Stone 350" }, + { "slug": "stone-400", "color": "#44403c", "name": "Stone 400" }, + { "slug": "stone-450", "color": "#292524", "name": "Stone 450" }, + { "slug": "stone-500", "color": "#1c1917", "name": "Stone 500" }, + { "slug": "stone-550", "color": "#0c0a09", "name": "Stone 550" } + ] + }, + "typography": { + "fontFamilies": [ + { + "slug": "primary", + "fontFamily": "Inter, sans-serif", + "name": "Inter" + }, + { + "slug": "secondary", + "fontFamily": "Georgia, serif", + "name": "Georgia" + }, + { + "slug": "dm-sans", + "fontFamily": "'DM Sans', sans-serif", + "name": "DM Sans" + } + ], + "fontSizes": [ + { "slug": "small", "size": "14px", "name": "Small" }, + { "slug": "normal", "size": "16px", "name": "Normal" }, + { "slug": "medium", "size": "18px", "name": "Medium" }, + { "slug": "large", "size": "24px", "name": "Large" }, + { "slug": "x-large", "size": "30px", "name": "X-Large" }, + { "slug": "xx-large", "size": "36px", "name": "XX-Large" }, + { "slug": "huge", "size": "48px", "name": "Huge" } + ] + } + }, + "styles": { + "typography": { + "fontFamily": "var(--wp--preset--font-family--dm-sans)", + "fontSize": "var(--wp--preset--font-size--medium)", + "lineHeight": "1.7" + }, + "elements": { + "h1": { + "typography": { + "fontSize": "var(--wp--preset--font-size--huge)", + "lineHeight": "1.1" + } + }, + "h2": { + "typography": { + "fontSize": "var(--wp--preset--font-size--xx-large)", + "lineHeight": "1.2" + } + }, + "h3": { + "typography": { + "fontSize": "var(--wp--preset--font-size--x-large)", + "lineHeight": "1.2" + } + }, + "h4": { + "typography": { + "fontSize": "var(--wp--preset--font-size--large)", + "fontWeight": "600" + } + }, + "h5": { + "typography": { + "fontStyle": "normal", + "fontWeight": "600", + "textTransform": "none" + } + }, + "h6": { + "typography": { + "fontSize": "var(--wp--preset--font-size--normal)", + "fontStyle": "normal", + "fontWeight": "600" + } + }, + "link": { + "color": { + "text": "var(--wp--preset--color--stone-400)" + }, + ":hover": { + "color": { + "text": "var(--wp--preset--color--stone-550)" + } + } + }, + "heading": { + "color": { + "text": "var(--wp--preset--color--stone-500)" + } + } + }, + "blocks": { + "core/group": { + "border": { + "radius": "0px" + }, + "color": { + "text": "var(--wp--preset--color--stone-550)" + }, + "spacing": { + "padding": { + "top": "20px", + "right": "0px", + "bottom": "0px", + "left": "0px" + } + } + }, + "core/button": { + "border": { + "radius": "6px" + }, + "color": { + "background": "var(--wp--preset--color--stone-450)", + "text": "#ffffff" + }, + ":hover": { + "color": { + "text": "var(--wp--preset--color--stone-550)" + } + } + }, + "core/paragraph": { + "typography": { + "fontSize": "var(--wp--preset--font-size--medium)", + "lineHeight": "1.7" + } + }, + "core/list": { + "spacing": { + "margin": { + "bottom": "1em" + } + } + } + } + } +} From 280e9a3df349be78dd859685a0cd89f6da682fa7 Mon Sep 17 00:00:00 2001 From: devuri Date: Thu, 27 Feb 2025 21:14:35 -0500 Subject: [PATCH 07/17] fix: update `main` group in templates --- templates/404.html | 2 +- templates/archive.html | 4 ++-- templates/blog-alternative.html | 2 +- templates/front-page.html | 12 ++++++------ templates/home.html | 4 ++-- templates/index.html | 2 +- templates/page.html | 4 ++-- templates/search.html | 4 ++-- templates/single.html | 4 ++-- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/templates/404.html b/templates/404.html index 92b2b745..8e569f2a 100644 --- a/templates/404.html +++ b/templates/404.html @@ -1,6 +1,6 @@ - +
diff --git a/templates/archive.html b/templates/archive.html index 676b37c6..08315874 100644 --- a/templates/archive.html +++ b/templates/archive.html @@ -1,7 +1,7 @@ - -
+ +
diff --git a/templates/blog-alternative.html b/templates/blog-alternative.html index cd6c89b5..4cb56627 100644 --- a/templates/blog-alternative.html +++ b/templates/blog-alternative.html @@ -1,6 +1,6 @@ - +
diff --git a/templates/front-page.html b/templates/front-page.html index a8739d7d..dbed7d48 100644 --- a/templates/front-page.html +++ b/templates/front-page.html @@ -1,7 +1,7 @@ - -
+ +
@@ -28,10 +28,10 @@

Empower -
+
-

DiscoverĀ our Solutions

+

Discover our Solutions

@@ -39,7 +39,7 @@

Discove @@ -75,7 +75,7 @@

Featured Posts

-
+
diff --git a/templates/home.html b/templates/home.html index c2337f76..0ee2cfab 100644 --- a/templates/home.html +++ b/templates/home.html @@ -1,7 +1,7 @@ - -
+ +
diff --git a/templates/index.html b/templates/index.html index bed3d1eb..055860c1 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,6 +1,6 @@ - +
diff --git a/templates/page.html b/templates/page.html index c55e8c66..dced2909 100644 --- a/templates/page.html +++ b/templates/page.html @@ -1,7 +1,7 @@ - -
+ +
diff --git a/templates/search.html b/templates/search.html index 2fb9405e..c244753e 100644 --- a/templates/search.html +++ b/templates/search.html @@ -1,7 +1,7 @@ - -
+ +
diff --git a/templates/single.html b/templates/single.html index 33d4dd46..47f85696 100644 --- a/templates/single.html +++ b/templates/single.html @@ -1,7 +1,7 @@ - -
+ +
From 44dc4bec14abbd0a362890d5d19345fc337f02b3 Mon Sep 17 00:00:00 2001 From: devuri Date: Thu, 27 Feb 2025 21:17:10 -0500 Subject: [PATCH 08/17] fix: 4px top margin --- styles/heather.json | 2 +- styles/pewter.json | 2 +- styles/red.json | 2 +- styles/stone.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/styles/heather.json b/styles/heather.json index d88068c7..dfdff90f 100644 --- a/styles/heather.json +++ b/styles/heather.json @@ -132,7 +132,7 @@ }, "spacing": { "padding": { - "top": "20px", + "top": "4px", "right": "0px", "bottom": "0px", "left": "0px" diff --git a/styles/pewter.json b/styles/pewter.json index 03273896..b3938f82 100644 --- a/styles/pewter.json +++ b/styles/pewter.json @@ -118,7 +118,7 @@ }, "spacing": { "padding": { - "top": "20px", + "top": "4px", "right": "0px", "bottom": "0px", "left": "0px" diff --git a/styles/red.json b/styles/red.json index 1218578f..4e241596 100644 --- a/styles/red.json +++ b/styles/red.json @@ -118,7 +118,7 @@ }, "spacing": { "padding": { - "top": "20px", + "top": "4px", "right": "0px", "bottom": "0px", "left": "0px" diff --git a/styles/stone.json b/styles/stone.json index 4b691366..dbf0ad2d 100644 --- a/styles/stone.json +++ b/styles/stone.json @@ -118,7 +118,7 @@ }, "spacing": { "padding": { - "top": "20px", + "top": "4px", "right": "0px", "bottom": "0px", "left": "0px" From 91f59786b74f0778fbdedd226819d6224b6c110a Mon Sep 17 00:00:00 2001 From: devuri Date: Thu, 27 Feb 2025 21:17:50 -0500 Subject: [PATCH 09/17] fix: adds core_css block styles --- assets/src/css/core.css | 163 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 163 insertions(+) diff --git a/assets/src/css/core.css b/assets/src/css/core.css index 6838d073..3505640d 100644 --- a/assets/src/css/core.css +++ b/assets/src/css/core.css @@ -122,3 +122,166 @@ html, body { margin-left: calc(50% - 39vw); margin-right: calc(50% - 39vw); } */ + + + + +/* +====================================== + WordPress Block Editor Styles +====================================== + +Description: + This refines various WordPress block editor elements + to ensure consistent spacing, clean typography, and better alignment. + It addresses common issues like tight spacing, inconsistent alignment, + and lack of responsive control for wide/full-width blocks. +*/ + +/*-------------------------------------------------------------- +1. General Block Spacing & Typography +--------------------------------------------------------------*/ + +:where(.wp-site-blocks) > * { + margin-block-start: 0; + margin-block-end: 0; +} + +.wp-block-paragraph { + margin-bottom: 1.5em; +} + +.wp-block-list, +.wp-block-quote, +.wp-block-pullquote { + margin-bottom: 1.5em; +} + +.wp-block-heading { + margin: 1.5em 0 0.5em; +} + +/*-------------------------------------------------------------- +2. Image, Figure, and Media Blocks +--------------------------------------------------------------*/ + +.wp-block-image { + margin-bottom: 1.5em; +} + +.wp-block-image figcaption { + font-size: 0.9em; + text-align: center; + color: #666; + margin-top: 0.5em; +} + +/*-------------------------------------------------------------- +4. Group Blocks & Inner Containers +--------------------------------------------------------------*/ + +/* .wp-block-group { + padding: 2em; + margin-bottom: 2em; + border-radius: 6px; +} */ + +.wp-block-group__inner-container { + max-width: 800px; + margin-left: auto; + margin-right: auto; +} + +/*-------------------------------------------------------------- +5. Columns & Media/Text Blocks +--------------------------------------------------------------*/ + +/* .wp-block-column { + padding: 1em; +} + +.wp-block-media-text { + margin-bottom: 2em; +} +.wp-block-media-text .wp-block-media-text__content { + padding: 1em; +} */ + +/*-------------------------------------------------------------- +6. Buttons & Form Styles +--------------------------------------------------------------*/ + +.wp-block-button__link { + display: inline-block; + text-decoration: none; + transition: background-color 0.3s ease; +} + +/* .wp-block-button__link:hover, +.wp-block-button__link:focus { + background-color: #004da8; +} */ + +.wp-block-search input[type="search"], +.wp-block-search__inside-wrapper input[type="search"] { + width: 100%; + padding: 0.75em; + /* border: 1px solid #ccc; */ + margin-bottom: 1em; +} + +/*-------------------------------------------------------------- +7. Tables & Quotes +--------------------------------------------------------------*/ + +.wp-block-table { + width: 100%; + border-collapse: collapse; + margin-bottom: 1.5em; +} + +.wp-block-table td, +.wp-block-table th { + border: 1px solid #ddd; + padding: 0.75em; +} + +blockquote.wp-block-quote { + padding-left: 1em; + font-style: italic; +} + +/*-------------------------------------------------------------- +8. Responsive Adjustments +--------------------------------------------------------------*/ + +/* @media (max-width: 768px) { + .wp-block-column { + margin-bottom: 1em; + } + + .wp-block-group { + padding: 1em; + } + + .wp-block-heading h2, + .wp-block-heading h3 { + font-size: 1.2em; + } +} */ + +/*-------------------------------------------------------------- +9. Additional Utilities (Optional) +--------------------------------------------------------------*/ + +/* Utility class to hide elements visually but keep for screen readers */ +.sr-only { + position: absolute !important; + width: 1px !important; + height: 1px !important; + padding: 0 !important; + overflow: hidden !important; + clip: rect(0, 0, 0, 0) !important; + white-space: nowrap !important; /* Added to prevent shift */ + border: 0 !important; +} From fa3b4c21c4c337bef6454f57f40e949718056d78 Mon Sep 17 00:00:00 2001 From: devuri Date: Sat, 1 Mar 2025 12:06:39 -0500 Subject: [PATCH 10/17] chore: build --- docs/code/classes/Brisko-Palette.html | 586 +++++++++++++++++++++ docs/code/classes/Brisko-Theme.html | 4 +- docs/code/files/src-inc-template-tags.html | 73 ++- docs/code/files/src-palette.html | 163 ++++++ docs/code/index.html | 73 ++- docs/code/indices/files.html | 1 + docs/code/js/searchIndex.js | 35 ++ docs/code/namespaces/brisko.html | 2 + docs/code/namespaces/default.html | 73 ++- docs/code/packages/Application.html | 75 ++- src/Palette.php | 49 +- src/inc/template-tags.php | 9 +- 12 files changed, 1038 insertions(+), 105 deletions(-) create mode 100644 docs/code/classes/Brisko-Palette.html create mode 100644 docs/code/files/src-palette.html diff --git a/docs/code/classes/Brisko-Palette.html b/docs/code/classes/Brisko-Palette.html new file mode 100644 index 00000000..624dfd78 --- /dev/null +++ b/docs/code/classes/Brisko-Palette.html @@ -0,0 +1,586 @@ + + + + + Brisko + + + + + + + + + + + + + + + + + + + + +
+

Brisko

+ + + + + +
+ +
+
+ + + + +
+ + +
+

+ Palette + + +
+ in package + +
+ + +

+ + + + +
+ + + + + + + + +

+ Table of Contents + +

+ +
+
+ generate() + +  : array<string|int, mixed> +
+
Generate a Palette-style colors based on a base hex color.
+ +
+ adjust_color_component() + +  : int +
+
Adjust an RGB color component based on a lightness factor.
+ +
+ hex_to_rgb() + +  : array<string|int, mixed> +
+
Convert a hex color to an RGB array.
+ +
+ rgb_to_hex() + +  : string +
+
Convert RGB values to a hex color string.
+ +
+ sanitize_hex() + +  : string +
+
Sanitize and normalize a hex color code.
+ +
+ + + + + + + +
+

+ Methods + +

+
+

+ generate() + +

+ + +

Generate a Palette-style colors based on a base hex color.

+ + + public + static generate(string $base_hex, string $color_name) : array<string|int, mixed> + + +
Parameters
+
+
+ $base_hex + : string +
+
+

The base hex color (e.g., #04e200).

+
+ +
+
+ $color_name + : string +
+
+

The name of the color.

+
+ +
+
+ + +
+ Tags + +
+
+
+ throws +
+
+ InvalidArgumentException + +

If an invalid hex color is provided.

+
+ +
+
+ +
Return values
+ array<string|int, mixed> + — +

The generated color palette.

+
+ + +
+
+

+ adjust_color_component() + +

+ + +

Adjust an RGB color component based on a lightness factor.

+ + + private + static adjust_color_component(int $component, float $factor) : int + + +
Parameters
+
+
+ $component + : int +
+
+

The original color component (0-255).

+
+ +
+
+ $factor + : float +
+
+

The lightness factor (0.0 - 1.0).

+
+ +
+
+ + + +
Return values
+ int + — +

The adjusted color component.

+
+ + +
+
+

+ hex_to_rgb() + +

+ + +

Convert a hex color to an RGB array.

+ + + private + static hex_to_rgb(string $hex) : array<string|int, mixed> + + +
Parameters
+
+
+ $hex + : string +
+
+

The hex color.

+
+ +
+
+ + + +
Return values
+ array<string|int, mixed> + — +

An array containing RGB values.

+
+ + +
+
+

+ rgb_to_hex() + +

+ + +

Convert RGB values to a hex color string.

+ + + private + static rgb_to_hex(int $r, int $g, int $b) : string + + +
Parameters
+
+
+ $r + : int +
+
+

Red component (0-255).

+
+ +
+
+ $g + : int +
+
+

Green component (0-255).

+
+ +
+
+ $b + : int +
+
+

Blue component (0-255).

+
+ +
+
+ + + +
Return values
+ string + — +

The hex color.

+
+ + +
+
+

+ sanitize_hex() + +

+ + +

Sanitize and normalize a hex color code.

+ + + private + static sanitize_hex(string $hex) : string + + +
Parameters
+
+
+ $hex + : string +
+
+

The input hex color.

+
+ +
+
+ + +
+ Tags + +
+
+
+ throws +
+
+ InvalidArgumentException + +

If the hex format is invalid.

+
+ +
+
+ +
Return values
+ string + — +

The sanitized 6-character hex code.

+
+ + +
+
+ + + + +
+
+
+
+

Search results

+ +
+
+
    +
    +
    +
    +
    +
    + + +
    + + + + + + + + diff --git a/docs/code/classes/Brisko-Theme.html b/docs/code/classes/Brisko-Theme.html index ffe6c915..d251999e 100644 --- a/docs/code/classes/Brisko-Theme.html +++ b/docs/code/classes/Brisko-Theme.html @@ -152,7 +152,7 @@

    VERSION -  = '6.0.0' +  = '6.0.1'
    Define Theme Version.
    @@ -276,7 +276,7 @@

    public mixed VERSION - = '6.0.0' + = '6.0.1' diff --git a/docs/code/files/src-inc-template-tags.html b/docs/code/files/src-inc-template-tags.html index 8637c6a4..ee8cdab5 100644 --- a/docs/code/files/src-inc-template-tags.html +++ b/docs/code/files/src-inc-template-tags.html @@ -123,6 +123,13 @@

    + brisko_site_blocks_open() + +  : mixed +
    +
    + +
    brisko()  : Brisko @@ -267,6 +274,34 @@

    +

    + brisko_site_blocks_open() + +

    + + + + + + brisko_site_blocks_open() : mixed + +
    + + + + +
    Return values
    + mixed + — + + +
    +

    brisko() @@ -274,7 +309,7 @@

    @@ -304,7 +339,7 @@

    @@ -332,7 +367,7 @@

    @@ -360,7 +395,7 @@

    @@ -388,7 +423,7 @@

    @@ -421,7 +456,7 @@

    @@ -455,7 +490,7 @@

    @@ -497,7 +532,7 @@

    @@ -525,7 +560,7 @@

    @@ -553,7 +588,7 @@

    @@ -591,7 +626,7 @@

    @@ -619,7 +654,7 @@

    @@ -689,7 +724,7 @@

    @@ -717,7 +752,7 @@

    @@ -759,7 +794,7 @@

    @@ -787,7 +822,7 @@

    @@ -845,7 +880,7 @@

    diff --git a/docs/code/files/src-palette.html b/docs/code/files/src-palette.html new file mode 100644 index 00000000..f0062871 --- /dev/null +++ b/docs/code/files/src-palette.html @@ -0,0 +1,163 @@ + + + + + Brisko + + + + + + + + + + + + + + + + + + + + +
    +

    Brisko

    + + + + + +
    + +
    +
    + + + + +
    +
      +
    + +
    +

    Palette.php

    + + +
    + + + + + + +

    + Interfaces, Classes, Traits and Enums + +

    + +
    + +
    Palette
    +
    + + +
    + + + + + + + + +
    +
    +
    +
    +

    Search results

    + +
    +
    +
      +
      +
      +
      +
      +
      + + +
      + + + + + + + + diff --git a/docs/code/index.html b/docs/code/index.html index 4e2988a7..ec10dc48 100644 --- a/docs/code/index.html +++ b/docs/code/index.html @@ -316,6 +316,13 @@

       : mixed

      +
      + +
      + brisko_site_blocks_open() + +  : mixed +
      @@ -1356,6 +1363,34 @@
      Return values
      + mixed + — + + + +
      +

      + brisko_site_blocks_open() + +

      + + + + + + brisko_site_blocks_open() : mixed + +
      + + + +
      Return values
      mixed — @@ -1370,7 +1405,7 @@

      @@ -1400,7 +1435,7 @@

      @@ -1428,7 +1463,7 @@

      @@ -1456,7 +1491,7 @@

      @@ -1484,7 +1519,7 @@

      @@ -1517,7 +1552,7 @@

      @@ -1551,7 +1586,7 @@

      @@ -1593,7 +1628,7 @@

      @@ -1621,7 +1656,7 @@

      @@ -1649,7 +1684,7 @@

      @@ -1687,7 +1722,7 @@

      @@ -1715,7 +1750,7 @@

      @@ -1785,7 +1820,7 @@

      @@ -1813,7 +1848,7 @@

      @@ -1855,7 +1890,7 @@

      @@ -1883,7 +1918,7 @@

      @@ -1941,7 +1976,7 @@

      diff --git a/docs/code/indices/files.html b/docs/code/indices/files.html index e65c9e85..6b486429 100644 --- a/docs/code/indices/files.html +++ b/docs/code/indices/files.html @@ -168,6 +168,7 @@

      O

      P

      S

        diff --git a/docs/code/js/searchIndex.js b/docs/code/js/searchIndex.js index b8c4b757..9d5a33e1 100644 --- a/docs/code/js/searchIndex.js +++ b/docs/code/js/searchIndex.js @@ -505,6 +505,11 @@ Search.appendIndex( "name": "brisko_after_footer", "summary": "", "url": "namespaces/default.html#function_brisko_after_footer" + }, { + "fqsen": "\\brisko_site_blocks_open\u0028\u0029", + "name": "brisko_site_blocks_open", + "summary": "", + "url": "namespaces/default.html#function_brisko_site_blocks_open" }, { "fqsen": "\\brisko\u0028\u0029", "name": "brisko", @@ -1120,6 +1125,36 @@ Search.appendIndex( "name": "css_files", "summary": "", "url": "classes/Brisko-AbstractEnq.html#property_css_files" + }, { + "fqsen": "\\Brisko\\Palette", + "name": "Palette", + "summary": "", + "url": "classes/Brisko-Palette.html" + }, { + "fqsen": "\\Brisko\\Palette\u003A\u003Agenerate\u0028\u0029", + "name": "generate", + "summary": "Generate\u0020a\u0020Palette\u002Dstyle\u0020colors\u0020based\u0020on\u0020a\u0020base\u0020hex\u0020color.", + "url": "classes/Brisko-Palette.html#method_generate" + }, { + "fqsen": "\\Brisko\\Palette\u003A\u003Asanitize_hex\u0028\u0029", + "name": "sanitize_hex", + "summary": "Sanitize\u0020and\u0020normalize\u0020a\u0020hex\u0020color\u0020code.", + "url": "classes/Brisko-Palette.html#method_sanitize_hex" + }, { + "fqsen": "\\Brisko\\Palette\u003A\u003Ahex_to_rgb\u0028\u0029", + "name": "hex_to_rgb", + "summary": "Convert\u0020a\u0020hex\u0020color\u0020to\u0020an\u0020RGB\u0020array.", + "url": "classes/Brisko-Palette.html#method_hex_to_rgb" + }, { + "fqsen": "\\Brisko\\Palette\u003A\u003Argb_to_hex\u0028\u0029", + "name": "rgb_to_hex", + "summary": "Convert\u0020RGB\u0020values\u0020to\u0020a\u0020hex\u0020color\u0020string.", + "url": "classes/Brisko-Palette.html#method_rgb_to_hex" + }, { + "fqsen": "\\Brisko\\Palette\u003A\u003Aadjust_color_component\u0028\u0029", + "name": "adjust_color_component", + "summary": "Adjust\u0020an\u0020RGB\u0020color\u0020component\u0020based\u0020on\u0020a\u0020lightness\u0020factor.", + "url": "classes/Brisko-Palette.html#method_adjust_color_component" }, { "fqsen": "\\", "name": "\\", diff --git a/docs/code/namespaces/brisko.html b/docs/code/namespaces/brisko.html index db3b7529..92a5b547 100644 --- a/docs/code/namespaces/brisko.html +++ b/docs/code/namespaces/brisko.html @@ -146,6 +146,8 @@

        The main Navigation class.
        AbstractEnq
        +
        Palette
        +

      diff --git a/docs/code/namespaces/default.html b/docs/code/namespaces/default.html index 071735f5..c48d11f5 100644 --- a/docs/code/namespaces/default.html +++ b/docs/code/namespaces/default.html @@ -311,6 +311,13 @@

       : mixed +
      + +
      + brisko_site_blocks_open() + +  : mixed +
      @@ -1351,6 +1358,34 @@
      Return values
      + mixed + — + + + +
      +

      + brisko_site_blocks_open() + +

      + + + + + + brisko_site_blocks_open() : mixed + +
      + + + +
      Return values
      mixed — @@ -1365,7 +1400,7 @@

      @@ -1395,7 +1430,7 @@

      @@ -1423,7 +1458,7 @@

      @@ -1451,7 +1486,7 @@

      @@ -1479,7 +1514,7 @@

      @@ -1512,7 +1547,7 @@

      @@ -1546,7 +1581,7 @@

      @@ -1588,7 +1623,7 @@

      @@ -1616,7 +1651,7 @@

      @@ -1644,7 +1679,7 @@

      @@ -1682,7 +1717,7 @@

      @@ -1710,7 +1745,7 @@

      @@ -1780,7 +1815,7 @@

      @@ -1808,7 +1843,7 @@

      @@ -1850,7 +1885,7 @@

      @@ -1878,7 +1913,7 @@

      @@ -1936,7 +1971,7 @@

      diff --git a/docs/code/packages/Application.html b/docs/code/packages/Application.html index 408b0e73..c6114b9c 100644 --- a/docs/code/packages/Application.html +++ b/docs/code/packages/Application.html @@ -187,6 +187,8 @@

      The main Navigation class.
      AbstractEnq
      +
      Palette
      +
      SettingsTrait
      @@ -389,6 +391,13 @@

       : mixed

      +
      + +
      + brisko_site_blocks_open() + +  : mixed +
      @@ -1429,6 +1438,34 @@
      Return values
      + mixed + — + + + +
      +

      + brisko_site_blocks_open() + +

      + + + + + + brisko_site_blocks_open() : mixed + +
      + + + +
      Return values
      mixed — @@ -1443,7 +1480,7 @@

      @@ -1473,7 +1510,7 @@

      @@ -1501,7 +1538,7 @@

      @@ -1529,7 +1566,7 @@

      @@ -1557,7 +1594,7 @@

      @@ -1590,7 +1627,7 @@

      @@ -1624,7 +1661,7 @@

      @@ -1666,7 +1703,7 @@

      @@ -1694,7 +1731,7 @@

      @@ -1722,7 +1759,7 @@

      @@ -1760,7 +1797,7 @@

      @@ -1788,7 +1825,7 @@

      @@ -1858,7 +1895,7 @@

      @@ -1886,7 +1923,7 @@

      @@ -1928,7 +1965,7 @@

      @@ -1956,7 +1993,7 @@

      @@ -2014,7 +2051,7 @@

      diff --git a/src/Palette.php b/src/Palette.php index 7435f2ee..6d0df677 100644 --- a/src/Palette.php +++ b/src/Palette.php @@ -9,18 +9,19 @@ class Palette /** * Generate a Palette-style colors based on a base hex color. * - * @param string $colorName The name of the color. - * @param string $baseHex The base hex color (e.g., #04e200). + * @param string $base_hex The base hex color (e.g., #04e200). + * @param string $color_name The name of the color. * * @throws InvalidArgumentException If an invalid hex color is provided. * * @return array The generated color palette. */ - public static function generate(string $baseHex, string $colorName): array + public static function generate( string $base_hex, string $color_name ): array { - $baseHex = self::sanitizeHex($baseHex); + $base_hex = self::sanitize_hex( $base_hex ); - [$r, $g, $b] = self::hexToRgb($baseHex); + // [$r, $g, $b] = self::hex_to_rgb( $base_hex ); + list($r, $g, $b) = self::hex_to_rgb( $base_hex ); $shades = [ 50 => 0.05, @@ -38,15 +39,15 @@ public static function generate(string $baseHex, string $colorName): array $palette = []; - foreach ($shades as $shade => $factor) { - $palette[$shade] = self::rgbToHex( - self::adjustColorComponent($r, $factor), - self::adjustColorComponent($g, $factor), - self::adjustColorComponent($b, $factor) + foreach ( $shades as $shade => $factor ) { + $palette[ $shade ] = self::rgb_to_hex( + self::adjust_color_component( $r, $factor ), + self::adjust_color_component( $g, $factor ), + self::adjust_color_component( $b, $factor ) ); } - return [$colorName => $palette]; + return [ $color_name => $palette ]; } /** @@ -58,20 +59,20 @@ public static function generate(string $baseHex, string $colorName): array * * @return string The sanitized 6-character hex code. */ - private static function sanitizeHex(string $hex): string + private static function sanitize_hex( string $hex ): string { - $hex = ltrim($hex, '#'); + $hex = ltrim( $hex, '#' ); // Convert 3-character hex to 6-character hex - if (3 === \strlen($hex)) { - $hex = preg_replace('/(.)/', '$1$1', $hex); + if ( 3 === \strlen( $hex ) ) { + $hex = preg_replace( '/(.)/', '$1$1', $hex ); } - if ( ! preg_match('/^[a-fA-F0-9]{6}$/', $hex)) { - throw new InvalidArgumentException('Invalid hex color format.'); + if ( ! preg_match( '/^[a-fA-F0-9]{6}$/', $hex ) ) { + throw new InvalidArgumentException( 'Invalid hex color format.' ); } - return strtolower($hex); + return strtolower( $hex ); } /** @@ -81,9 +82,9 @@ private static function sanitizeHex(string $hex): string * * @return array An array containing RGB values. */ - private static function hexToRgb(string $hex): array + private static function hex_to_rgb( string $hex ): array { - return sscanf($hex, "%02x%02x%02x"); + return sscanf( $hex, '%02x%02x%02x' ); } /** @@ -95,9 +96,9 @@ private static function hexToRgb(string $hex): array * * @return string The hex color. */ - private static function rgbToHex(int $r, int $g, int $b): string + private static function rgb_to_hex( int $r, int $g, int $b ): string { - return \sprintf("#%02x%02x%02x", $r, $g, $b); + return \sprintf( '#%02x%02x%02x', $r, $g, $b ); } /** @@ -108,9 +109,9 @@ private static function rgbToHex(int $r, int $g, int $b): string * * @return int The adjusted color component. */ - private static function adjustColorComponent(int $component, float $factor): int + private static function adjust_color_component( int $component, float $factor ): int { - return max(0, min(255, round($component * $factor + (255 * (1 - $factor))))); + return max( 0, min( 255, round( $component * $factor + ( 255 * ( 1 - $factor ) ) ) ) ); } } diff --git a/src/inc/template-tags.php b/src/inc/template-tags.php index 80aa1b48..18d6da45 100644 --- a/src/inc/template-tags.php +++ b/src/inc/template-tags.php @@ -9,10 +9,13 @@ function brisko_site_blocks_open() { - if (get_theme_mod( 'use_block_templates', false ) || get_theme_mod( 'use_block_header', false )) { - ?>
      +
      +
      + Date: Mon, 3 Mar 2025 22:42:25 -0500 Subject: [PATCH 11/17] feat: adds new styles --- styles/atlantis.json | 157 +++++++++++++++++++++++++++++++++++++++++++ styles/cove.json | 157 +++++++++++++++++++++++++++++++++++++++++++ styles/falcon.json | 157 +++++++++++++++++++++++++++++++++++++++++++ styles/gothic.json | 157 +++++++++++++++++++++++++++++++++++++++++++ styles/spring.json | 157 +++++++++++++++++++++++++++++++++++++++++++ styles/totem.json | 157 +++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 942 insertions(+) create mode 100644 styles/atlantis.json create mode 100644 styles/cove.json create mode 100644 styles/falcon.json create mode 100644 styles/gothic.json create mode 100644 styles/spring.json create mode 100644 styles/totem.json diff --git a/styles/atlantis.json b/styles/atlantis.json new file mode 100644 index 00000000..054bbcbb --- /dev/null +++ b/styles/atlantis.json @@ -0,0 +1,157 @@ +{ + "version": 3, + "$schema": "https://schemas.wp.org/wp/6.7/theme.json", + "title": "Atlantis", + "settings": { + "color": { + "palette": [ + { "slug": "brisko-50", "color": "#f2fee7", "name": "Atlantis 50" }, + { "slug": "brisko-100", "color": "#e1fccb", "name": "Atlantis 100" }, + { "slug": "brisko-200", "color": "#c4f99d", "name": "Atlantis 200" }, + { "slug": "brisko-300", "color": "#8ff04e", "name": "Atlantis 300" }, + { "slug": "brisko-400", "color": "#7ae635", "name": "Atlantis 400" }, + { "slug": "brisko-500", "color": "#5acc16", "name": "Atlantis 500" }, + { "slug": "brisko-600", "color": "#42a30d", "name": "Atlantis 600" }, + { "slug": "brisko-700", "color": "#347c0f", "name": "Atlantis 700" }, + { "slug": "brisko-800", "color": "#2c6212", "name": "Atlantis 800" }, + { "slug": "brisko-900", "color": "#275314", "name": "Atlantis 900" }, + { "slug": "brisko-950", "color": "#102e05", "name": "Atlantis 950" } + ] + }, + "typography": { + "fontFamilies": [ + { + "slug": "primary", + "fontFamily": "Inter, sans-serif", + "name": "Inter" + }, + { + "slug": "secondary", + "fontFamily": "Georgia, serif", + "name": "Georgia" + }, + { + "slug": "dm-sans", + "fontFamily": "'DM Sans', sans-serif", + "name": "DM Sans" + } + ], + "fontSizes": [ + { "slug": "small", "size": "14px", "name": "Small" }, + { "slug": "normal", "size": "16px", "name": "Normal" }, + { "slug": "medium", "size": "18px", "name": "Medium" }, + { "slug": "large", "size": "24px", "name": "Large" }, + { "slug": "x-large", "size": "30px", "name": "X-Large" }, + { "slug": "xx-large", "size": "36px", "name": "XX-Large" }, + { "slug": "huge", "size": "48px", "name": "Huge" } + ] + } + }, + "styles": { + "typography": { + "fontFamily": "var(--wp--preset--font-family--dm-sans)", + "fontSize": "var(--wp--preset--font-size--medium)", + "lineHeight": "1.7" + }, + "elements": { + "h1": { + "typography": { + "fontSize": "var(--wp--preset--font-size--huge)", + "lineHeight": "1.1" + } + }, + "h2": { + "typography": { + "fontSize": "var(--wp--preset--font-size--xx-large)", + "lineHeight": "1.2" + } + }, + "h3": { + "typography": { + "fontSize": "var(--wp--preset--font-size--x-large)", + "lineHeight": "1.2" + } + }, + "h4": { + "typography": { + "fontSize": "var(--wp--preset--font-size--large)", + "fontWeight": "600" + } + }, + "h5": { + "typography": { + "fontStyle": "normal", + "fontWeight": "600", + "textTransform": "none" + } + }, + "h6": { + "typography": { + "fontSize": "var(--wp--preset--font-size--normal)", + "fontStyle": "normal", + "fontWeight": "600" + } + }, + "link": { + "color": { + "text": "var(--wp--preset--color--brisko-500)" + }, + ":hover": { + "color": { + "text": "var(--wp--preset--color--brisko-950)" + } + } + }, + "heading": { + "color": { + "text": "var(--wp--preset--color--brisko-800)" + } + } + }, + "blocks": { + "core/group": { + "border": { + "radius": "0px" + }, + "color": { + "text": "var(--wp--preset--color--brisko-950)" + }, + "spacing": { + "padding": { + "top": "20px", + "right": "0px", + "bottom": "0px", + "left": "0px" + } + } + }, + "core/button": { + "border": { + "radius": "6px" + }, + "color": { + "background": "var(--wp--preset--color--brisko-700)", + "text": "#ffffff" + }, + ":hover": { + "color": { + "text": "var(--wp--preset--color--brisko-950)" + } + } + }, + "core/paragraph": { + "typography": { + "fontSize": "var(--wp--preset--font-size--medium)", + "lineHeight": "1.7" + } + }, + "core/list": { + "spacing": { + "margin": { + "bottom": "1em" + } + } + } + } + } +} diff --git a/styles/cove.json b/styles/cove.json new file mode 100644 index 00000000..52ccb2cb --- /dev/null +++ b/styles/cove.json @@ -0,0 +1,157 @@ +{ + "version": 3, + "$schema": "https://schemas.wp.org/wp/6.7/theme.json", + "title": "Cove", + "settings": { + "color": { + "palette": [ + { "slug": "brisko-50", "color": "#f3f5fa", "name": "Cove 50" }, + { "slug": "brisko-100", "color": "#e8eff7", "name": "Cove 100" }, + { "slug": "brisko-200", "color": "#d6e0ef", "name": "Cove 200" }, + { "slug": "brisko-300", "color": "#bccbe5", "name": "Cove 300" }, + { "slug": "brisko-400", "color": "#a1b0d8", "name": "Cove 400" }, + { "slug": "brisko-500", "color": "#8795ca", "name": "Cove 500" }, + { "slug": "brisko-600", "color": "#717bba", "name": "Cove 600" }, + { "slug": "brisko-700", "color": "#5f67a3", "name": "Cove 700" }, + { "slug": "brisko-800", "color": "#4f5684", "name": "Cove 800" }, + { "slug": "brisko-900", "color": "#44496b", "name": "Cove 900" }, + { "slug": "brisko-950", "color": "#282b3e", "name": "Cove 950" } + ] + }, + "typography": { + "fontFamilies": [ + { + "slug": "primary", + "fontFamily": "Inter, sans-serif", + "name": "Inter" + }, + { + "slug": "secondary", + "fontFamily": "Georgia, serif", + "name": "Georgia" + }, + { + "slug": "dm-sans", + "fontFamily": "'DM Sans', sans-serif", + "name": "DM Sans" + } + ], + "fontSizes": [ + { "slug": "small", "size": "14px", "name": "Small" }, + { "slug": "normal", "size": "16px", "name": "Normal" }, + { "slug": "medium", "size": "18px", "name": "Medium" }, + { "slug": "large", "size": "24px", "name": "Large" }, + { "slug": "x-large", "size": "30px", "name": "X-Large" }, + { "slug": "xx-large", "size": "36px", "name": "XX-Large" }, + { "slug": "huge", "size": "48px", "name": "Huge" } + ] + } + }, + "styles": { + "typography": { + "fontFamily": "var(--wp--preset--font-family--dm-sans)", + "fontSize": "var(--wp--preset--font-size--medium)", + "lineHeight": "1.7" + }, + "elements": { + "h1": { + "typography": { + "fontSize": "var(--wp--preset--font-size--huge)", + "lineHeight": "1.1" + } + }, + "h2": { + "typography": { + "fontSize": "var(--wp--preset--font-size--xx-large)", + "lineHeight": "1.2" + } + }, + "h3": { + "typography": { + "fontSize": "var(--wp--preset--font-size--x-large)", + "lineHeight": "1.2" + } + }, + "h4": { + "typography": { + "fontSize": "var(--wp--preset--font-size--large)", + "fontWeight": "600" + } + }, + "h5": { + "typography": { + "fontStyle": "normal", + "fontWeight": "600", + "textTransform": "none" + } + }, + "h6": { + "typography": { + "fontSize": "var(--wp--preset--font-size--normal)", + "fontStyle": "normal", + "fontWeight": "600" + } + }, + "link": { + "color": { + "text": "var(--wp--preset--color--brisko-500)" + }, + ":hover": { + "color": { + "text": "var(--wp--preset--color--brisko-950)" + } + } + }, + "heading": { + "color": { + "text": "var(--wp--preset--color--brisko-800)" + } + } + }, + "blocks": { + "core/group": { + "border": { + "radius": "0px" + }, + "color": { + "text": "var(--wp--preset--color--brisko-950)" + }, + "spacing": { + "padding": { + "top": "20px", + "right": "0px", + "bottom": "0px", + "left": "0px" + } + } + }, + "core/button": { + "border": { + "radius": "6px" + }, + "color": { + "background": "var(--wp--preset--color--brisko-700)", + "text": "#ffffff" + }, + ":hover": { + "color": { + "text": "var(--wp--preset--color--brisko-950)" + } + } + }, + "core/paragraph": { + "typography": { + "fontSize": "var(--wp--preset--font-size--medium)", + "lineHeight": "1.7" + } + }, + "core/list": { + "spacing": { + "margin": { + "bottom": "1em" + } + } + } + } + } +} diff --git a/styles/falcon.json b/styles/falcon.json new file mode 100644 index 00000000..15d8a559 --- /dev/null +++ b/styles/falcon.json @@ -0,0 +1,157 @@ +{ + "version": 3, + "$schema": "https://schemas.wp.org/wp/6.7/theme.json", + "title": "Falcon", + "settings": { + "color": { + "palette": [ + { "slug": "brisko-50", "color": "#f9f6f9", "name": "Falcon 50" }, + { "slug": "brisko-100", "color": "#f4eff3", "name": "Falcon 100" }, + { "slug": "brisko-200", "color": "#eae0e8", "name": "Falcon 200" }, + { "slug": "brisko-300", "color": "#d9c8d4", "name": "Falcon 300" }, + { "slug": "brisko-400", "color": "#c1a5b9", "name": "Falcon 400" }, + { "slug": "brisko-500", "color": "#ac88a0", "name": "Falcon 500" }, + { "slug": "brisko-600", "color": "#88647a", "name": "Falcon 600" }, + { "slug": "brisko-700", "color": "#7d596e", "name": "Falcon 700" }, + { "slug": "brisko-800", "color": "#684c5c", "name": "Falcon 800" }, + { "slug": "brisko-900", "color": "#59424f", "name": "Falcon 900" }, + { "slug": "brisko-950", "color": "#33242d", "name": "Falcon 950" } + ] + }, + "typography": { + "fontFamilies": [ + { + "slug": "primary", + "fontFamily": "Inter, sans-serif", + "name": "Inter" + }, + { + "slug": "secondary", + "fontFamily": "Georgia, serif", + "name": "Georgia" + }, + { + "slug": "dm-sans", + "fontFamily": "'DM Sans', sans-serif", + "name": "DM Sans" + } + ], + "fontSizes": [ + { "slug": "small", "size": "14px", "name": "Small" }, + { "slug": "normal", "size": "16px", "name": "Normal" }, + { "slug": "medium", "size": "18px", "name": "Medium" }, + { "slug": "large", "size": "24px", "name": "Large" }, + { "slug": "x-large", "size": "30px", "name": "X-Large" }, + { "slug": "xx-large", "size": "36px", "name": "XX-Large" }, + { "slug": "huge", "size": "48px", "name": "Huge" } + ] + } + }, + "styles": { + "typography": { + "fontFamily": "var(--wp--preset--font-family--dm-sans)", + "fontSize": "var(--wp--preset--font-size--medium)", + "lineHeight": "1.7" + }, + "elements": { + "h1": { + "typography": { + "fontSize": "var(--wp--preset--font-size--huge)", + "lineHeight": "1.1" + } + }, + "h2": { + "typography": { + "fontSize": "var(--wp--preset--font-size--xx-large)", + "lineHeight": "1.2" + } + }, + "h3": { + "typography": { + "fontSize": "var(--wp--preset--font-size--x-large)", + "lineHeight": "1.2" + } + }, + "h4": { + "typography": { + "fontSize": "var(--wp--preset--font-size--large)", + "fontWeight": "600" + } + }, + "h5": { + "typography": { + "fontStyle": "normal", + "fontWeight": "600", + "textTransform": "none" + } + }, + "h6": { + "typography": { + "fontSize": "var(--wp--preset--font-size--normal)", + "fontStyle": "normal", + "fontWeight": "600" + } + }, + "link": { + "color": { + "text": "var(--wp--preset--color--brisko-500)" + }, + ":hover": { + "color": { + "text": "var(--wp--preset--color--brisko-950)" + } + } + }, + "heading": { + "color": { + "text": "var(--wp--preset--color--brisko-800)" + } + } + }, + "blocks": { + "core/group": { + "border": { + "radius": "0px" + }, + "color": { + "text": "var(--wp--preset--color--brisko-950)" + }, + "spacing": { + "padding": { + "top": "20px", + "right": "0px", + "bottom": "0px", + "left": "0px" + } + } + }, + "core/button": { + "border": { + "radius": "6px" + }, + "color": { + "background": "var(--wp--preset--color--brisko-700)", + "text": "#ffffff" + }, + ":hover": { + "color": { + "text": "var(--wp--preset--color--brisko-950)" + } + } + }, + "core/paragraph": { + "typography": { + "fontSize": "var(--wp--preset--font-size--medium)", + "lineHeight": "1.7" + } + }, + "core/list": { + "spacing": { + "margin": { + "bottom": "1em" + } + } + } + } + } +} diff --git a/styles/gothic.json b/styles/gothic.json new file mode 100644 index 00000000..15ce1552 --- /dev/null +++ b/styles/gothic.json @@ -0,0 +1,157 @@ +{ + "version": 3, + "$schema": "https://schemas.wp.org/wp/6.7/theme.json", + "title": "Gothic", + "settings": { + "color": { + "palette": [ + { "slug": "brisko-50", "color": "#f3f7f8", "name": "Gothic 50" }, + { "slug": "brisko-100", "color": "#dfeaee", "name": "Gothic 100" }, + { "slug": "brisko-200", "color": "#c3d7de", "name": "Gothic 200" }, + { "slug": "brisko-300", "color": "#9abbc6", "name": "Gothic 300" }, + { "slug": "brisko-400", "color": "#5d8c9e", "name": "Gothic 400" }, + { "slug": "brisko-500", "color": "#4e7a8c", "name": "Gothic 500" }, + { "slug": "brisko-600", "color": "#436577", "name": "Gothic 600" }, + { "slug": "brisko-700", "color": "#3b5463", "name": "Gothic 700" }, + { "slug": "brisko-800", "color": "#364954", "name": "Gothic 800" }, + { "slug": "brisko-900", "color": "#313f48", "name": "Gothic 900" }, + { "slug": "brisko-950", "color": "#1d272f", "name": "Gothic 950" } + ] + }, + "typography": { + "fontFamilies": [ + { + "slug": "primary", + "fontFamily": "Inter, sans-serif", + "name": "Inter" + }, + { + "slug": "secondary", + "fontFamily": "Georgia, serif", + "name": "Georgia" + }, + { + "slug": "dm-sans", + "fontFamily": "'DM Sans', sans-serif", + "name": "DM Sans" + } + ], + "fontSizes": [ + { "slug": "small", "size": "14px", "name": "Small" }, + { "slug": "normal", "size": "16px", "name": "Normal" }, + { "slug": "medium", "size": "18px", "name": "Medium" }, + { "slug": "large", "size": "24px", "name": "Large" }, + { "slug": "x-large", "size": "30px", "name": "X-Large" }, + { "slug": "xx-large", "size": "36px", "name": "XX-Large" }, + { "slug": "huge", "size": "48px", "name": "Huge" } + ] + } + }, + "styles": { + "typography": { + "fontFamily": "var(--wp--preset--font-family--dm-sans)", + "fontSize": "var(--wp--preset--font-size--medium)", + "lineHeight": "1.7" + }, + "elements": { + "h1": { + "typography": { + "fontSize": "var(--wp--preset--font-size--huge)", + "lineHeight": "1.1" + } + }, + "h2": { + "typography": { + "fontSize": "var(--wp--preset--font-size--xx-large)", + "lineHeight": "1.2" + } + }, + "h3": { + "typography": { + "fontSize": "var(--wp--preset--font-size--x-large)", + "lineHeight": "1.2" + } + }, + "h4": { + "typography": { + "fontSize": "var(--wp--preset--font-size--large)", + "fontWeight": "600" + } + }, + "h5": { + "typography": { + "fontStyle": "normal", + "fontWeight": "600", + "textTransform": "none" + } + }, + "h6": { + "typography": { + "fontSize": "var(--wp--preset--font-size--normal)", + "fontStyle": "normal", + "fontWeight": "600" + } + }, + "link": { + "color": { + "text": "var(--wp--preset--color--brisko-500)" + }, + ":hover": { + "color": { + "text": "var(--wp--preset--color--brisko-950)" + } + } + }, + "heading": { + "color": { + "text": "var(--wp--preset--color--brisko-800)" + } + } + }, + "blocks": { + "core/group": { + "border": { + "radius": "0px" + }, + "color": { + "text": "var(--wp--preset--color--brisko-950)" + }, + "spacing": { + "padding": { + "top": "20px", + "right": "0px", + "bottom": "0px", + "left": "0px" + } + } + }, + "core/button": { + "border": { + "radius": "6px" + }, + "color": { + "background": "var(--wp--preset--color--brisko-700)", + "text": "#ffffff" + }, + ":hover": { + "color": { + "text": "var(--wp--preset--color--brisko-950)" + } + } + }, + "core/paragraph": { + "typography": { + "fontSize": "var(--wp--preset--font-size--medium)", + "lineHeight": "1.7" + } + }, + "core/list": { + "spacing": { + "margin": { + "bottom": "1em" + } + } + } + } + } +} diff --git a/styles/spring.json b/styles/spring.json new file mode 100644 index 00000000..20e7b30b --- /dev/null +++ b/styles/spring.json @@ -0,0 +1,157 @@ +{ + "version": 3, + "$schema": "https://schemas.wp.org/wp/6.7/theme.json", + "title": "Green", + "settings": { + "color": { + "palette": [ + { "slug": "brisko-50", "color": "#effef5", "name": "Green 50" }, + { "slug": "brisko-100", "color": "#d9ffe9", "name": "Green 100" }, + { "slug": "brisko-200", "color": "#b6fcd5", "name": "Green 200" }, + { "slug": "brisko-300", "color": "#7df8b4", "name": "Green 300" }, + { "slug": "brisko-400", "color": "#3eea8b", "name": "Green 400" }, + { "slug": "brisko-500", "color": "#1ee979", "name": "Green 500" }, + { "slug": "brisko-600", "color": "#0aaf54", "name": "Green 600" }, + { "slug": "brisko-700", "color": "#0c8945", "name": "Green 700" }, + { "slug": "brisko-800", "color": "#0f6c39", "name": "Green 800" }, + { "slug": "brisko-900", "color": "#0f5832", "name": "Green 900" }, + { "slug": "brisko-950", "color": "#023119", "name": "Green 950" } + ] + }, + "typography": { + "fontFamilies": [ + { + "slug": "primary", + "fontFamily": "Inter, sans-serif", + "name": "Inter" + }, + { + "slug": "secondary", + "fontFamily": "Georgia, serif", + "name": "Georgia" + }, + { + "slug": "dm-sans", + "fontFamily": "'DM Sans', sans-serif", + "name": "DM Sans" + } + ], + "fontSizes": [ + { "slug": "small", "size": "14px", "name": "Small" }, + { "slug": "normal", "size": "16px", "name": "Normal" }, + { "slug": "medium", "size": "18px", "name": "Medium" }, + { "slug": "large", "size": "24px", "name": "Large" }, + { "slug": "x-large", "size": "30px", "name": "X-Large" }, + { "slug": "xx-large", "size": "36px", "name": "XX-Large" }, + { "slug": "huge", "size": "48px", "name": "Huge" } + ] + } + }, + "styles": { + "typography": { + "fontFamily": "var(--wp--preset--font-family--dm-sans)", + "fontSize": "var(--wp--preset--font-size--medium)", + "lineHeight": "1.7" + }, + "elements": { + "h1": { + "typography": { + "fontSize": "var(--wp--preset--font-size--huge)", + "lineHeight": "1.1" + } + }, + "h2": { + "typography": { + "fontSize": "var(--wp--preset--font-size--xx-large)", + "lineHeight": "1.2" + } + }, + "h3": { + "typography": { + "fontSize": "var(--wp--preset--font-size--x-large)", + "lineHeight": "1.2" + } + }, + "h4": { + "typography": { + "fontSize": "var(--wp--preset--font-size--large)", + "fontWeight": "600" + } + }, + "h5": { + "typography": { + "fontStyle": "normal", + "fontWeight": "600", + "textTransform": "none" + } + }, + "h6": { + "typography": { + "fontSize": "var(--wp--preset--font-size--normal)", + "fontStyle": "normal", + "fontWeight": "600" + } + }, + "link": { + "color": { + "text": "var(--wp--preset--color--brisko-500)" + }, + ":hover": { + "color": { + "text": "var(--wp--preset--color--brisko-950)" + } + } + }, + "heading": { + "color": { + "text": "var(--wp--preset--color--brisko-800)" + } + } + }, + "blocks": { + "core/group": { + "border": { + "radius": "0px" + }, + "color": { + "text": "var(--wp--preset--color--brisko-950)" + }, + "spacing": { + "padding": { + "top": "20px", + "right": "0px", + "bottom": "0px", + "left": "0px" + } + } + }, + "core/button": { + "border": { + "radius": "6px" + }, + "color": { + "background": "var(--wp--preset--color--brisko-700)", + "text": "#ffffff" + }, + ":hover": { + "color": { + "text": "var(--wp--preset--color--brisko-950)" + } + } + }, + "core/paragraph": { + "typography": { + "fontSize": "var(--wp--preset--font-size--medium)", + "lineHeight": "1.7" + } + }, + "core/list": { + "spacing": { + "margin": { + "bottom": "1em" + } + } + } + } + } +} diff --git a/styles/totem.json b/styles/totem.json new file mode 100644 index 00000000..cb8b92d2 --- /dev/null +++ b/styles/totem.json @@ -0,0 +1,157 @@ +{ + "version": 3, + "$schema": "https://schemas.wp.org/wp/6.7/theme.json", + "title": "Totem", + "settings": { + "color": { + "palette": [ + { "slug": "brisko-50", "color": "#fff6eb", "name": "Totem 50" }, + { "slug": "brisko-100", "color": "#ffedd0", "name": "Totem 100" }, + { "slug": "brisko-200", "color": "#ffd5a1", "name": "Totem 200" }, + { "slug": "brisko-300", "color": "#ffb565", "name": "Totem 300" }, + { "slug": "brisko-400", "color": "#ff8927", "name": "Totem 400" }, + { "slug": "brisko-500", "color": "#ff6700", "name": "Totem 500" }, + { "slug": "brisko-600", "color": "#ff4800", "name": "Totem 600" }, + { "slug": "brisko-700", "color": "#d63200", "name": "Totem 700" }, + { "slug": "brisko-800", "color": "#a92803", "name": "Totem 800" }, + { "slug": "brisko-900", "color": "#922607", "name": "Totem 900" }, + { "slug": "brisko-950", "color": "#4a0e00", "name": "Totem 950" } + ] + }, + "typography": { + "fontFamilies": [ + { + "slug": "primary", + "fontFamily": "Inter, sans-serif", + "name": "Inter" + }, + { + "slug": "secondary", + "fontFamily": "Georgia, serif", + "name": "Georgia" + }, + { + "slug": "dm-sans", + "fontFamily": "'DM Sans', sans-serif", + "name": "DM Sans" + } + ], + "fontSizes": [ + { "slug": "small", "size": "14px", "name": "Small" }, + { "slug": "normal", "size": "16px", "name": "Normal" }, + { "slug": "medium", "size": "18px", "name": "Medium" }, + { "slug": "large", "size": "24px", "name": "Large" }, + { "slug": "x-large", "size": "30px", "name": "X-Large" }, + { "slug": "xx-large", "size": "36px", "name": "XX-Large" }, + { "slug": "huge", "size": "48px", "name": "Huge" } + ] + } + }, + "styles": { + "typography": { + "fontFamily": "var(--wp--preset--font-family--dm-sans)", + "fontSize": "var(--wp--preset--font-size--medium)", + "lineHeight": "1.7" + }, + "elements": { + "h1": { + "typography": { + "fontSize": "var(--wp--preset--font-size--huge)", + "lineHeight": "1.1" + } + }, + "h2": { + "typography": { + "fontSize": "var(--wp--preset--font-size--xx-large)", + "lineHeight": "1.2" + } + }, + "h3": { + "typography": { + "fontSize": "var(--wp--preset--font-size--x-large)", + "lineHeight": "1.2" + } + }, + "h4": { + "typography": { + "fontSize": "var(--wp--preset--font-size--large)", + "fontWeight": "600" + } + }, + "h5": { + "typography": { + "fontStyle": "normal", + "fontWeight": "600", + "textTransform": "none" + } + }, + "h6": { + "typography": { + "fontSize": "var(--wp--preset--font-size--normal)", + "fontStyle": "normal", + "fontWeight": "600" + } + }, + "link": { + "color": { + "text": "var(--wp--preset--color--brisko-500)" + }, + ":hover": { + "color": { + "text": "var(--wp--preset--color--brisko-950)" + } + } + }, + "heading": { + "color": { + "text": "var(--wp--preset--color--brisko-800)" + } + } + }, + "blocks": { + "core/group": { + "border": { + "radius": "0px" + }, + "color": { + "text": "var(--wp--preset--color--brisko-950)" + }, + "spacing": { + "padding": { + "top": "20px", + "right": "0px", + "bottom": "0px", + "left": "0px" + } + } + }, + "core/button": { + "border": { + "radius": "6px" + }, + "color": { + "background": "var(--wp--preset--color--brisko-700)", + "text": "#ffffff" + }, + ":hover": { + "color": { + "text": "var(--wp--preset--color--brisko-950)" + } + } + }, + "core/paragraph": { + "typography": { + "fontSize": "var(--wp--preset--font-size--medium)", + "lineHeight": "1.7" + } + }, + "core/list": { + "spacing": { + "margin": { + "bottom": "1em" + } + } + } + } + } +} From e63dc26819753ac81cf04c4fe5d30e1b1f2bb193 Mon Sep 17 00:00:00 2001 From: devuri Date: Mon, 3 Mar 2025 22:44:09 -0500 Subject: [PATCH 12/17] feat: adds new settings to enable hybrid theme mode --- src/Customize/Settings/Footer.php | 21 +-- src/Customize/Settings/General.php | 144 +++++++++++--------- src/Customize/Settings/Header.php | 4 +- src/Customize/Settings/SelectiveRefresh.php | 4 + src/Footer.php | 2 +- src/Setup/Styles.php | 7 +- src/SiteHeader.php | 9 +- 7 files changed, 102 insertions(+), 89 deletions(-) diff --git a/src/Customize/Settings/Footer.php b/src/Customize/Settings/Footer.php index 130f3070..fb29b62e 100644 --- a/src/Customize/Settings/Footer.php +++ b/src/Customize/Settings/Footer.php @@ -23,6 +23,17 @@ public static function settings( $wp_customize ) // Footer Settings. ( new Control() )->separator( $wp_customize, esc_html__( 'Footer Settings', 'brisko' ), self::section() ); + + if ( get_theme_mod( 'enable_hybrid_mode', false ) ) { + self::info_note( + $wp_customize, + 'block_header', + __( 'Note: Some Settings are disabled when "Hybrid Mode is Enabled" is set', 'brisko' ) + ); + + return; + } + // Copyright section . $wp_customize->add_setting( 'footer_copyright', @@ -98,16 +109,6 @@ public static function settings( $wp_customize ) 'Brisko Elements Advanced Options' ); - if ( get_theme_mod( 'use_block_footer', false ) ) { - self::info_note( - $wp_customize, - 'block_footer', - __( 'Note: Some Settings are disabled when "Enable Block Footer Area" is set.', 'brisko' ) - ); - - return; - } - ( new Control() )->header_title( $wp_customize, esc_html__( 'Advanced Footer Options', 'brisko' ), diff --git a/src/Customize/Settings/General.php b/src/Customize/Settings/General.php index b5fa78e5..3b7e4440 100644 --- a/src/Customize/Settings/General.php +++ b/src/Customize/Settings/General.php @@ -99,29 +99,9 @@ public static function settings( $wp_customize ) ) ); - if ( ! get_theme_mod( 'use_block_templates', false ) ) { - // Link Color - $wp_customize->add_setting( - 'link_color', - [ - 'capability' => 'manage_options', - 'default' => '#000000', - 'transport' => self::$transport, - 'sanitize_callback' => 'sanitize_hex_color', - ] - ); - - $wp_customize->add_control( - new WP_Customize_Color_Control( - $wp_customize, - 'link_color', - [ - 'label' => esc_html__( 'Link Color', 'brisko' ), - 'description' => esc_html__( 'Select a color', 'brisko' ), - 'section' => self::section(), - ] - ) - ); + // Link Color + if ( ! is_brisko_hybrid_fse() ) { + self::global_link_color_settings(); } ( new Control() )->separator( $wp_customize, esc_html__( 'Other Settings', 'brisko' ), self::section() ); @@ -136,29 +116,32 @@ public static function settings( $wp_customize ) return; } - // Underline Content Links. - $wp_customize->add_setting( - 'underline_post_links', - [ - 'default' => true, - 'capability' => self::$capability, - 'transport' => self::$transport, - 'sanitize_callback' => 'brisko_sanitize_checkbox', - ] - ); - $wp_customize->add_control( - new ToggleControl( - $wp_customize, + if ( ! is_brisko_hybrid_fse() ) { + // Underline Content Links. + $wp_customize->add_setting( 'underline_post_links', [ - 'label' => esc_html__( 'Underline Links', 'brisko' ), - 'section' => self::section(), - 'type' => 'light', - // light, ios, flat. + 'default' => true, + 'capability' => self::$capability, + 'transport' => self::$transport, + 'sanitize_callback' => 'brisko_sanitize_checkbox', ] - ) - ); + ); + + $wp_customize->add_control( + new ToggleControl( + $wp_customize, + 'underline_post_links', + [ + 'label' => esc_html__( 'Underline Links', 'brisko' ), + 'section' => self::section(), + 'type' => 'light', + // light, ios, flat. + ] + ) + ); + } // Removes extra

      tags in post and pages $wp_customize->add_setting( @@ -191,39 +174,39 @@ public static function settings( $wp_customize ) } } - - protected static function hybrid_mode_settings( $wp_customize ) + protected static function global_link_color_settings( $wp_customize ) { - ( new Control() )->separator( $wp_customize, esc_html__( 'Hybrid Mode', 'brisko' ), self::section() ); - - // Load user assets + // Link Color $wp_customize->add_setting( - 'use_custom_styles', + 'link_color', [ - 'default' => false, - 'capability' => self::$capability, + 'capability' => 'manage_options', + 'default' => '#000000', 'transport' => self::$transport, - 'sanitize_callback' => 'brisko_sanitize_checkbox', + 'sanitize_callback' => 'sanitize_hex_color', ] ); $wp_customize->add_control( - new ToggleControl( + new WP_Customize_Color_Control( $wp_customize, - 'use_custom_styles', + 'link_color', [ - 'label' => esc_html__( 'Enable Custom Styles', 'brisko' ), - 'description' => esc_html__( 'Custom Styles, may not be needed in hybrid theme mode or FSE mode.', 'brisko' ), + 'label' => esc_html__( 'Link Color', 'brisko' ), + 'description' => esc_html__( 'Select a color', 'brisko' ), 'section' => self::section(), - 'type' => 'light', - // light, ios, flat. ] ) ); + } - // Load user assets + protected static function hybrid_mode_settings( $wp_customize ) + { + ( new Control() )->separator( $wp_customize, esc_html__( 'Hybrid Mode', 'brisko' ), self::section() ); + + // Hybrid Mode $wp_customize->add_setting( - 'use_block_header', + 'enable_hybrid_mode', [ 'default' => false, 'capability' => self::$capability, @@ -235,10 +218,10 @@ protected static function hybrid_mode_settings( $wp_customize ) $wp_customize->add_control( new ToggleControl( $wp_customize, - 'use_block_header', + 'enable_hybrid_mode', [ - 'label' => esc_html__( 'Enable Block Header Area', 'brisko' ), - 'description' => esc_html__( 'Will render the block header template in hybrid theme mode.', 'brisko' ), + 'label' => esc_html__( 'Enable Hybrid Mode', 'brisko' ), + 'description' => esc_html__( 'Will render the block header and footer template in hybrid theme mode.', 'brisko' ), 'section' => self::section(), 'type' => 'light', // light, ios, flat. @@ -246,9 +229,36 @@ protected static function hybrid_mode_settings( $wp_customize ) ) ); - // Load user assets + if ( ! get_theme_mod( 'enable_hybrid_mode', false ) ) { + // FSE Layouts + $wp_customize->add_setting( + 'enable_fse_layout', + [ + 'default' => false, + 'capability' => self::$capability, + 'transport' => self::$transport, + 'sanitize_callback' => 'brisko_sanitize_checkbox', + ] + ); + + $wp_customize->add_control( + new ToggleControl( + $wp_customize, + 'enable_fse_layout', + [ + 'label' => esc_html__( 'Enable FSE Layouts', 'brisko' ), + 'description' => esc_html__( 'Sets up support for full width etc.', 'brisko' ), + 'section' => self::section(), + 'type' => 'light', + // light, ios, flat. + ] + ) + ); + } + + // Custom Styles $wp_customize->add_setting( - 'use_block_footer', + 'use_custom_styles', [ 'default' => false, 'capability' => self::$capability, @@ -260,10 +270,10 @@ protected static function hybrid_mode_settings( $wp_customize ) $wp_customize->add_control( new ToggleControl( $wp_customize, - 'use_block_footer', + 'use_custom_styles', [ - 'label' => esc_html__( 'Enable Block Footer Area', 'brisko' ), - 'description' => esc_html__( 'Will render the block footer template in hybrid theme mode.', 'brisko' ), + 'label' => esc_html__( 'Enable Custom Styles', 'brisko' ), + 'description' => esc_html__( 'Custom Styles, may not be needed in hybrid theme mode or FSE mode.', 'brisko' ), 'section' => self::section(), 'type' => 'light', // light, ios, flat. diff --git a/src/Customize/Settings/Header.php b/src/Customize/Settings/Header.php index 32d448c8..9dd4d173 100644 --- a/src/Customize/Settings/Header.php +++ b/src/Customize/Settings/Header.php @@ -22,11 +22,11 @@ public static function settings( $wp_customize ) // Separator Header Image Settings. ( new Control() )->separator( $wp_customize, esc_html__( 'Header Image', 'brisko' ), self::section() ); - if ( get_theme_mod( 'use_block_header', false ) ) { + if ( get_theme_mod( 'enable_hybrid_mode', false ) ) { self::info_note( $wp_customize, 'block_header', - __( 'Note: Some Settings are disabled when "Enable Block Header Area" is set', 'brisko' ) + __( 'Note: Some Settings are disabled when "Hybrid Mode is Enabled" is set', 'brisko' ) ); return; diff --git a/src/Customize/Settings/SelectiveRefresh.php b/src/Customize/Settings/SelectiveRefresh.php index e135fd34..175b59fe 100644 --- a/src/Customize/Settings/SelectiveRefresh.php +++ b/src/Customize/Settings/SelectiveRefresh.php @@ -20,6 +20,10 @@ class SelectiveRefresh */ public static function settings( $wp_customize ) { + if ( get_theme_mod( 'use_block_templates', false ) || get_theme_mod( 'enable_hybrid_mode', false ) ) { + return; + } + /* * Customize_Selective_Refresh * diff --git a/src/Footer.php b/src/Footer.php index 14858768..0ae539d3 100644 --- a/src/Footer.php +++ b/src/Footer.php @@ -18,7 +18,7 @@ class Footer */ public function site_footer() { - if ( get_theme_mod( 'use_block_footer', false ) ) { + if ( get_theme_mod( 'enable_hybrid_mode', false ) ) { self::block_footer(); } diff --git a/src/Setup/Styles.php b/src/Setup/Styles.php index ec9bf56c..52e2ca2d 100644 --- a/src/Setup/Styles.php +++ b/src/Setup/Styles.php @@ -55,7 +55,10 @@ public function enqueue() } self::enqueue_style( self::CORE_CSS, 'enable_core', true ); - self::enqueue_style( 'normalizer', self::maybe() ); + + if ( ! is_brisko_hybrid_fse() ) { + self::enqueue_style( 'normalizer', self::maybe() ); + } if ( ! get_theme_mod( 'use_block_templates', false ) ) { if ( get_theme_mod( 'use_custom_styles', false ) ) { @@ -129,6 +132,7 @@ private function custom_styles() $archive_header_padding = $this->element_mod( 'archive_header_padding', '0px' ); $archive_header_margin = $this->element_mod( 'archive_header_margin', '0px' ); $transform_tags = get_theme_mod( 'text_transform_tags', 'none' ); + $enable_fse_layout = get_theme_mod( 'enable_fse_layout', false ); // footer. $footer_links = get_theme_mod( 'footer_links_color', '#000000' ); @@ -160,6 +164,7 @@ private function custom_styles() $custom_styles['tag_links'] = ".tags-links {text-transform: {$transform_tags};}"; $custom_styles['footer_background'] = ".site-footer {background-color: {$footer_background_color};}"; $custom_styles['footer_border_color'] = ".site-footer {border-color: {$footer_border_color};}"; + $custom_styles['fse_layouts'] = '.alignfull{margin-left:calc(50% - 50vw);margin-right:calc(50% - 50vw);max-width:100vw;width:100vw;overflow:hidden}.alignwide{max-width:90vw;margin-left:calc(50% - 39vw);margin-right:calc(50% - 39vw)}'; if ( false === $underline_post_links ) { $custom_styles['underline_body_links'] = 'body a{text-decoration: none;}'; diff --git a/src/SiteHeader.php b/src/SiteHeader.php index 7d7811f7..4ec2254f 100644 --- a/src/SiteHeader.php +++ b/src/SiteHeader.php @@ -22,15 +22,8 @@ public function site_header() { // $patterns = \WP_Block_Patterns_Registry::get_instance()->get_all_registered(); - if ( get_theme_mod( 'use_block_header', false ) ) { - do_action( 'brisko_before_header' ); + if ( get_theme_mod( 'enable_hybrid_mode', false ) ) { self::block_header(); - do_action( 'brisko_after_header' ); - if ( is_front_page() && is_home() ) { - do_action( 'brisko_homepage_header' ); - } - - return; } // elementor header. From 5338febfd0f0831e92de961570857796cfbada63 Mon Sep 17 00:00:00 2001 From: devuri Date: Mon, 3 Mar 2025 22:45:07 -0500 Subject: [PATCH 13/17] fix: new `src/inc/template-tags.php` is now `src/inc/functions.php` --- functions.php | 2 +- src/inc/{template-tags.php => functions.php} | 213 +++++++++---------- 2 files changed, 106 insertions(+), 109 deletions(-) rename src/inc/{template-tags.php => functions.php} (55%) diff --git a/functions.php b/functions.php index 4769832a..0bde2862 100644 --- a/functions.php +++ b/functions.php @@ -12,7 +12,7 @@ ->addFiles([ "src/Customize/helpers.php", "src/inc/actions.php", - "src/inc/template-tags.php", + "src/inc/functions.php", ]); // Theme version. diff --git a/src/inc/template-tags.php b/src/inc/functions.php similarity index 55% rename from src/inc/template-tags.php rename to src/inc/functions.php index 18d6da45..e99e4ead 100644 --- a/src/inc/template-tags.php +++ b/src/inc/functions.php @@ -6,10 +6,9 @@ use Brisko\SiteHeader; use Brisko\Thumbnail; - function brisko_site_blocks_open() { - if ( get_theme_mod( 'use_block_templates', false ) || get_theme_mod( 'use_block_header', false ) ) { + if ( get_theme_mod( 'use_block_templates', false ) || get_theme_mod( 'enable_hybrid_mode', false ) ) { ?>
      %2$s'; + if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { + $time_string = ''; + } - $time_string = ''; - if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { - $time_string = ''; - } + $time_string = \sprintf( + $time_string, + esc_attr( get_the_date( DATE_W3C ) ), + esc_html( get_the_date() ), + esc_attr( get_the_modified_date( DATE_W3C ) ), + esc_html( get_the_modified_date() ) + ); + + $posted_on = \sprintf( + // translators: %s: post date. + esc_html_x( 'Posted on %s by', 'post date', 'brisko' ), + '' . $time_string . '' + ); + + echo '' . wp_kses_post( $posted_on ) . ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped +} - $time_string = \sprintf( - $time_string, - esc_attr( get_the_date( DATE_W3C ) ), - esc_html( get_the_date() ), - esc_attr( get_the_modified_date( DATE_W3C ) ), - esc_html( get_the_modified_date() ) - ); +/** + * Prints HTML with meta information for the current author. + */ +function brisko_posted_by() +{ + if ( ! get_theme_mod( 'display_post_author' ) ) { + return null; + } - $posted_on = \sprintf( - // translators: %s: post date. - esc_html_x( 'Posted on %s by', 'post date', 'brisko' ), - '' . $time_string . '' - ); + $byline = \sprintf( + // translators: %s: post author. + esc_html_x( '%s', 'post author', 'brisko' ), // phpcs:ignore + '' . esc_html( get_the_author() ) . '' + ); - echo '' . wp_kses_post( $posted_on ) . ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - } + echo get_avatar( get_the_author_meta( 'ID' ), 32 ); + echo ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } -if ( ! \function_exists( 'brisko_posted_by' ) ) { - /** - * Prints HTML with meta information for the current author. - */ - function brisko_posted_by() - { - if ( ! get_theme_mod( 'display_post_author' ) ) { - return null; +/** + * Prints HTML with meta information for the categories, tags and comments. + */ +function brisko_entry_footer() +{ + // Hide category and tag text for pages. + if ( 'post' === get_post_type() ) { + $categories_list = get_the_category_list( ' ' ); + $display_post_categories = get_theme_mod( 'display_post_categories' ); + if ( $categories_list && $display_post_categories ) { + // translators: 1: list of categories. + printf( '', $categories_list, esc_attr( brisko_options( 'display_post_categories' ) ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } - $byline = \sprintf( - // translators: %s: post author. - esc_html_x( '%s', 'post author', 'brisko' ), // phpcs:ignore - '' . esc_html( get_the_author() ) . '' - ); + do_action( 'brisko_before_tags' ); - echo get_avatar( get_the_author_meta( 'ID' ), 32 ); - echo ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - } -} - -if ( ! \function_exists( 'brisko_entry_footer' ) ) { - /** - * Prints HTML with meta information for the categories, tags and comments. - */ - function brisko_entry_footer() - { - // Hide category and tag text for pages. - if ( 'post' === get_post_type() ) { - $categories_list = get_the_category_list( ' ' ); - $display_post_categories = get_theme_mod( 'display_post_categories' ); - if ( $categories_list && $display_post_categories ) { - // translators: 1: list of categories. - printf( '', $categories_list, esc_attr( brisko_options( 'display_post_categories' ) ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - } - - do_action( 'brisko_before_tags' ); - - // translators: used between list items, there is a space after the comma - $tags_list = get_the_tag_list( ' ' ); - if ( $tags_list ) { - // translators: 1: list of tags. - printf( '
      ' . esc_html__( 'Tags: %1$s ', 'brisko' ) . '', $tags_list, esc_attr( brisko_options( 'display_tags' ) ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - } + // translators: used between list items, there is a space after the comma + $tags_list = get_the_tag_list( ' ' ); + if ( $tags_list ) { + // translators: 1: list of tags. + printf( '
      ' . esc_html__( 'Tags: %1$s ', 'brisko' ) . '', $tags_list, esc_attr( brisko_options( 'display_tags' ) ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } + } - if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) { - echo ''; - comments_popup_link( - \sprintf( - wp_kses( - // translators: %s: post title - __( 'Leave a Comment on %s', 'brisko' ), - [ - 'span' => [ - 'class' => [], - ], - ] - ), - wp_kses_post( get_the_title() ) - ) - ); - echo ''; - } + if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) { + echo ''; + comments_popup_link( + \sprintf( + wp_kses( + // translators: %s: post title + __( 'Leave a Comment on %s', 'brisko' ), + [ + 'span' => [ + 'class' => [], + ], + ] + ), + wp_kses_post( get_the_title() ) + ) + ); + echo ''; } } + /** * Outputs the entry meta information for posts. * @@ -397,3 +381,16 @@ function brisko_header() { return SiteHeader::get(); } + +function is_brisko_hybrid_fse() +{ + if ( get_theme_mod( 'use_block_templates', false ) ) { + return true; + } + + if ( get_theme_mod( 'enable_hybrid_mode', false ) ) { + return true; + } + + return false; +} From 01cbb8161d06e36eb12c35ea72dfc13f1da6dd17 Mon Sep 17 00:00:00 2001 From: devuri Date: Mon, 3 Mar 2025 22:45:33 -0500 Subject: [PATCH 14/17] fix: better Support for block templates --- src/Setup/Activate.php | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/src/Setup/Activate.php b/src/Setup/Activate.php index 07a1965f..56705165 100644 --- a/src/Setup/Activate.php +++ b/src/Setup/Activate.php @@ -100,14 +100,8 @@ public function brisko_setup() add_theme_support( 'responsive-embeds' ); add_theme_support( 'custom-spacing' ); - // block templates - if ( get_theme_mod( 'use_block_templates', false ) ) { - // setup block templates. - add_theme_support( 'block-template-parts' ); - } else { - remove_theme_support( 'block-templates' ); - remove_theme_support( 'widgets-block-editor' ); - } + // Support block templates + self::add_support_block_template_parts(); // Support for blocks with padding controls. add_theme_support( 'custom-spacing' ); @@ -236,4 +230,22 @@ public function brisko_widgets_init() ] ); } + + protected static function add_support_block_template_parts() + { + if ( get_theme_mod( 'use_block_templates', false ) ) { + add_theme_support( 'block-template-parts' ); + + return; + } + + if ( get_theme_mod( 'enable_hybrid_mode', false ) ) { + add_theme_support( 'block-template-parts' ); + + return; + } + + remove_theme_support( 'block-templates' ); + remove_theme_support( 'widgets-block-editor' ); + } } From 3dec2adef1d0ef0896fe097f40bd13e59f7f1e14 Mon Sep 17 00:00:00 2001 From: devuri Date: Mon, 3 Mar 2025 22:46:28 -0500 Subject: [PATCH 15/17] fix: remove `.alignfull` and `.alignwide` --- assets/src/css/brisko.css | 9 ++++----- assets/src/css/core.css | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/assets/src/css/brisko.css b/assets/src/css/brisko.css index f3f16fbc..adfc6633 100644 --- a/assets/src/css/brisko.css +++ b/assets/src/css/brisko.css @@ -101,20 +101,19 @@ pre { grid-gap: 1.5em; } -.alignfull { +/* .alignfull { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); max-width: 100vw; width: 100vw; overflow: hidden; -} +} */ -.alignwide { - /*max-width: var(--wp--style--global--wide-size);*/ +/* .alignwide { max-width: 90vw; margin-left: calc(50% - 39vw); margin-right: calc(50% - 39vw); -} +} */ /*.editor-content > *:not(.alignfull) { width: 100%; diff --git a/assets/src/css/core.css b/assets/src/css/core.css index 3505640d..9cc607a6 100644 --- a/assets/src/css/core.css +++ b/assets/src/css/core.css @@ -109,7 +109,7 @@ html, body { grid-gap: 1.5em; } -.alignfull { +/* .alignfull { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); max-width: 100vw; @@ -117,7 +117,7 @@ html, body { overflow: hidden; } -/* .alignwide { +.alignwide { max-width: 90vw; margin-left: calc(50% - 39vw); margin-right: calc(50% - 39vw); From 7f27b928a2e93f57665d609a922070ef2e1be948 Mon Sep 17 00:00:00 2001 From: devuri Date: Mon, 3 Mar 2025 22:53:16 -0500 Subject: [PATCH 16/17] chore: build --- autoload.md | 4 +- composer.json | 4 +- .../Brisko-Customize-Settings-General.html | 53 +- docs/code/classes/Brisko-Setup-Activate.html | 44 +- docs/code/classes/Brisko-Setup-Styles.html | 6 +- docs/code/classes/Brisko-SiteHeader.html | 8 +- docs/code/files/src-inc-functions.html | 966 ++++++++++++++++++ docs/code/files/src-inc-template-tags.html | 40 +- docs/code/index.html | 133 ++- docs/code/indices/files.html | 2 +- docs/code/js/searchIndex.js | 215 ++-- docs/code/namespaces/default.html | 133 ++- docs/code/packages/Application.html | 133 ++- src/Customize/Settings/Footer.php | 1 - src/Customize/Settings/General.php | 3 +- src/Palette.php | 2 +- 16 files changed, 1458 insertions(+), 289 deletions(-) create mode 100644 docs/code/files/src-inc-functions.html diff --git a/autoload.md b/autoload.md index f6c0fcb4..6ac35fe0 100644 --- a/autoload.md +++ b/autoload.md @@ -23,7 +23,7 @@ project/ │ │ ā”œā”€ā”€ helpers.php (non-class file) │ ā”œā”€ā”€ inc/ │ │ ā”œā”€ā”€ actions.php (non-class file) -│ │ ā”œā”€ā”€ template-tags.php (non-class file) +│ │ ā”œā”€ā”€ functions.php (non-class file) ā”œā”€ā”€ vendor/ (optional) ā”œā”€ā”€ Autoloader.php ā”œā”€ā”€ index.php @@ -68,7 +68,7 @@ You can also **manually include files** that are not class-based (e.g., helper f $autoloader->addFiles([ "src/Customize/helpers.php", "src/inc/actions.php", - "src/inc/template-tags.php", + "src/inc/functions.php", ]); ``` diff --git a/composer.json b/composer.json index 0c6248bb..243b035f 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "files": [ "src/Customize/helpers.php", "src/inc/actions.php", - "src/inc/template-tags.php" + "src/inc/functions.php" ], "psr-4": { "Brisko\\": "src" @@ -32,7 +32,7 @@ "files": [ "src/Customize/helpers.php", "src/inc/actions.php", - "src/inc/template-tags.php" + "src/inc/functions.php" ], "psr-4": { "Brisko\\Tests\\": "tests/" diff --git a/docs/code/classes/Brisko-Customize-Settings-General.html b/docs/code/classes/Brisko-Customize-Settings-General.html index 0b552979..b84d0992 100644 --- a/docs/code/classes/Brisko-Customize-Settings-General.html +++ b/docs/code/classes/Brisko-Customize-Settings-General.html @@ -204,6 +204,13 @@

      Brisko Section name only.
      +
      + global_link_color_settings() + +  : mixed +
      +
      +
      hybrid_mode_settings() @@ -451,6 +458,50 @@

      +

      Return values
      + mixed + — + + + +
      + + + + + + protected + static global_link_color_settings(mixed $wp_customize) : mixed + +
      + +
      Parameters
      +
      +
      + $wp_customize + : mixed +
      +
      +
      + +
      +
      + + +
      Return values
      mixed — @@ -470,7 +521,7 @@

      diff --git a/docs/code/classes/Brisko-Setup-Activate.html b/docs/code/classes/Brisko-Setup-Activate.html index 2a373233..c5b0b3d1 100644 --- a/docs/code/classes/Brisko-Setup-Activate.html +++ b/docs/code/classes/Brisko-Setup-Activate.html @@ -214,6 +214,13 @@

      Excerp More.
      +
      + add_support_block_template_parts() + +  : mixed +
      +
      + @@ -306,7 +313,7 @@

      @@ -407,7 +414,7 @@

      @@ -558,6 +565,39 @@

      Parameters
      +
      Return values
      + mixed + — + + + +
      +

      + add_support_block_template_parts() + +

      + + + + + protected + static add_support_block_template_parts() : mixed + +
      + + + +
      Return values
      mixed — diff --git a/docs/code/classes/Brisko-Setup-Styles.html b/docs/code/classes/Brisko-Setup-Styles.html index 744ad2af..84cc0a01 100644 --- a/docs/code/classes/Brisko-Setup-Styles.html +++ b/docs/code/classes/Brisko-Setup-Styles.html @@ -1000,7 +1000,7 @@

      @@ -1207,7 +1207,7 @@

      @@ -1252,7 +1252,7 @@

      diff --git a/docs/code/classes/Brisko-SiteHeader.html b/docs/code/classes/Brisko-SiteHeader.html index c2fdfad7..5183b07c 100644 --- a/docs/code/classes/Brisko-SiteHeader.html +++ b/docs/code/classes/Brisko-SiteHeader.html @@ -216,7 +216,7 @@

      @@ -282,7 +282,7 @@

      @@ -348,7 +348,7 @@

      @@ -381,7 +381,7 @@

      diff --git a/docs/code/files/src-inc-functions.html b/docs/code/files/src-inc-functions.html new file mode 100644 index 00000000..46080e64 --- /dev/null +++ b/docs/code/files/src-inc-functions.html @@ -0,0 +1,966 @@ + + + + + Brisko + + + + + + + + + + + + + + + + + + + + +
      +

      Brisko

      + + + + + +
      + +
      +
      + + + + +
      +
        +
      + +
      +

      functions.php

      + + +
      + + + + + + + + +

      + Table of Contents + +

      + +
      +
      + brisko_site_blocks_open() + +  : mixed +
      +
      + +
      + brisko() + +  : Brisko +
      +
      Get the Brisko Theme.
      + +
      + brisko_posted_on() + +  : mixed +
      +
      Prints HTML with meta information for the current post-date/time.
      + +
      + brisko_posted_by() + +  : mixed +
      +
      Prints HTML with meta information for the current author.
      + +
      + brisko_entry_footer() + +  : mixed +
      +
      Prints HTML with meta information for the categories, tags and comments.
      + +
      + brisko_entry_meta() + +  : null|void +
      +
      Outputs the entry meta information for posts.
      + +
      + brisko_entry_content_css() + +  : null|string +
      +
      Generates inline CSS for entry content based on theme settings.
      + +
      + brisko_posts_navigation() + +  : mixed +
      +
      Post Navigation.
      + +
      + brisko_is_php5_6() + +  : mixed +
      +
      Check if PHP 5.6.
      + +
      + brisko_sidebar() + +  : void +
      +
      Get the sidebar.
      + +
      + brisko_layout_head() + +  : void +
      +
      Head section.
      + +
      + brisko_layout_sidebar() + +  : mixed +
      +
      Get the sidebar.
      + +
      + brisko_layout_footer() + +  : void +
      +
      Footer section.
      + +
      + brisko_layout_content() + +  : mixed +
      +
      Display content only.
      + +
      + brisko_excerpt() + +  : mixed +
      +
      Displays an optional post excerpt.
      + +
      + brisko_options() + +  : Options +
      +
      Theme Options.
      + +
      + brisko_post_thumbnail() + +  : mixed +
      +
      Displays an optional post thumbnail.
      + +
      + brisko_footer() + +  : Footer +
      +
      Footer.
      + +
      + brisko_navigation() + +  : Navigation +
      +
      Theme Navigation.
      + +
      + brisko_header() + +  : SiteHeader +
      +
      Theme Header.
      + +
      + is_brisko_hybrid_fse() + +  : mixed +
      +
      + +
      + + + + + +
      +

      + Functions + +

      +
      +

      + brisko_site_blocks_open() + +

      + + + + + + brisko_site_blocks_open() : mixed + +
      + + + + +
      Return values
      + mixed + — + + +
      +
      +

      + brisko() + +

      + + +

      Get the Brisko Theme.

      + + + + brisko() : Brisko + + + + + +
      Return values
      + Brisko + — + + +
      +
      +

      + brisko_posted_on() + +

      + + +

      Prints HTML with meta information for the current post-date/time.

      + + + + brisko_posted_on() : mixed + + + + + +
      Return values
      + mixed + — + + +
      +
      +

      + brisko_posted_by() + +

      + + +

      Prints HTML with meta information for the current author.

      + + + + brisko_posted_by() : mixed + + + + + +
      Return values
      + mixed + — + + +
      +
      +

      + brisko_entry_footer() + +

      + + +

      Prints HTML with meta information for the categories, tags and comments.

      + + + + brisko_entry_footer() : mixed + + + + + +
      Return values
      + mixed + — + + +
      +
      +

      + brisko_entry_meta() + +

      + + +

      Outputs the entry meta information for posts.

      + + + + brisko_entry_meta() : null|void + +

      This function displays the post date and author, if enabled in the theme customizer. +If both are disabled, it triggers the 'brisko_entry_meta' action and returns null.

      +
      + + + + +
      Return values
      + null|void + — +

      Returns null if both post date and author are disabled.

      +
      + + +
      +
      +

      + brisko_entry_content_css() + +

      + + +

      Generates inline CSS for entry content based on theme settings.

      + + + + brisko_entry_content_css() : null|string + +

      This function checks whether the display of the post author or post date +is enabled in the theme customizer. If either is disabled, it returns +a style attribute to unset margin, otherwise returns null.

      +
      + + + + +
      Return values
      + null|string + — +

      Inline CSS if needed, or null if both options are enabled.

      +
      + + +
      + +
      +

      + brisko_is_php5_6() + +

      + + +

      Check if PHP 5.6.

      + + + + brisko_is_php5_6() : mixed + + + + + +
      Return values
      + mixed + — + + +
      +
      +

      + brisko_sidebar() + +

      + + +

      Get the sidebar.

      + + + + brisko_sidebar() : void + + + + + +
      Return values
      + void + — + + +
      +
      +

      + brisko_layout_head() + +

      + + +

      Head section.

      + + + + brisko_layout_head([null|string $header_type = null ]) : void + + +
      Parameters
      +
      +
      + $header_type + : null|string + = null
      +
      + +
      +
      + + + +
      Return values
      + void + — + + +
      +
      +

      + brisko_layout_sidebar() + +

      + + +

      Get the sidebar.

      + + + + brisko_layout_sidebar() : mixed + + + + + +
      Return values
      + mixed + — + + +
      +
      + + + +

      Footer section.

      + + + + brisko_layout_footer([null|string $footer_type = null ]) : void + + +
      Parameters
      +
      +
      + $footer_type + : null|string + = null
      +
      + +
      +
      + + + +
      Return values
      + void + — + + +
      +
      +

      + brisko_layout_content() + +

      + + +

      Display content only.

      + + + + brisko_layout_content() : mixed + +

      pure content will bypass the_content and use get_the_content +works better for pure content management and will not break html.

      +

      note: filters on the_content will not work.

      +
      + + + + +
      Return values
      + mixed + — + + +
      +
      +

      + brisko_excerpt() + +

      + + +

      Displays an optional post excerpt.

      + + + + brisko_excerpt() : mixed + + + + + +
      Return values
      + mixed + — + + +
      +
      +

      + brisko_options() + +

      + + +

      Theme Options.

      + + + + brisko_options(string $theme_mod) : Options + + +
      Parameters
      +
      +
      + $theme_mod + : string +
      +
      +

      .

      +
      + +
      +
      + + + +
      Return values
      + Options + — +

      .

      +
      + + +
      +
      +

      + brisko_post_thumbnail() + +

      + + +

      Displays an optional post thumbnail.

      + + + + brisko_post_thumbnail() : mixed + + + + + +
      Return values
      + mixed + — + + +
      +
      + + + +

      Footer.

      + + + + brisko_footer() : Footer + + + + + +
      Return values
      + Footer + — + + +
      +
      +

      + brisko_navigation() + +

      + + +

      Theme Navigation.

      + + + + brisko_navigation() : Navigation + + + + + +
      Return values
      + Navigation + — +

      .

      +
      + + +
      +
      +

      + brisko_header() + +

      + + +

      Theme Header.

      + + + + brisko_header() : SiteHeader + + + + + +
      Return values
      + SiteHeader + — +

      .

      +
      + + +
      +
      +

      + is_brisko_hybrid_fse() + +

      + + + + + + is_brisko_hybrid_fse() : mixed + +
      + + + + +
      Return values
      + mixed + — + + +
      +
      + +
      +
      +
      +
      +

      Search results

      + +
      +
      +
        +
        +
        +
        +
        +
        + + +
        + + + + + + + + diff --git a/docs/code/files/src-inc-template-tags.html b/docs/code/files/src-inc-template-tags.html index ee8cdab5..b5be33ea 100644 --- a/docs/code/files/src-inc-template-tags.html +++ b/docs/code/files/src-inc-template-tags.html @@ -281,7 +281,7 @@

        @@ -309,7 +309,7 @@

        @@ -339,7 +339,7 @@

        @@ -367,7 +367,7 @@

        @@ -395,7 +395,7 @@

        @@ -423,7 +423,7 @@

        @@ -456,7 +456,7 @@

        @@ -490,7 +490,7 @@

        @@ -532,7 +532,7 @@

        @@ -560,7 +560,7 @@

        @@ -588,7 +588,7 @@

        @@ -626,7 +626,7 @@

        @@ -654,7 +654,7 @@

        @@ -724,7 +724,7 @@

        @@ -752,7 +752,7 @@

        @@ -794,7 +794,7 @@

        @@ -822,7 +822,7 @@

        @@ -880,7 +880,7 @@

        diff --git a/docs/code/index.html b/docs/code/index.html index ec10dc48..f7dcffba 100644 --- a/docs/code/index.html +++ b/docs/code/index.html @@ -316,6 +316,13 @@

         : mixed +
        + +
        + wp_body_open() + +  : mixed +
        @@ -459,7 +466,7 @@

        Theme Header.
        - wp_body_open() + is_brisko_hybrid_fse()  : mixed
        @@ -1363,6 +1370,34 @@

        Return values
        + mixed + — + + +

        +
        +

        + wp_body_open() + +

        + + + + + + wp_body_open() : mixed + +
        + + + +
        Return values
        mixed — @@ -1375,9 +1410,9 @@

        @@ -1403,9 +1438,9 @@

        @@ -1415,9 +1450,7 @@

        brisko() : Brisko -

        Helper function to get the Bisko Theme Object.

        -
        - + @@ -1433,9 +1466,9 @@

        @@ -1461,9 +1494,9 @@

        @@ -1489,9 +1522,9 @@

        @@ -1517,9 +1550,9 @@

        @@ -1550,9 +1583,9 @@

        @@ -1584,9 +1617,9 @@

        @@ -1626,9 +1659,9 @@

        @@ -1654,9 +1687,9 @@

        @@ -1682,9 +1715,9 @@

        @@ -1720,9 +1753,9 @@

        @@ -1748,9 +1781,9 @@ @@ -1786,9 +1819,9 @@

        @@ -1818,9 +1851,9 @@

        @@ -1846,9 +1879,9 @@

        @@ -1888,9 +1921,9 @@

        @@ -1916,9 +1949,9 @@ @@ -1944,9 +1977,9 @@

        @@ -1974,9 +2007,9 @@

        @@ -1999,21 +2032,21 @@
        Return values
        -

        - wp_body_open() - +

        + is_brisko_hybrid_fse() +

        - wp_body_open() : mixed + is_brisko_hybrid_fse() : mixed
        diff --git a/docs/code/indices/files.html b/docs/code/indices/files.html index 6b486429..35273ad3 100644 --- a/docs/code/indices/files.html +++ b/docs/code/indices/files.html @@ -131,6 +131,7 @@

        F

        G

        W

          diff --git a/docs/code/js/searchIndex.js b/docs/code/js/searchIndex.js index 9d5a33e1..03aec57d 100644 --- a/docs/code/js/searchIndex.js +++ b/docs/code/js/searchIndex.js @@ -300,6 +300,11 @@ Search.appendIndex( "name": "settings", "summary": "Lets\u0020build\u0020out\u0020the\u0020customizer\u0020settings.", "url": "classes/Brisko-Customize-Settings-General.html#method_settings" + }, { + "fqsen": "\\Brisko\\Customize\\Settings\\General\u003A\u003Aglobal_link_color_settings\u0028\u0029", + "name": "global_link_color_settings", + "summary": "", + "url": "classes/Brisko-Customize-Settings-General.html#method_global_link_color_settings" }, { "fqsen": "\\Brisko\\Customize\\Settings\\General\u003A\u003Ahybrid_mode_settings\u0028\u0029", "name": "hybrid_mode_settings", @@ -505,106 +510,6 @@ Search.appendIndex( "name": "brisko_after_footer", "summary": "", "url": "namespaces/default.html#function_brisko_after_footer" - }, { - "fqsen": "\\brisko_site_blocks_open\u0028\u0029", - "name": "brisko_site_blocks_open", - "summary": "", - "url": "namespaces/default.html#function_brisko_site_blocks_open" - }, { - "fqsen": "\\brisko\u0028\u0029", - "name": "brisko", - "summary": "Get\u0020the\u0020Brisko\u0020Theme.", - "url": "namespaces/default.html#function_brisko" - }, { - "fqsen": "\\brisko_posted_on\u0028\u0029", - "name": "brisko_posted_on", - "summary": "Prints\u0020HTML\u0020with\u0020meta\u0020information\u0020for\u0020the\u0020current\u0020post\u002Ddate\/time.", - "url": "namespaces/default.html#function_brisko_posted_on" - }, { - "fqsen": "\\brisko_posted_by\u0028\u0029", - "name": "brisko_posted_by", - "summary": "Prints\u0020HTML\u0020with\u0020meta\u0020information\u0020for\u0020the\u0020current\u0020author.", - "url": "namespaces/default.html#function_brisko_posted_by" - }, { - "fqsen": "\\brisko_entry_footer\u0028\u0029", - "name": "brisko_entry_footer", - "summary": "Prints\u0020HTML\u0020with\u0020meta\u0020information\u0020for\u0020the\u0020categories,\u0020tags\u0020and\u0020comments.", - "url": "namespaces/default.html#function_brisko_entry_footer" - }, { - "fqsen": "\\brisko_entry_meta\u0028\u0029", - "name": "brisko_entry_meta", - "summary": "Outputs\u0020the\u0020entry\u0020meta\u0020information\u0020for\u0020posts.", - "url": "namespaces/default.html#function_brisko_entry_meta" - }, { - "fqsen": "\\brisko_entry_content_css\u0028\u0029", - "name": "brisko_entry_content_css", - "summary": "Generates\u0020inline\u0020CSS\u0020for\u0020entry\u0020content\u0020based\u0020on\u0020theme\u0020settings.", - "url": "namespaces/default.html#function_brisko_entry_content_css" - }, { - "fqsen": "\\brisko_posts_navigation\u0028\u0029", - "name": "brisko_posts_navigation", - "summary": "Post\u0020Navigation.", - "url": "namespaces/default.html#function_brisko_posts_navigation" - }, { - "fqsen": "\\brisko_is_php5_6\u0028\u0029", - "name": "brisko_is_php5_6", - "summary": "Check\u0020if\u0020PHP\u00205.6.", - "url": "namespaces/default.html#function_brisko_is_php5_6" - }, { - "fqsen": "\\brisko_sidebar\u0028\u0029", - "name": "brisko_sidebar", - "summary": "Get\u0020the\u0020sidebar.", - "url": "namespaces/default.html#function_brisko_sidebar" - }, { - "fqsen": "\\brisko_layout_head\u0028\u0029", - "name": "brisko_layout_head", - "summary": "Head\u0020section.", - "url": "namespaces/default.html#function_brisko_layout_head" - }, { - "fqsen": "\\brisko_layout_sidebar\u0028\u0029", - "name": "brisko_layout_sidebar", - "summary": "Get\u0020the\u0020sidebar.", - "url": "namespaces/default.html#function_brisko_layout_sidebar" - }, { - "fqsen": "\\brisko_layout_footer\u0028\u0029", - "name": "brisko_layout_footer", - "summary": "Footer\u0020section.", - "url": "namespaces/default.html#function_brisko_layout_footer" - }, { - "fqsen": "\\brisko_layout_content\u0028\u0029", - "name": "brisko_layout_content", - "summary": "Display\u0020content\u0020only.", - "url": "namespaces/default.html#function_brisko_layout_content" - }, { - "fqsen": "\\brisko_excerpt\u0028\u0029", - "name": "brisko_excerpt", - "summary": "Displays\u0020an\u0020optional\u0020post\u0020excerpt.", - "url": "namespaces/default.html#function_brisko_excerpt" - }, { - "fqsen": "\\brisko_options\u0028\u0029", - "name": "brisko_options", - "summary": "Theme\u0020Options.", - "url": "namespaces/default.html#function_brisko_options" - }, { - "fqsen": "\\brisko_post_thumbnail\u0028\u0029", - "name": "brisko_post_thumbnail", - "summary": "Displays\u0020an\u0020optional\u0020post\u0020thumbnail.", - "url": "namespaces/default.html#function_brisko_post_thumbnail" - }, { - "fqsen": "\\brisko_footer\u0028\u0029", - "name": "brisko_footer", - "summary": "Footer.", - "url": "namespaces/default.html#function_brisko_footer" - }, { - "fqsen": "\\brisko_navigation\u0028\u0029", - "name": "brisko_navigation", - "summary": "Theme\u0020Navigation.", - "url": "namespaces/default.html#function_brisko_navigation" - }, { - "fqsen": "\\brisko_header\u0028\u0029", - "name": "brisko_header", - "summary": "Theme\u0020Header.", - "url": "namespaces/default.html#function_brisko_header" }, { "fqsen": "\\wp_body_open\u0028\u0029", "name": "wp_body_open", @@ -695,6 +600,11 @@ Search.appendIndex( "name": "brisko_widgets_init", "summary": "Register\u0020widget\u0020area.", "url": "classes/Brisko-Setup-Activate.html#method_brisko_widgets_init" + }, { + "fqsen": "\\Brisko\\Setup\\Activate\u003A\u003Aadd_support_block_template_parts\u0028\u0029", + "name": "add_support_block_template_parts", + "summary": "", + "url": "classes/Brisko-Setup-Activate.html#method_add_support_block_template_parts" }, { "fqsen": "\\Brisko\\Setup\\Assets", "name": "Assets", @@ -1155,6 +1065,111 @@ Search.appendIndex( "name": "adjust_color_component", "summary": "Adjust\u0020an\u0020RGB\u0020color\u0020component\u0020based\u0020on\u0020a\u0020lightness\u0020factor.", "url": "classes/Brisko-Palette.html#method_adjust_color_component" + }, { + "fqsen": "\\brisko_site_blocks_open\u0028\u0029", + "name": "brisko_site_blocks_open", + "summary": "", + "url": "namespaces/default.html#function_brisko_site_blocks_open" + }, { + "fqsen": "\\brisko\u0028\u0029", + "name": "brisko", + "summary": "Get\u0020the\u0020Brisko\u0020Theme.", + "url": "namespaces/default.html#function_brisko" + }, { + "fqsen": "\\brisko_posted_on\u0028\u0029", + "name": "brisko_posted_on", + "summary": "Prints\u0020HTML\u0020with\u0020meta\u0020information\u0020for\u0020the\u0020current\u0020post\u002Ddate\/time.", + "url": "namespaces/default.html#function_brisko_posted_on" + }, { + "fqsen": "\\brisko_posted_by\u0028\u0029", + "name": "brisko_posted_by", + "summary": "Prints\u0020HTML\u0020with\u0020meta\u0020information\u0020for\u0020the\u0020current\u0020author.", + "url": "namespaces/default.html#function_brisko_posted_by" + }, { + "fqsen": "\\brisko_entry_footer\u0028\u0029", + "name": "brisko_entry_footer", + "summary": "Prints\u0020HTML\u0020with\u0020meta\u0020information\u0020for\u0020the\u0020categories,\u0020tags\u0020and\u0020comments.", + "url": "namespaces/default.html#function_brisko_entry_footer" + }, { + "fqsen": "\\brisko_entry_meta\u0028\u0029", + "name": "brisko_entry_meta", + "summary": "Outputs\u0020the\u0020entry\u0020meta\u0020information\u0020for\u0020posts.", + "url": "namespaces/default.html#function_brisko_entry_meta" + }, { + "fqsen": "\\brisko_entry_content_css\u0028\u0029", + "name": "brisko_entry_content_css", + "summary": "Generates\u0020inline\u0020CSS\u0020for\u0020entry\u0020content\u0020based\u0020on\u0020theme\u0020settings.", + "url": "namespaces/default.html#function_brisko_entry_content_css" + }, { + "fqsen": "\\brisko_posts_navigation\u0028\u0029", + "name": "brisko_posts_navigation", + "summary": "Post\u0020Navigation.", + "url": "namespaces/default.html#function_brisko_posts_navigation" + }, { + "fqsen": "\\brisko_is_php5_6\u0028\u0029", + "name": "brisko_is_php5_6", + "summary": "Check\u0020if\u0020PHP\u00205.6.", + "url": "namespaces/default.html#function_brisko_is_php5_6" + }, { + "fqsen": "\\brisko_sidebar\u0028\u0029", + "name": "brisko_sidebar", + "summary": "Get\u0020the\u0020sidebar.", + "url": "namespaces/default.html#function_brisko_sidebar" + }, { + "fqsen": "\\brisko_layout_head\u0028\u0029", + "name": "brisko_layout_head", + "summary": "Head\u0020section.", + "url": "namespaces/default.html#function_brisko_layout_head" + }, { + "fqsen": "\\brisko_layout_sidebar\u0028\u0029", + "name": "brisko_layout_sidebar", + "summary": "Get\u0020the\u0020sidebar.", + "url": "namespaces/default.html#function_brisko_layout_sidebar" + }, { + "fqsen": "\\brisko_layout_footer\u0028\u0029", + "name": "brisko_layout_footer", + "summary": "Footer\u0020section.", + "url": "namespaces/default.html#function_brisko_layout_footer" + }, { + "fqsen": "\\brisko_layout_content\u0028\u0029", + "name": "brisko_layout_content", + "summary": "Display\u0020content\u0020only.", + "url": "namespaces/default.html#function_brisko_layout_content" + }, { + "fqsen": "\\brisko_excerpt\u0028\u0029", + "name": "brisko_excerpt", + "summary": "Displays\u0020an\u0020optional\u0020post\u0020excerpt.", + "url": "namespaces/default.html#function_brisko_excerpt" + }, { + "fqsen": "\\brisko_options\u0028\u0029", + "name": "brisko_options", + "summary": "Theme\u0020Options.", + "url": "namespaces/default.html#function_brisko_options" + }, { + "fqsen": "\\brisko_post_thumbnail\u0028\u0029", + "name": "brisko_post_thumbnail", + "summary": "Displays\u0020an\u0020optional\u0020post\u0020thumbnail.", + "url": "namespaces/default.html#function_brisko_post_thumbnail" + }, { + "fqsen": "\\brisko_footer\u0028\u0029", + "name": "brisko_footer", + "summary": "Footer.", + "url": "namespaces/default.html#function_brisko_footer" + }, { + "fqsen": "\\brisko_navigation\u0028\u0029", + "name": "brisko_navigation", + "summary": "Theme\u0020Navigation.", + "url": "namespaces/default.html#function_brisko_navigation" + }, { + "fqsen": "\\brisko_header\u0028\u0029", + "name": "brisko_header", + "summary": "Theme\u0020Header.", + "url": "namespaces/default.html#function_brisko_header" + }, { + "fqsen": "\\is_brisko_hybrid_fse\u0028\u0029", + "name": "is_brisko_hybrid_fse", + "summary": "", + "url": "namespaces/default.html#function_is_brisko_hybrid_fse" }, { "fqsen": "\\", "name": "\\", diff --git a/docs/code/namespaces/default.html b/docs/code/namespaces/default.html index c48d11f5..640fab1d 100644 --- a/docs/code/namespaces/default.html +++ b/docs/code/namespaces/default.html @@ -311,6 +311,13 @@

           : mixed +
          + +
          + wp_body_open() + +  : mixed +
          @@ -454,7 +461,7 @@

          Theme Header.
          - wp_body_open() + is_brisko_hybrid_fse()  : mixed
          @@ -1358,6 +1365,34 @@

          Return values
          + mixed + — + + +

        +
        +

        + wp_body_open() + +

        + + + + + + wp_body_open() : mixed + +
        + + + +
        Return values
        mixed — @@ -1370,9 +1405,9 @@

        @@ -1398,9 +1433,9 @@

        @@ -1410,9 +1445,7 @@

        brisko() : Brisko -

        Helper function to get the Bisko Theme Object.

        -
        - + @@ -1428,9 +1461,9 @@

        @@ -1456,9 +1489,9 @@

        @@ -1484,9 +1517,9 @@

        @@ -1512,9 +1545,9 @@

        @@ -1545,9 +1578,9 @@

        @@ -1579,9 +1612,9 @@

        @@ -1621,9 +1654,9 @@

        @@ -1649,9 +1682,9 @@

        @@ -1677,9 +1710,9 @@

        @@ -1715,9 +1748,9 @@

        @@ -1743,9 +1776,9 @@ @@ -1781,9 +1814,9 @@

        @@ -1813,9 +1846,9 @@

        @@ -1841,9 +1874,9 @@

        @@ -1883,9 +1916,9 @@

        @@ -1911,9 +1944,9 @@ @@ -1939,9 +1972,9 @@

        @@ -1969,9 +2002,9 @@

        @@ -1994,21 +2027,21 @@
        Return values
        -

        - wp_body_open() - +

        + is_brisko_hybrid_fse() +

        - wp_body_open() : mixed + is_brisko_hybrid_fse() : mixed
        diff --git a/docs/code/packages/Application.html b/docs/code/packages/Application.html index c6114b9c..d5823c8a 100644 --- a/docs/code/packages/Application.html +++ b/docs/code/packages/Application.html @@ -391,6 +391,13 @@

         : mixed +
        + +
        + wp_body_open() + +  : mixed +
        @@ -534,7 +541,7 @@

        Theme Header.
        - wp_body_open() + is_brisko_hybrid_fse()  : mixed
        @@ -1438,6 +1445,34 @@

        Return values
        + mixed + — + + +

        +
        +

        + wp_body_open() + +

        + + + + + + wp_body_open() : mixed + +
        + + + +
        Return values
        mixed — @@ -1450,9 +1485,9 @@

        @@ -1478,9 +1513,9 @@

        @@ -1490,9 +1525,7 @@

        brisko() : Brisko -

        Helper function to get the Bisko Theme Object.

        -
        - + @@ -1508,9 +1541,9 @@

        @@ -1536,9 +1569,9 @@

        @@ -1564,9 +1597,9 @@

        @@ -1592,9 +1625,9 @@

        @@ -1625,9 +1658,9 @@

        @@ -1659,9 +1692,9 @@

        @@ -1701,9 +1734,9 @@

        @@ -1729,9 +1762,9 @@

        @@ -1757,9 +1790,9 @@

        @@ -1795,9 +1828,9 @@

        @@ -1823,9 +1856,9 @@ @@ -1861,9 +1894,9 @@

        @@ -1893,9 +1926,9 @@

        @@ -1921,9 +1954,9 @@

        @@ -1963,9 +1996,9 @@

        @@ -1991,9 +2024,9 @@ @@ -2019,9 +2052,9 @@

        @@ -2049,9 +2082,9 @@

        @@ -2074,21 +2107,21 @@
        Return values
        -

        - wp_body_open() - +

        + is_brisko_hybrid_fse() +

        - wp_body_open() : mixed + is_brisko_hybrid_fse() : mixed
        diff --git a/src/Customize/Settings/Footer.php b/src/Customize/Settings/Footer.php index fb29b62e..9d93dc3e 100644 --- a/src/Customize/Settings/Footer.php +++ b/src/Customize/Settings/Footer.php @@ -23,7 +23,6 @@ public static function settings( $wp_customize ) // Footer Settings. ( new Control() )->separator( $wp_customize, esc_html__( 'Footer Settings', 'brisko' ), self::section() ); - if ( get_theme_mod( 'enable_hybrid_mode', false ) ) { self::info_note( $wp_customize, diff --git a/src/Customize/Settings/General.php b/src/Customize/Settings/General.php index 3b7e4440..53f6e8ef 100644 --- a/src/Customize/Settings/General.php +++ b/src/Customize/Settings/General.php @@ -101,7 +101,7 @@ public static function settings( $wp_customize ) // Link Color if ( ! is_brisko_hybrid_fse() ) { - self::global_link_color_settings(); + self::global_link_color_settings( $wp_customize ); } ( new Control() )->separator( $wp_customize, esc_html__( 'Other Settings', 'brisko' ), self::section() ); @@ -116,7 +116,6 @@ public static function settings( $wp_customize ) return; } - if ( ! is_brisko_hybrid_fse() ) { // Underline Content Links. $wp_customize->add_setting( diff --git a/src/Palette.php b/src/Palette.php index 6d0df677..b6d95867 100644 --- a/src/Palette.php +++ b/src/Palette.php @@ -21,7 +21,7 @@ public static function generate( string $base_hex, string $color_name ): array $base_hex = self::sanitize_hex( $base_hex ); // [$r, $g, $b] = self::hex_to_rgb( $base_hex ); - list($r, $g, $b) = self::hex_to_rgb( $base_hex ); + list($r, $g, $b) = self::hex_to_rgb( $base_hex ); $shades = [ 50 => 0.05, From f9695dc41c3cfcc7d5b5460779bc76f18c204398 Mon Sep 17 00:00:00 2001 From: devuri Date: Mon, 3 Mar 2025 23:20:36 -0500 Subject: [PATCH 17/17] chore: build --- src/Customize/Customizer.php | 4 +-- src/Customize/Settings/General.php | 48 ++++++++++++++++-------------- src/Setup/Styles.php | 9 ++++-- 3 files changed, 33 insertions(+), 28 deletions(-) diff --git a/src/Customize/Customizer.php b/src/Customize/Customizer.php index 69865a39..266925ac 100644 --- a/src/Customize/Customizer.php +++ b/src/Customize/Customizer.php @@ -77,7 +77,7 @@ public function build_customizer( $wp_customizer ) } // foreach General::settings( $this->customizer ); - if ( ! get_theme_mod( 'use_block_templates', false ) ) { + if ( ! is_brisko_hybrid_fse() ) { Layout::settings( $this->customizer ); Navigation::settings( $this->customizer ); Header::settings( $this->customizer ); @@ -87,7 +87,7 @@ public function build_customizer( $wp_customizer ) } Advanced::settings( $this->customizer ); - if ( ! get_theme_mod( 'use_block_templates', false ) ) { + if ( ! is_brisko_hybrid_fse() ) { SelectiveRefresh::settings( $this->customizer ); } diff --git a/src/Customize/Settings/General.php b/src/Customize/Settings/General.php index 53f6e8ef..b2f2432a 100644 --- a/src/Customize/Settings/General.php +++ b/src/Customize/Settings/General.php @@ -228,7 +228,7 @@ protected static function hybrid_mode_settings( $wp_customize ) ) ); - if ( ! get_theme_mod( 'enable_hybrid_mode', false ) ) { + if ( ! is_brisko_hybrid_fse() ) { // FSE Layouts $wp_customize->add_setting( 'enable_fse_layout', @@ -246,7 +246,7 @@ protected static function hybrid_mode_settings( $wp_customize ) 'enable_fse_layout', [ 'label' => esc_html__( 'Enable FSE Layouts', 'brisko' ), - 'description' => esc_html__( 'Sets up support for full width etc.', 'brisko' ), + 'description' => esc_html__( 'Sets up support for full width etc, (custom styles required).', 'brisko' ), 'section' => self::section(), 'type' => 'light', // light, ios, flat. @@ -255,29 +255,31 @@ protected static function hybrid_mode_settings( $wp_customize ) ); } - // Custom Styles - $wp_customize->add_setting( - 'use_custom_styles', - [ - 'default' => false, - 'capability' => self::$capability, - 'transport' => self::$transport, - 'sanitize_callback' => 'brisko_sanitize_checkbox', - ] - ); - - $wp_customize->add_control( - new ToggleControl( - $wp_customize, + if ( ! is_brisko_hybrid_fse() ) { + // Custom Styles + $wp_customize->add_setting( 'use_custom_styles', [ - 'label' => esc_html__( 'Enable Custom Styles', 'brisko' ), - 'description' => esc_html__( 'Custom Styles, may not be needed in hybrid theme mode or FSE mode.', 'brisko' ), - 'section' => self::section(), - 'type' => 'light', - // light, ios, flat. + 'default' => false, + 'capability' => self::$capability, + 'transport' => self::$transport, + 'sanitize_callback' => 'brisko_sanitize_checkbox', ] - ) - ); + ); + + $wp_customize->add_control( + new ToggleControl( + $wp_customize, + 'use_custom_styles', + [ + 'label' => esc_html__( 'Enable Custom Styles', 'brisko' ), + 'description' => esc_html__( 'Custom Styles, may not be needed in hybrid theme mode or FSE mode.', 'brisko' ), + 'section' => self::section(), + 'type' => 'light', + // light, ios, flat. + ] + ) + ); + } } } diff --git a/src/Setup/Styles.php b/src/Setup/Styles.php index 52e2ca2d..20962682 100644 --- a/src/Setup/Styles.php +++ b/src/Setup/Styles.php @@ -47,7 +47,7 @@ public function custom_css() */ public function enqueue() { - if ( ! get_theme_mod( 'use_block_templates', false ) ) { + if ( ! is_brisko_hybrid_fse() ) { self::enqueue_style( 'milligram', 'enable_milligram' ); self::enqueue_style( 'uikit', 'enable_uikit' ); self::enqueue_style( 'underscores', 'enable_underscores', self::maybe() ); @@ -60,7 +60,7 @@ public function enqueue() self::enqueue_style( 'normalizer', self::maybe() ); } - if ( ! get_theme_mod( 'use_block_templates', false ) ) { + if ( ! is_brisko_hybrid_fse() ) { if ( get_theme_mod( 'use_custom_styles', false ) ) { wp_enqueue_style( 'custom-styles' ); } @@ -164,7 +164,10 @@ private function custom_styles() $custom_styles['tag_links'] = ".tags-links {text-transform: {$transform_tags};}"; $custom_styles['footer_background'] = ".site-footer {background-color: {$footer_background_color};}"; $custom_styles['footer_border_color'] = ".site-footer {border-color: {$footer_border_color};}"; - $custom_styles['fse_layouts'] = '.alignfull{margin-left:calc(50% - 50vw);margin-right:calc(50% - 50vw);max-width:100vw;width:100vw;overflow:hidden}.alignwide{max-width:90vw;margin-left:calc(50% - 39vw);margin-right:calc(50% - 39vw)}'; + + if ( false === $enable_fse_layout ) { + $custom_styles['fse_layouts'] = '.alignfull{margin-left:calc(50% - 50vw);margin-right:calc(50% - 50vw);max-width:100vw;width:100vw;overflow:hidden}.alignwide{max-width:90vw;margin-left:calc(50% - 39vw);margin-right:calc(50% - 39vw)}'; + } if ( false === $underline_post_links ) { $custom_styles['underline_body_links'] = 'body a{text-decoration: none;}';