@taraskucherenko/scss-kit 0.1.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/package.json +21 -0
  2. package/src/atoms/_borders.scss +15 -0
  3. package/src/atoms/_flex-layout.scss +30 -0
  4. package/src/atoms/_grid-layout.scss +61 -0
  5. package/src/atoms/_index.scss +12 -0
  6. package/src/atoms/_misc.scss +64 -0
  7. package/src/atoms/_position.scss +79 -0
  8. package/src/atoms/_sizes.scss +28 -0
  9. package/src/atoms/_spacing.scss +1 -0
  10. package/src/atoms/_theme.scss +9 -0
  11. package/src/atoms/_typography.scss +64 -0
  12. package/src/base/_reset.scss +195 -0
  13. package/src/functions/_fun-colors.scss +41 -0
  14. package/src/functions/_fun-converters.scss +9 -0
  15. package/src/functions/_fun-helpers.scss +22 -0
  16. package/src/functions/_fun-images.scss +17 -0
  17. package/src/functions/_fun-sizes.scss +6 -0
  18. package/src/functions/_fun-units.scss +16 -0
  19. package/src/functions/_index.scss +6 -0
  20. package/src/main.scss +5 -0
  21. package/src/mixins/_index.scss +11 -0
  22. package/src/mixins/_mix-borders.scss +57 -0
  23. package/src/mixins/_mix-fonts.scss +12 -0
  24. package/src/mixins/_mix-grid.scss +31 -0
  25. package/src/mixins/_mix-media.scss +54 -0
  26. package/src/mixins/_mix-position.scss +66 -0
  27. package/src/mixins/_mix-pseudo.scss +57 -0
  28. package/src/mixins/_mix-sizes.scss +58 -0
  29. package/src/mixins/_mix-spacing.scss +18 -0
  30. package/src/mixins/_mix-states.scss +39 -0
  31. package/src/mixins/_mix-theme.scss +54 -0
  32. package/src/mixins/_mix-typography.scss +23 -0
  33. package/src/variables/_index.scss +3 -0
  34. package/src/variables/_var-colors.scss +94 -0
  35. package/src/variables/_var-fonts.scss +3 -0
  36. package/src/variables/_var-sizes.scss +8 -0
