From edf687b4c1ac5b773509af77bf05d25e97f30825 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Wed, 16 Oct 2024 07:23:39 +0200 Subject: Put var application into mixin --- src/_apply-vars.scss | 17 ----------------- src/_declare-vars.scss | 16 ++++++++++++++++ src/index.scss | 4 ++-- 3 files changed, 18 insertions(+), 19 deletions(-) delete mode 100644 src/_apply-vars.scss (limited to 'src') diff --git a/src/_apply-vars.scss b/src/_apply-vars.scss deleted file mode 100644 index a2ee404..0000000 --- a/src/_apply-vars.scss +++ /dev/null @@ -1,17 +0,0 @@ -@use 'sass:map'; -@use 'iro-sass/src/index' as iro; -@use 'include-media/dist/include-media' as media; - -:root { - @include iro.props-assign; - - @each $breakpoint in map.keys(media.$breakpoints) { - @include media.media('<=#{$breakpoint}') { - @include iro.props-assign($breakpoint); - } - } - - @media (prefers-color-scheme: dark) { - @include iro.props-assign('dark'); - } -} diff --git a/src/_declare-vars.scss b/src/_declare-vars.scss index 0aa1cca..afe1e15 100644 --- a/src/_declare-vars.scss +++ b/src/_declare-vars.scss @@ -271,3 +271,19 @@ ), ), $tree); } + +@mixin apply-vars { + :root { + @include iro.props-assign; + + @each $breakpoint in map.keys(media.$breakpoints) { + @include media.media('<=#{$breakpoint}') { + @include iro.props-assign($breakpoint); + } + } + + @media (prefers-color-scheme: dark) { + @include iro.props-assign('dark'); + } + } +} diff --git a/src/index.scss b/src/index.scss index 50927e2..bae26bc 100644 --- a/src/index.scss +++ b/src/index.scss @@ -1,4 +1,4 @@ -@use 'declare-vars'; +@use 'declare-vars' as vars; @use 'base'; @use 'layouts'; @@ -7,4 +7,4 @@ @use 'themes'; @use 'utils'; -@use 'apply-vars'; +@include vars.apply-vars; -- cgit v1.2.3-70-g09d2