Initial commit

This commit is contained in:
Никита Круглицкий
2024-11-26 16:15:12 +03:00
commit b3c99a667a
97 changed files with 14314 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
@mixin mobile {
@media (max-width: 480px) {
@content;
}
}
@mixin desktop {
@media (min-width: 481px) {
@content;
}
}

View File

@@ -0,0 +1,48 @@
@use "sass:meta";
@use "sass:list";
@use "sass:string";
@mixin element-variant(
$namespace,
$variant: '',
$map: ()
) {
@if meta.type-of($map) == 'map' {
$withDarkVariant: false;
$variantPrefix: if(string.length($variant) > 0, '-' + $variant, '');
@at-root {
:root, .light-theme {
@each $property, $value in $map {
@if meta.type-of($value) == 'list' {
@if $withDarkVariant == false and list.length($value) > 1 {
$withDarkVariant: true;
}
$value: list.nth($value, 1);
}
--#{$namespace}#{$variantPrefix}-#{$property}: #{$value};
}
}
@if $withDarkVariant {
.dark-theme {
@each $property, $value in $map {
@if meta.type-of($value) == 'list' and list.length($value) > 1 {
--#{$namespace}#{$variantPrefix}-#{$property}: #{list.nth($value, 2)};
}
}
}
}
}
@if (string.length($variant) > 0) {
&-#{$variantPrefix} {
@each $property, $value in $map {
--#{$namespace}-#{$property}: var(--#{$namespace}#{$variantPrefix}-#{$property});
}
}
}
}
}

3
styles/mixins/index.scss Normal file
View File

@@ -0,0 +1,3 @@
@forward "element-variant";
@forward "typography";
@forward "adaptive";

View File

@@ -0,0 +1,17 @@
@mixin font($size, $weight, $lineHeight, $namespace: null, $onlyVars: false) {
@if ($namespace) {
@if ($onlyVars) {
--#{$namespace}-font-size: #{$size};
--#{$namespace}-font-weight: #{$weight};
--#{$namespace}-line-height: #{$lineHeight};
} @else {
font-size: var(--#{$namespace}-font-size, $size);
font-weight: var(--#{$namespace}-font-weight, $weight);
line-height: var(--#{$namespace}-line-height, $lineHeight);
}
} @else {
font-size: $size;
font-weight: $weight;
line-height: $lineHeight;
}
}