From b2732896dd5ddfec8b366eb123f1f8f281ee8e9c Mon Sep 17 00:00:00 2001 From: Sonny Le Date: Tue, 20 Feb 2024 16:37:37 +0700 Subject: [PATCH] Optimize SCSS configure --- .../library/astroid/Component/Utility.php | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/framework/library/astroid/Component/Utility.php b/framework/library/astroid/Component/Utility.php index d3cf2fbb..7ade5f7b 100644 --- a/framework/library/astroid/Component/Utility.php +++ b/framework/library/astroid/Component/Utility.php @@ -259,23 +259,25 @@ public static function colors() $body = new Style('body'); $body_dark = new Style('body', 'dark'); } - $body->addCss('background-color', $body_background_color['light']); - $body->addCss('color', $body_text_color['light']); - $body->link('child', ':not(.btn)')->addCss('color', $body_link_color['light']); - $body->link('child', ':not(.btn)')->hover()->addCss('color', $body_link_hover_color['light']); + $body->addCss('--bs-body-bg', $body_background_color['light']); + $body->addCss('--bs-body-color', $body_text_color['light']); + $body->link()->addCss('color', 'var(--as-link-color)'); + $body->link()->addCss('--as-link-color', $body_link_color['light']); + $body->link()->hover()->addCss('color', 'var(--as-link-hover-color)'); + $body->link()->hover()->addCss('--as-link-hover-color', $body_link_hover_color['light']); $body->render(); // render body colors - $body_dark->addCss('background-color', $body_background_color['dark']); - $body_dark->addCss('color', $body_text_color['dark']); - $body_dark->link('child', ':not(.btn)')->addCss('color', $body_link_color['dark']); - $body_dark->link('child', ':not(.btn)')->hover()->addCss('color', $body_link_hover_color['dark']); + $body_dark->addCss('--bs-body-bg', $body_background_color['dark']); + $body_dark->addCss('--bs-body-color', $body_text_color['dark']); + $body_dark->link()->addCss('--as-link-color', $body_link_color['dark']); + $body_dark->link()->hover()->addCss('--as-link-hover-color', $body_link_hover_color['dark']); $body_dark->render(); // render body colors $body = new Style(['h1','h2','h3','h4','h5','h6']); - $body->addCss('color', $body_heading_color['light']); + $body->addCss('--bs-heading-color', $body_heading_color['light']); $body->render(); $body = new Style(['h1','h2','h3','h4','h5','h6'], 'dark'); - $body->addCss('color', $body_heading_color['dark']); + $body->addCss('--bs-heading-color', $body_heading_color['dark']); $body->render(); // Header