From ca7e31023b335e72eac6ce2f280a11b98b672fee Mon Sep 17 00:00:00 2001 From: eugenesvk Date: Wed, 3 May 2023 22:17:20 +0700 Subject: Replace direct root rules with a root mixin in variables and include the variables root rules in the themes --- sass/_imports.scss | 2 +- sass/_variables.scss | 2 +- sass/abridge-auto.scss | 7 +++++-- sass/abridge-dark.scss | 7 +++++-- sass/abridge-light.scss | 7 +++++-- sass/abridge.scss | 7 +++++-- 6 files changed, 22 insertions(+), 10 deletions(-) diff --git a/sass/_imports.scss b/sass/_imports.scss index 5dfb5a8..b615533 100644 --- a/sass/_imports.scss +++ b/sass/_imports.scss @@ -13,7 +13,7 @@ */ // Config -@use "variables"; +@forward "variables" as var-*; // Includes - Sorted by importance/category (includes at top are needed most frequently) @use "include/document"; // html diff --git a/sass/_variables.scss b/sass/_variables.scss index 8ad0fa8..a45495a 100644 --- a/sass/_variables.scss +++ b/sass/_variables.scss @@ -118,7 +118,7 @@ $icon-sun: false !default;// light sun $font: "Roboto", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", "Noto Sans", Helvetica, Arial, sans-serif !default; $font-mono: ui-monospace, Menlo, Monaco, Consolas, "SF Mono", "Cascadia Mono", "Segoe UI Mono", "DejaVu Sans Mono", "Liberation Mono", "Roboto Mono", "Oxygen Mono", "Ubuntu Monospace", "Ubuntu Mono", "Source Code Pro", "Fira Mono", "Droid Sans Mono", "Courier New", Courier, monospace !default; -:root { +@mixin root { #{--ff}: $font; #{--fm}: $font-mono;//code diff --git a/sass/abridge-auto.scss b/sass/abridge-auto.scss index b212053..6db0963 100644 --- a/sass/abridge-auto.scss +++ b/sass/abridge-auto.scss @@ -1,8 +1,11 @@ @use "imports"; -@use "variables"; @use "syntax/syntax-abridge" as syntax; -@if variables.$syntax { +:root { + @include imports.var-root; +} + +@if imports.$var-syntax { :root { @include syntax.dark; } diff --git a/sass/abridge-dark.scss b/sass/abridge-dark.scss index 393d62f..8303026 100644 --- a/sass/abridge-dark.scss +++ b/sass/abridge-dark.scss @@ -1,8 +1,11 @@ @use "imports"; -@use "variables"; @use "syntax/syntax-abridge" as syntax; -@if variables.$syntax { +:root { + @include imports.var-root; +} + +@if imports.$var-syntax { @include syntax.dark; } diff --git a/sass/abridge-light.scss b/sass/abridge-light.scss index b2dd1ea..82ec159 100644 --- a/sass/abridge-light.scss +++ b/sass/abridge-light.scss @@ -1,8 +1,11 @@ @use "imports"; -@use "variables"; @use "syntax/syntax-abridge" as syntax; -@if variables.$syntax { +:root { + @include imports.var-root; +} + +@if imports.$var-syntax { @include syntax.light; } diff --git a/sass/abridge.scss b/sass/abridge.scss index 9790d69..e74ce28 100644 --- a/sass/abridge.scss +++ b/sass/abridge.scss @@ -1,8 +1,11 @@ @use "imports"; -@use "variables"; @use "syntax/syntax-abridge" as syntax; -@if variables.$syntax { +:root { + @include imports.var-root; +} + +@if imports.$var-syntax { :root:not(.light) { @include syntax.dark; } -- cgit v1.3.1