@@ -0,0 +1,17 @@
1
+ $img-path: '../img' !default;
2
+
3
+ /// Generates image URL
4
+ /// @param {String} $url - Image filename
5
+ /// @param {String} $subfolder - Optional subfolder
6
+ /// @return {String} url() value
7
+ @function img-url($url, $subfolder: '') {
8
+ @if $subfolder != '' {
9
+ @return url('#{$img-path}/#{$subfolder}/#{$url}');
10
+ } @else {
11
+ @return url('#{$img-path}/#{$url}');
12
+ }
13
+ }
14
+
15
+ @function img-url-root($url) {@return img-url($url)}
16
+ @function img-url-svg($url) {@return img-url($url, 'svg')}
17
+ @function img-url-icons($url) {@return img-url($url, 'svg/icons')}
@@ -0,0 +1,6 @@
1
+ @use '../variables' as var;
2
+
3
+ @function col-width ($cols) {
4
+ @if $cols == 1 {@return var.$col-width}
5
+ @else {@return $cols * var.$col-width + ($cols - 1) * var.$col-gutter}
6
+ }
@@ -0,0 +1,16 @@
1
+ @use 'sass:math';
2
+
3
+ /// Returns value with unit or 0 without unit
4
+ /// @param {Number} $val - Value
5
+ /// @param {String} $unit - Unit type (rem, px, em, etc.)
6
+ /// @return {Number} Value with unit or 0
7
+ @function unit-or-zero($val, $unit: 'rem') {
8
+ @if $val == 0 {
9
+ @return 0;
10
+ } @else {
11
+ @return #{$val}#{$unit};
12
+ }
13
+ }
14
+
15
+ @function rem-or-zero($val) {@return unit-or-zero($val, $unit: 'rem')}
16
+ @function px-or-zero($val) {@return unit-or-zero($val, $unit: 'px')}
@@ -0,0 +1,6 @@
1
+ @forward 'fun-colors';
2
+ @forward 'fun-converters';
3
+ @forward 'fun-helpers';
4
+ @forward 'fun-images';
5
+ @forward 'fun-sizes';
6
+ @forward 'fun-units';
package/src/main.scss ADDED
@@ -0,0 +1,5 @@
1
+ @forward 'variables';
2
+ @forward 'functions';
3
+ @forward 'mixins';
4
+ @forward 'base/reset';
5
+ @forward 'atoms';
@@ -0,0 +1,11 @@
1
+ @forward 'mix-borders';
2
+ @forward 'mix-fonts';
3
+ @forward 'mix-grid';
4
+ @forward 'mix-media';
5
+ @forward 'mix-position';
6
+ @forward 'mix-pseudo';
7
+ @forward 'mix-sizes';
8
+ @forward 'mix-spacing';
9
+ @forward 'mix-states';
10
+ @forward 'mix-theme';
11
+ @forward 'mix-typography';
@@ -0,0 +1,57 @@
1
+ @use '../functions' as fun;
2
+
3
+ /// Border utility
4
+ /// @param {String} $side - Side: 't', 'r', 'b', 'l', or 'all'
5
+ /// @param {Color} $color - Border color
6
+ /// @param {Number} $width - Border thickness
7
+ /// @param {String} $style - Border style (solid, dashed, etc.)
8
+ /// @param {Boolean} $important - Add !important flag
9
+ @mixin border($side: all, $color: transparent, $width: 1px, $style: solid, $imp: false) {
10
+ @if $side == t {border-top: $width $style $color fun.important($imp)}
11
+ @else if $side == r {border-right: $width $style $color fun.important($imp)}
12
+ @else if $side == b {border-bottom: $width $style $color fun.important($imp)}
13
+ @else if $side == l {border-left: $width $style $color fun.important($imp)}
14
+ @else {border: $width $style $color fun.important($imp)}
15
+ }
16
+
17
+ /// Border radius utility
18
+ /// @param {String} $corner - Corner: 't', 'r', 'b', 'l', 'tl', 'tr', 'br', 'bl', 'tlbr', 'trbl', or 'all'
19
+ /// @param {Number} $radius - Radius value
20
+ /// @param {Boolean} $important - Add !important flag
21
+ @mixin border-radius($corner: all, $radius: 16px, $imp: false) {
22
+ @if $corner == t {border-radius: $radius $radius 0 0 fun.important($imp)}
23
+ @else if $corner == r {border-radius: 0 $radius $radius 0 fun.important($imp)}
24
+ @else if $corner == b {border-radius: 0 0 $radius $radius fun.important($imp)}
25
+ @else if $corner == l {border-radius: $radius 0 0 $radius fun.important($imp)}
26
+ @else if $corner == tl {border-radius: $radius 0 0 0 fun.important($imp)}
27
+ @else if $corner == tr {border-radius: 0 $radius 0 0 fun.important($imp)}
28
+ @else if $corner == br {border-radius: 0 0 $radius 0 fun.important($imp)}
29
+ @else if $corner == bl {border-radius: 0 0 0 $radius fun.important($imp)}
30
+ @else if $corner == tlbr {border-radius: $radius 0 $radius 0 fun.important($imp)}
31
+ @else if $corner == trbl {border-radius: 0 $radius 0 $radius fun.important($imp)}
32
+ @else {border-radius: $radius fun.important($imp)}
33
+ }
34
+
35
+ /// Horizontal divider (hr element styling)
36
+ /// @param {Number} $thickness - Line thickness
37
+ /// @param {Color} $color - Line color
38
+ @mixin divider-horizontal($thickness: 1px, $color: currentColor) {
39
+ background-color: $color;
40
+ border: 0;
41
+ width: 100%;
42
+ min-height: $thickness;
43
+ height: $thickness;
44
+ }
45
+
46
+ /// Vertical divider (hr element styling)
47
+ /// @param {Number} $thickness - Line thickness
48
+ /// @param {Color} $color - Line color
49
+ @mixin divider-vertical($thickness: 1px, $color: currentColor) {
50
+ display: inline-flex;
51
+ align-self: stretch;
52
+ background-color: $color;
53
+ border: 0;
54
+ min-width: $thickness;
55
+ width: $thickness;
56
+ height: auto;
57
+ }
@@ -0,0 +1,12 @@
1
+ @use '../variables' as var;
2
+
3
+ @mixin font($file-name, $weight, $family, $path: '../fonts') {
4
+ @font-face {
5
+ font-family: '#{$family}';
6
+ src: url('#{$path}/#{$file-name}.woff2') format('woff2');
7
+ font-weight: $weight;
8
+ font-display: swap;
9
+ font-style: normal;
10
+ text-rendering: optimizeLegibility;
11
+ }
12
+ }
@@ -0,0 +1,31 @@
1
+ @use '../variables' as var;
2
+
3
+ $row-gap: #{var.$col-gutter}px;
4
+
5
+ /// Flexbox grid with proper gap calculation
6
+ /// @param {Number} $columns - Number of columns
7
+ /// @param {Number} $gap - Gap between items
8
+ @mixin grid-flex($columns, $gap: $row-gap) {
9
+ @if $columns <= 0 {
10
+ @error 'Number of columns must be greater than zero';
11
+ }
12
+
13
+ > * {
14
+ $width: calc((100% - (#{$gap} * (#{$columns} - 1))) / #{$columns});
15
+
16
+ // Need to test
17
+ flex: 0 0 $width;
18
+ max-width: $width;
19
+ }
20
+ }
21
+
22
+ @mixin grid-sidebar($sidebar-width: 250px, $gap: 1rem, $position: left) {
23
+ display: grid;
24
+ gap: $gap;
25
+
26
+ @if $position == left {
27
+ grid-template-columns: $sidebar-width 1fr;
28
+ } @else {
29
+ grid-template-columns: 1fr $sidebar-width;
30
+ }
31
+ }
@@ -0,0 +1,54 @@
1
+ @mixin media-core($type, $value: 'max') {
2
+ @if $type == max {
3
+ @media screen and (max-width: #{$value}px) {@content}
4
+ }
5
+ @else if $type == min {
6
+ @media screen and (min-width: #{$value}px) {@content}
7
+ }
8
+ @else {
9
+ @warn "media-core(): `#{$type}` is not valid. Use `min` or `max`.";
10
+ }
11
+ }
12
+ @mixin media-between($min, $max) {
13
+ @media screen and (min-width: #{$min}px) and (max-width: #{$max}px) {@content}
14
+ }
15
+
16
+ @mixin media-max($value) {@include media-core('max', $value) {@content}}
17
+ @mixin media-min($value) {@include media-core('min', $value) {@content}}
18
+
19
+ // Desktop
20
+ @mixin media-d-1920 {@include media-max(1920) {@content}}
21
+ @mixin media-d-1660 {@include media-max(1660) {@content}}
22
+ @mixin media-d-1440 {@include media-max(1440) {@content}}
23
+ @mixin media-d-1360 {@include media-max(1360) {@content}}
24
+ @mixin media-d-1280 {@include media-max(1280) {@content}}
25
+
26
+ // Tablet
27
+ @mixin media-t-1024 {@include media-max(1024) {@content}}
28
+ @mixin media-t-960 {@include media-max(960) {@content}}
29
+ @mixin media-t-860 {@include media-max(860) {@content}}
30
+ @mixin media-t-768 {@include media-max(768) {@content}}
31
+
32
+ // Mobile
33
+ @mixin media-m-640 {@include media-max(640) {@content}}
34
+ @mixin media-m-540 {@include media-max(540) {@content}}
35
+ @mixin media-m-480 {@include media-max(480) {@content}}
36
+ @mixin media-m-425 {@include media-max(425) {@content}}
37
+ @mixin media-m-375 {@include media-max(375) {@content}}
38
+
39
+ @mixin media-print {@media print {@content}}
40
+ @mixin media-hover {@media (hover: hover) {@content}}
41
+ @mixin media-no-hover {@media (hover: none) {@content}}
42
+
43
+ @mixin media-landscape {@media (orientation: landscape) {@content}}
44
+ @mixin media-portrait {@media (orientation: portrait) {@content}}
45
+ @mixin media-retina {@media (min-resolution: 2dppx) {@content}}
46
+
47
+ @mixin media-dark {@media (prefers-color-scheme: dark) {@content}}
48
+ @mixin media-light {@media (prefers-color-scheme: light) {@content}}
49
+ @mixin media-reduce-motion {@media (prefers-reduced-motion: reduce) {@content}}
50
+
51
+ @mixin container($query) {@container #{$query} {@content}}
52
+ @mixin container-named($name, $query) {@container #{$name} #{$query} {@content}}
53
+ @mixin container-min($width) {@container (min-width: #{$width}px) {@content}}
54
+ @mixin container-max($width) {@container (max-width: #{$width}px) {@content}}
@@ -0,0 +1,66 @@
1
+ @mixin pos-center-x {
2
+ left: 50%;
3
+ transform: translateX(-50%);
4
+ }
5
+
6
+ @mixin pos-center-y {
7
+ top: 50%;
8
+ transform: translateY(-50%);
9
+ }
10
+
11
+ @mixin pos-center {
12
+ top: 50%;
13
+ left: 50%;
14
+ transform: translate(-50%, -50%);
15
+ }
16
+
17
+ // TODO: TEST AND LEFT ONLY USEFUL
18
+ // Center with margin auto (works for width-defined elements)
19
+ @mixin pos-center-margin {
20
+ position: absolute;
21
+ top: 0;
22
+ right: 0;
23
+ bottom: 0;
24
+ left: 0;
25
+ margin: auto;
26
+ }
27
+
28
+ // Center with inset (modern CSS)
29
+ @mixin pos-center-inset {
30
+ position: absolute;
31
+ inset: 0;
32
+ margin: auto;
33
+ }
34
+
35
+ // Center horizontal with inset
36
+ @mixin pos-center-x-inset {
37
+ position: absolute;
38
+ left: 0;
39
+ right: 0;
40
+ margin-left: auto;
41
+ margin-right: auto;
42
+ }
43
+
44
+ // Center vertical with inset
45
+ @mixin pos-center-y-inset {
46
+ position: absolute;
47
+ top: 0;
48
+ bottom: 0;
49
+ margin-top: auto;
50
+ margin-bottom: auto;
51
+ }
52
+
53
+ // Fill parent completely
54
+ @mixin pos-fill {
55
+ position: absolute;
56
+ top: 0;
57
+ right: 0;
58
+ bottom: 0;
59
+ left: 0;
60
+ }
61
+
62
+ // Or modern version
63
+ @mixin pos-fill-inset {
64
+ position: absolute;
65
+ inset: 0;
66
+ }
@@ -0,0 +1,57 @@
1
+ @mixin before($content: '') {&::before {content: $content;@content}}
2
+ @mixin after($content: '') {&::after {content: $content;@content}}
3
+ @mixin before-after {&::before, &::after {content: '';@content}}
4
+ @mixin marker($content: '') {&::marker {content: $content;@content}}
5
+
6
+ @mixin selection {&::selection {@content}} // Text selection styling
7
+ @mixin placeholder {&::placeholder {@content}} // Placeholder styling
8
+ @mixin backdrop {&::backdrop {@content}} // For <dialog> and modals
9
+ @mixin file-selector-button {&::file-selector-button {@content}} // input[type=file]
10
+
11
+ @mixin first-line {&::first-line {@content}}
12
+ @mixin first-letter {&::first-letter {@content}}
13
+
14
+ @mixin only-chi {&:only-child {@content}}
15
+ @mixin first-chi {&:first-child {@content}}
16
+ @mixin last-chi {&:last-child {@content}}
17
+
18
+ @mixin not-only-chi {&:not(:only-child) {@content}}
19
+ @mixin not-first-chi {&:not(:first-child) {@content}}
20
+ @mixin not-last-chi {&:not(:last-child) {@content}}
21
+
22
+ @mixin first-chi-not-only {@include first-chi {@include not-only-chi {@content}}}
23
+ @mixin last-chi-not-only {@include last-chi {@include not-only-chi {@content}}}
24
+ @mixin not-first-chi-not-only {@include not-first-chi {@include not-only-chi {@content}}}
25
+ @mixin not-last-chi-not-only {@include not-last-chi {@include not-only-chi {@content}}}
26
+
27
+ @mixin nth-odd {&:nth-child(odd) {@content}}
28
+ @mixin nth-even {&:nth-child(even) {@content}}
29
+ @mixin nth-chi($val) {&:nth-child(#{$val}) {@content}}
30
+
31
+ @mixin first-of-type {&:first-of-type {@content}}
32
+ @mixin last-of-type {&:last-of-type {@content}}
33
+ @mixin only-of-type {&:only-of-type {@content}}
34
+
35
+ @mixin not-first-of-type {&:not(:first-of-type) {@content}}
36
+ @mixin not-last-of-type {&:not(:last-of-type) {@content}}
37
+ @mixin not-only-of-type {&:not(:only-of-type) {@content}}
38
+
39
+ @mixin nth-of-type($n) {&:nth-of-type(#{$n}) {@content}}
40
+ @mixin nth-last-of-type($n) {&:nth-last-of-type(#{$n}) {@content}}
41
+
42
+ @mixin has($selector) {&:has(#{$selector}) {@content}} // New CSS selector, only supported in Chromium
43
+ @mixin parent-hover($sel) {#{$sel}:hover & {@content}} // Child reacts to parent hover
44
+
45
+ @mixin empty {&:empty {@content}}
46
+ @mixin not-empty {&:not(:empty) {@content}}
47
+ @mixin root {&:root {@content}}
48
+
49
+ @mixin dir-rtl {[dir='rtl'] & {@content}}
50
+ @mixin dir-ltr {[dir='ltr'] & {@content}}
51
+
52
+ @mixin autofill {&:-webkit-autofill, &:autofill {@content}}
53
+ @mixin indeterminate {&:indeterminate {@content}}
54
+ @mixin in-range {&:in-range {@content}}
55
+ @mixin out-of-range {&:out-of-range {@content}}
56
+ @mixin read-write {&:read-write {@content}}
57
+ @mixin target {&:target {@content}}
@@ -0,0 +1,58 @@
1
+ @use '../functions' as fun;
2
+
3
+ @mixin core-size($prefix: '', $prop: 'width', $val: null, $unit: 'rem', $imp: false) {
4
+ @if $val != null and $val >= 0 {
5
+ #{$prefix}#{$prop}: fun.unit-or-zero($val, $unit) fun.important($imp)
6
+ }
7
+ }
8
+
9
+ @mixin maw($val, $imp: false) {@include core-size($prefix: 'max-', $val: $val, $imp: $imp)}
10
+ @mixin miw($val, $imp: false) {@include core-size($prefix: 'min-', $val: $val, $imp: $imp)}
11
+ @mixin w($val, $imp: false) {@include miw($val, $imp);@include core-size($val: $val, $imp: $imp)}
12
+
13
+ @mixin mah($val, $imp: false) {@include core-size($prefix: 'max-', $prop: 'height', $val: $val, $imp: $imp)}
14
+ @mixin mih($val, $imp: false) {@include core-size($prefix: 'min-', $prop: 'height', $val: $val, $imp: $imp)}
15
+ @mixin h($val, $imp: false) {@include mih($val, $imp);@include core-size($prop: 'height', $val: $val, $imp: $imp)}
16
+
17
+ @mixin mih-vh($val: 100, $imp: false) {
18
+ min-height: #{$val}vh fun.important($imp);
19
+
20
+ @supports (min-height: #{$val}dvh) {
21
+ min-height: #{$val}dvh fun.important($imp);
22
+ }
23
+ }
24
+
25
+ @mixin mah-vh($val: 100, $imp: false) {
26
+ max-height: #{$val}vh fun.important($imp);
27
+
28
+ @supports (max-height: #{$val}dvh) {
29
+ max-height: #{$val}dvh fun.important($imp);
30
+ }
31
+ }
32
+
33
+ @mixin h-vh($val: 100, $imp: false) {
34
+ height: #{$val}vh fun.important($imp);
35
+
36
+ @supports (height: #{$val}dvh) {
37
+ height: #{$val}dvh fun.important($imp);
38
+ }
39
+ }
40
+
41
+ @mixin maw-col($val, $imp: false) {
42
+ max-width: fun.px-to-rem(fun.col-width($val)) fun.important($imp);
43
+ width: 100% fun.important($imp);
44
+ }
45
+ @mixin maw-col-auto($imp: false) {
46
+ max-width: 100% fun.important($imp);
47
+ width: auto fun.important($imp);
48
+ }
49
+ @mixin miw-col($val, $imp: false) {min-width: fun.px-to-rem(fun.col-width($val)) fun.important($imp)}
50
+ @mixin miw-col-auto($imp: false) {min-width: 1px fun.important($imp)}
51
+
52
+ @mixin square($val, $imp: false) {
53
+ flex: 0 0 fun.rem-or-zero($val) fun.important($imp);
54
+ @include miw($val, $imp);
55
+ @include core-size($val: $val, $imp: $imp);
56
+ @include mih($val, $imp);
57
+ @include core-size($prop: 'height', $val: $val, $imp: $imp)
58
+ }
@@ -0,0 +1,18 @@
1
+ @use '../functions' as fun;
2
+
3
+ @mixin spacing($prop: 'margin', $all: null, $t: null, $r: null, $b: null, $l: null, $imp: false) {
4
+ @if $all != null {#{$prop}: fun.rem-or-zero($all) fun.important($imp)}
5
+ @if $t != null {#{$prop}-top: fun.rem-or-zero($t) fun.important($imp)}
6
+ @if $r != null {#{$prop}-right: fun.rem-or-zero($r) fun.important($imp)}
7
+ @if $b != null {#{$prop}-bottom: fun.rem-or-zero($b) fun.important($imp)}
8
+ @if $l != null {#{$prop}-left: fun.rem-or-zero($l) fun.important($imp)}
9
+ }
10
+
11
+ @mixin margin-v($val, $imp: false) {@include spacing($t: $val, $b: $val, $imp: $imp)}
12
+ @mixin margin-h($val, $imp: false) {@include spacing($r: $val, $l: $val, $imp: $imp)}
13
+
14
+ @mixin padding-v($val, $imp: false) {@include spacing($prop: 'padding', $t: $val, $b: $val, $imp: $imp)}
15
+ @mixin padding-h($val, $imp: false) {@include spacing($prop: 'padding', $r: $val, $l: $val, $imp: $imp)}
16
+
17
+ @mixin gap-v($val, $imp: false) {row-gap: fun.rem-or-zero($val) fun.important($imp)}
18
+ @mixin gap-h($val, $imp: false) {column-gap: fun.rem-or-zero($val) fun.important($imp)}
@@ -0,0 +1,39 @@
1
+ @mixin hover {&:hover {@content}}
2
+ @mixin focus {&:focus {@content}}
3
+ @mixin hover-focus {&:hover, &:focus-visible {@content}}
4
+ @mixin not-readonly {&:not([readonly]) {@content}}
5
+ @mixin readonly {&[readonly] {@content}}
6
+ @mixin not-hidden {&:not([hidden]) {@content}}
7
+ @mixin hidden {&[hidden] {@content}}
8
+ @mixin not-disabled {&:not(:disabled):not([disabled]):not(.--disabled) {@content}}
9
+ @mixin disabled {&:disabled, &[disabled], &.--disabled {@content}}
10
+ @mixin not-click {&:not(:active) {@content}}
11
+ @mixin click {&:active {@content}}
12
+ @mixin not-active {&:not(.--active) {@content}}
13
+ @mixin active {&.--active {@content}}
14
+ @mixin if-href {&[href]:not([href='']) {@content}}
15
+ @mixin if-current {&.--current, &[aria-current]:not([aria-current='']):not([aria-current=false]) {@content}}
16
+ @mixin if-not-current {&:not(.--current):not([aria-current]), &[aria-current=''], &[aria-current=false] {@content}}
17
+ @mixin if-checked {&:checked, &[aria-checked]:not([aria-checked='']):not([aria-checked=false]) {@content}}
18
+ @mixin if-not-checked {&[aria-checked=''], &[aria-checked=false] {@content}}
19
+ @mixin if-selected {&[aria-selected]:not([aria-selected='']):not([aria-selected=false]) {@content}}
20
+ @mixin if-not-selected {&:not([aria-selected]) {@content}}
21
+
22
+ @mixin focus-visible {&:focus-visible {@content}} // support visible focus
23
+ @mixin focus-within {&:focus-within {@content}} // when any child has focus
24
+ @mixin hover-visible {&:hover:focus-visible {@content}} // for accessibility-aware hover
25
+
26
+ @mixin if-expanded {&[aria-expanded='true'] {@content}}
27
+ @mixin if-not-expanded {&[aria-expanded='false'], &:not([aria-expanded]) {@content}}
28
+
29
+ @mixin if-pressed {&[aria-pressed='true'] {@content}}
30
+ @mixin if-not-pressed {&[aria-pressed='false'], &:not([aria-pressed]) {@content}}
31
+
32
+ @mixin if-required {&[required], &[aria-required='true'] {@content}}
33
+ @mixin if-invalid {&:invalid, &[aria-invalid='true'] {@content}}
34
+ @mixin if-valid {&:valid, &[aria-invalid='false'] {@content}}
35
+
36
+ @mixin aria-expanded {&[aria-expanded='true'] {@content}}
37
+ @mixin aria-collapsed {&[aria-expanded='false'], &:not([aria-expanded]) {@content}}
38
+ @mixin aria-pressed {&[aria-pressed='true'] {@content}}
39
+ @mixin aria-not-pressed {&[aria-pressed='false'], &:not([aria-pressed]) {@content}}
@@ -0,0 +1,54 @@
1
+ @use '../variables' as var;
2
+
3
+ @mixin generate-palettes($isVars: false) {
4
+ @each $palette-name, $palette in var.$palette-colors {
5
+ @each $shade, $color in $palette {
6
+ $name: #{$palette-name}-#{$shade};
7
+
8
+ @if $isVars {
9
+ --col-#{$name}: #{$color};
10
+ } @else {
11
+ .bg-#{$name}, %bg-#{$name} {background-color: var(--col-#{$name})}
12
+ .fg-#{$name}, %fg-#{$name} {color: var(--col-#{$name})}
13
+ }
14
+ }
15
+ }
16
+ }
17
+
18
+ @mixin generate-semantic-colors($isVars: false) {
19
+ @each $name, $ref in var.$semantic-colors {
20
+ @if $isVars {
21
+ --col-#{$name}: var(--col-#{$ref});
22
+ } @else {
23
+ .bg-#{$name}, %bg-#{$name} {background-color: var(--col-#{$ref})}
24
+ .fg-#{$name}, %fg-#{$name} {color: var(--col-#{$ref})}
25
+ }
26
+ }
27
+ }
28
+
29
+ @keyframes rotating {
30
+ 0% {transform: rotate(0deg)}
31
+ 100% {transform: rotate(360deg)}
32
+ }
33
+
34
+ @keyframes indicator-width {
35
+ 0% {width: 0}
36
+ 100% {width: 100%}
37
+ }
38
+
39
+ @keyframes loading {
40
+ 0% {left: 0}
41
+ 50% {left: calc(100% - 15%)}
42
+ 100% {left: 0}
43
+ }
44
+
45
+ @keyframes bg-skeleton {
46
+ 0% {background-position: 0 0}
47
+ 100% {background-position: -135% 0}
48
+ }
49
+
50
+ @keyframes icon-translate {
51
+ 0% {transform: translateY(-0.125rem)}
52
+ 50% {transform: translateY(0.125rem)}
53
+ 100% {transform: translateY(0)}
54
+ }
@@ -0,0 +1,23 @@
1
+ @use 'sass:math';
2
+ @use '../variables' as var;
3
+ @use '../functions' as fun;
4
+ @use '../mixins/mix-media' as mix;
5
+
6
+ @mixin font-size($px) {font-size: fun.px-to-rem($px)}
7
+
8
+ @mixin fluid-font($max, $min) {
9
+ $maw: var.$page-width-max;
10
+ $miw: var.$page-width-min;
11
+
12
+ $font-scale: math.div($max - $min, $maw - $miw);
13
+
14
+ font-size: #{$min}px;
15
+
16
+ @include mix.media-min($miw) {
17
+ font-size: calc(#{$min}px + #{$font-scale} * (100vw - #{$miw}px));
18
+ }
19
+
20
+ @include mix.media-min($maw) {
21
+ font-size: #{$max}px;
22
+ }
23
+ }
@@ -0,0 +1,3 @@
1
+ @forward 'var-colors';
2
+ @forward 'var-fonts';
3
+ @forward 'var-sizes';
@@ -0,0 +1,94 @@
1
+ $palette-colors: (
2
+ 'gray': (
3
+ '50': #F2F3F5,
4
+ '100': #D9DBE0,
5
+ '200': #C2C5CB,
6
+ '300': #AAAFB6,
7
+ '400': #9197A0,
8
+ '500': #797F89,
9
+ '600': #646970,
10
+ '700': #50545A,
11
+ '800': #3C3F44,
12
+ '900': #2A2C2F
13
+ ),
14
+ 'red': (
15
+ '50': #FEF2F2,
16
+ '100': #FEE2E2,
17
+ '200': #FECACA,
18
+ '300': #FCA5A5,
19
+ '400': #F87171,
20
+ '500': #EF4444,
21
+ '600': #DC2626,
22
+ '700': #B91C1C,
23
+ '800': #991B1B,
24
+ '900': #7F1D1D,
25
+ '950': #450A0A,
26
+ ),
27
+ 'orange': (
28
+ '50': #FFF7ED,
29
+ '100': #FFEDD5,
30
+ '200': #FED7AA,
31
+ '300': #FDBA74,
32
+ '400': #FB923C,
33
+ '500': #F97316,
34
+ '600': #EA580C,
35
+ '700': #C2410C,
36
+ '800': #9A3412,
37
+ '900': #7C2D12,
38
+ '950': #431407,
39
+ ),
40
+ 'yellow': (
41
+ '50': #FEFCE8,
42
+ '100': #FEF9C3,
43
+ '200': #FEF08A,
44
+ '300': #FDE047,
45
+ '400': #FACC15,
46
+ '500': #EAB308,
47
+ '600': #CA8A04,
48
+ '700': #A16207,
49
+ '800': #854D0E,
50
+ '900': #713F12,
51
+ '950': #422006,
52
+ ),
53
+ 'green': (
54
+ '50': #F0FDF4,
55
+ '100': #DCFCE7,
56
+ '200': #BBF7D0,
57
+ '300': #86EFAC,
58
+ '400': #4ADE80,
59
+ '500': #22C55E,
60
+ '600': #16A34A,
61
+ '700': #15803D,
62
+ '800': #166534,
63
+ '900': #14532D,
64
+ '950': #052E16,
65
+ ),
66
+ 'blue': (
67
+ '50': #E9F8FF,
68
+ '100': #D1F3FF,
69
+ '200': #9DE6FF,
70
+ '300': #5BE1FF,
71
+ '400': #21C9FF,
72
+ '500': #0096CC,
73
+ '600': #0083B3,
74
+ '700': #006F99,
75
+ '800': #005A7F,
76
+ '900': #004E66,
77
+ ),
78
+ ) !default;
79
+
80
+ $semantic-colors: (
81
+ 'overlay': 'black-0x66',
82
+ 'link': 'blue-800',
83
+ 'info': 'blue-500',
84
+ 'success': 'green-500',
85
+ 'warning': 'yellow-500',
86
+ 'error': 'red-500',
87
+ 'danger': 'red-700',
88
+ 'accent': 'blue-600',
89
+ 'accent-light': 'blue-400',
90
+ 'faded': 'gray-50',
91
+ 'pale': 'gray-100',
92
+ 'warm-gray': 'gray-200',
93
+ 'graphite': 'gray-500',
94
+ ) !default;
@@ -0,0 +1,3 @@
1
+ $font-family-default: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Roboto, Oxygen-Sans, Ubuntu, Cantarell, Verdana, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol' !default;
2
+ $font-plain: 'Plain' !default;
3
+ $font-titles: 'Titles' !default;
@@ -0,0 +1,8 @@
1
+ @use 'sass:math';
2
+
3
+ $page-width-max: 1440 !default;
4
+ $page-width-min: 320 !default;
5
+ $col-gutter: 20 !default;
6
+ $cols: 12 !default;
7
+ $content-width: $page-width-max - ($col-gutter * 2);
8
+ $col-width: math.div($content-width - $col-gutter * $cols - 1, $cols);