From 862b746f9ea1ce127a15e300e32d7580ba1cdfa9 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Wed, 23 Oct 2024 22:14:15 +0200 Subject: Use CSS layers --- src/scopes/_implicit.scss | 236 +++++++++++++++++++++++----------------------- 1 file changed, 119 insertions(+), 117 deletions(-) (limited to 'src/scopes') diff --git a/src/scopes/_implicit.scss b/src/scopes/_implicit.scss index c368072..18791a8 100644 --- a/src/scopes/_implicit.scss +++ b/src/scopes/_implicit.scss @@ -11,147 +11,149 @@ @mixin styles { @include materialize-at-root(meta.module-variables('vars')); - html { - accent-color: props.get(core.$theme, --accent, --600); - scrollbar-color: props.get(core.$theme, --text-disabled) transparent; - } + @layer scope { + html { + accent-color: props.get(core.$theme, --accent, --600); + scrollbar-color: props.get(core.$theme, --text-disabled) transparent; + } - html, - body { - block-size: 100%; - } + html, + body { + block-size: 100%; + } - body { - padding: 0; - margin: 0; - font-family: props.get(vars.$body--font-family); - font-size: props.get(vars.$body--font-size); - font-feature-settings: props.get(vars.$body--feature-settings); - line-height: props.get(vars.$body--line-height); - color: props.get(core.$theme, --text); - background-color: props.get(core.$theme, --bg-base); - } + body { + padding: 0; + margin: 0; + font-family: props.get(vars.$body--font-family); + font-size: props.get(vars.$body--font-size); + font-feature-settings: props.get(vars.$body--feature-settings); + line-height: props.get(vars.$body--line-height); + color: props.get(core.$theme, --text); + background-color: props.get(core.$theme, --bg-base); + } - pre, - code { - font-family: props.get(vars.$code--font-family); - font-size: props.get(vars.$code--font-size); - font-feature-settings: props.get(vars.$code--feature-settings); - line-height: props.get(vars.$code--line-height); - } + pre, + code { + font-family: props.get(vars.$code--font-family); + font-size: props.get(vars.$code--font-size); + font-feature-settings: props.get(vars.$code--feature-settings); + line-height: props.get(vars.$code--line-height); + } - pre { - margin: 0; - overflow-x: auto; + pre { + margin: 0; + overflow-x: auto; - code { - font-size: 1em; - color: currentColor; + code { + font-size: 1em; + color: currentColor; + } } - } - h1, - h2, - h3, - h4, - h5, - h6 { - margin-block: props.get(vars.$heading--margin-bs) 0; - font-family: props.get(vars.$heading--font-family); - font-size: props.get(vars.$heading--font-size); - font-weight: props.get(vars.$heading--font-weight); - font-feature-settings: props.get(vars.$heading--feature-settings); - line-height: props.get(vars.$heading--line-height); - color: props.get(vars.$heading--color); - - & + & { - margin-block-start: props.get(vars.$heading--margin-bs-sibling); + h1, + h2, + h3, + h4, + h5, + h6 { + margin-block: props.get(vars.$heading--margin-bs) 0; + font-family: props.get(vars.$heading--font-family); + font-size: props.get(vars.$heading--font-size); + font-weight: props.get(vars.$heading--font-weight); + font-feature-settings: props.get(vars.$heading--feature-settings); + line-height: props.get(vars.$heading--line-height); + color: props.get(vars.$heading--color); + + & + & { + margin-block-start: props.get(vars.$heading--margin-bs-sibling); + } } - } - p { - margin-block: props.get(vars.$paragraph--margin-bs) 0; + p { + margin-block: props.get(vars.$paragraph--margin-bs) 0; - &:empty { - display: none; + &:empty { + display: none; + } } - } - strong { - font-weight: bold; - } + strong { + font-weight: bold; + } - small { - font-size: props.get(vars.$small--font-size); - } + small { + font-size: props.get(vars.$small--font-size); + } - ul, - ol { - padding: 0; - margin: 0; - list-style: none; - } + ul, + ol { + padding: 0; + margin: 0; + list-style: none; + } - li { - padding: 0; - margin: 0; - } + li { + padding: 0; + margin: 0; + } - :focus, - :focus-visible { - outline: 0; - } + :focus, + :focus-visible { + outline: 0; + } - :link, - :visited { - color: currentColor; - text-decoration: none; - } + :link, + :visited { + color: currentColor; + text-decoration: none; + } - button, - input, - textarea { - box-sizing: content-box; - padding: 0; - margin: 0; - font-family: inherit; - font-size: 1em; - font-style: inherit; - font-weight: inherit; - line-height: inherit; - color: currentColor; - text-align: inherit; - text-transform: inherit; - appearance: none; - background: none; - border: 0; - - &::-moz-focus-inner { - border: 0; + button, + input, + textarea { + box-sizing: content-box; + padding: 0; + margin: 0; + font-family: inherit; + font-size: 1em; + font-style: inherit; + font-weight: inherit; + line-height: inherit; + color: currentColor; + text-align: inherit; + text-transform: inherit; + appearance: none; + background: none; + border: 0; + + &::-moz-focus-inner { + border: 0; + } } - } - input, - textarea { - &::placeholder { - color: props.get(core.$theme, --text-mute); - opacity: 1; - } + input, + textarea { + &::placeholder { + color: props.get(core.$theme, --text-mute); + opacity: 1; + } - &:disabled { - color: props.get(core.$theme, --text-disabled); + &:disabled { + color: props.get(core.$theme, --text-disabled); + } } - } - textarea { - block-size: calc(1em * props.get(core.$font--standard--line-height)); - } + textarea { + block-size: calc(1em * props.get(core.$font--standard--line-height)); + } - hr { - block-size: props.get(core.$border-width--thin); - margin: 0; - background-color: props.get(core.$theme, --border); - border: 0; + hr { + block-size: props.get(core.$border-width--thin); + margin: 0; + background-color: props.get(core.$theme, --border); + border: 0; + } } } -- cgit v1.2.3-70-g09d2