@onereach/styles 0.1.3 → 0.1.6

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 (35) hide show
  1. package/dist/index.css +525 -72
  2. package/dist/index.css.map +1 -1
  3. package/dist/index.min.css +1 -1
  4. package/package.json +2 -5
  5. package/src/base/_generic.scss +7 -13
  6. package/src/base/_reset.scss +15 -1
  7. package/src/base/_typography.scss +42 -0
  8. package/src/base/_v-transitions.scss +6 -2
  9. package/src/base/index.scss +1 -0
  10. package/src/components/base/_button.scss +119 -16
  11. package/src/components/base/_checkbox.scss +8 -11
  12. package/src/components/base/_collapse.scss +11 -0
  13. package/src/components/base/_error.scss +13 -0
  14. package/src/components/base/_hint.scss +13 -0
  15. package/src/components/base/_icon.scss +23 -3
  16. package/src/components/base/_label.scss +14 -0
  17. package/src/components/base/_list.scss +44 -0
  18. package/src/components/base/_loader.scss +79 -5
  19. package/src/components/base/_radio-group.scss +5 -4
  20. package/src/components/base/_radio.scss +11 -18
  21. package/src/components/base/_switch.scss +11 -16
  22. package/src/components/base/_textbox.scss +242 -0
  23. package/src/layout/_display.scss +29 -0
  24. package/src/layout/_flexbox.scss +79 -0
  25. package/src/layout/_spacings.scss +29 -0
  26. package/src/layout/index.scss +3 -0
  27. package/src/main.scss +4 -3
  28. package/src/utils/mixins/_absolute-center.scss +6 -0
  29. package/src/utils/mixins/_has-error.scss +5 -0
  30. package/src/utils/mixins/_transition.scss +7 -0
  31. package/src/utils/mixins/index.scss +3 -0
  32. package/src/variables/_css-vars.scss +60 -9
  33. package/src/variables/_initial.scss +40 -0
  34. package/src/variables/index.scss +3 -2
  35. package/src/variables/tokens/design-tokens.scss +8 -12
@@ -1,14 +1,25 @@
1
1
  @use 'sass:map';
2
+ @use "../utils/functions/px-to-rem" as *;
3
+ @use "../utils/functions/get-transition-func" as *;
4
+ @use "../utils/functions/get-transition-time" as *;
5
+ @use "initial";
2
6
 
3
- @each $name, $theme in map.get($design-tokens, themes) {
7
+ // generate themes vars
8
+ @each $name, $theme in initial.$themesList {
4
9
  @if ($name == light) {
5
10
  :root,
6
11
  [data-theme=#{quote($name)}] {
7
12
  @each $color-key, $color-value in $theme {
8
- --c-#{$color-key + ""}: #{$color-value};
9
- --c-#{$color-key + ""}-lighten-20: #{lighten($color-value, 20%)};
10
- --c-#{$color-key + ""}-darken-3: #{darken($color-value, 3%)};
11
- --c-#{$color-key + ""}-darken-5: #{darken($color-value, 5%)};
13
+ @if ($color-key == white or $color-key == black or $color-key == body-bg) {
14
+ --c-#{$color-key + ""}: #{$color-value};
15
+ }
16
+
17
+ @else {
18
+ --c-#{quote($color-key)}: #{$color-value};
19
+ --c-#{quote($color-key)}-darken-3: #{darken($color-value, 3%)};
20
+ --c-#{quote($color-key)}-darken-5: #{darken($color-value, 5%)};
21
+ --c-#{quote($color-key)}-lighten-20: #{lighten($color-value, 20%)};
22
+ }
12
23
  }
13
24
  }
14
25
  }
@@ -16,11 +27,51 @@
16
27
  @else {
17
28
  [data-theme=#{quote($name)}] {
18
29
  @each $color-key, $color-value in $theme {
19
- --c-#{$color-key + ""}: #{$color-value};
20
- --c-#{$color-key + ""}-lighten-20: #{lighten($color-value, 20%)};
21
- --c-#{$color-key + ""}-darken-3: #{darken($color-value, 3%)};
22
- --c-#{$color-key + ""}-darken-5: #{darken($color-value, 5%)};
30
+ @if ($color-key == white or $color-key == black) {
31
+ --c-#{$color-key + ""}: #{$color-value};
32
+ }
33
+
34
+ @else {
35
+ --c-#{quote($color-key)}: #{$color-value};
36
+ --c-#{quote($color-key)}-darken-3: #{darken($color-value, 3%)};
37
+ --c-#{quote($color-key)}-darken-5: #{darken($color-value, 5%)};
38
+ --c-#{quote($color-key)}-lighten-20: #{lighten($color-value, 20%)};
39
+ }
23
40
  }
24
41
  }
25
42
  }
26
43
  }
44
+
45
+ :root {
46
+ // spacings
47
+ @each $value in initial.$spacingsValues {
48
+
49
+ $i: index(initial.$spacingsValues, $value) - 1;
50
+
51
+ --s-#{$i}: #{px-to-rem($value)};
52
+ }
53
+
54
+ --t-func: #{get-transition-func()};
55
+ --t-duration: #{get-transition-time()};
56
+
57
+ // font-sizes
58
+ @each $value in initial.$fontSizeValues {
59
+ $i: index(initial.$fontSizeValues, $value) - 1;
60
+
61
+ --fs-#{$i}: #{px-to-rem($value)};
62
+ }
63
+
64
+ // font-weights
65
+ @each $value in initial.$fontWeightValues {
66
+ $i: index(initial.$fontWeightValues, $value) - 1;
67
+
68
+ --fw-#{$i}: #{$value};
69
+ }
70
+
71
+ // line-heights
72
+ @each $value in initial.$lineHeightValues {
73
+ $i: index(initial.$lineHeightValues, $value) - 1;
74
+
75
+ --lh-#{$i}: #{px-to-rem($value)};
76
+ }
77
+ }
@@ -0,0 +1,40 @@
1
+ @use "sass:map";
2
+ @use "tokens/design-tokens" as *;
3
+
4
+ $themesList: map.get($design-tokens, themes) !default;
5
+ $spacingList: map.get($design-tokens, spacings) !default;
6
+ $fontSizeList: map.get($design-tokens, typography, font-sizes) !default;
7
+ $fontWeightList: map.get($design-tokens, typography, font-weights) !default;
8
+ $lineHeightList: map.get($design-tokens, typography, line-heights) !default;
9
+ //$colorsList: (primary, error, warning, success, neutral-0, neutral-1, neutral-2, neutral-3, neutral-4, neutral-5, neutral-6);
10
+
11
+ // list of values
12
+ $spacingsValues: map.values($spacingList);
13
+ $fontSizeValues: map.values($fontSizeList);
14
+ $fontWeightValues: map.values($fontWeightList);
15
+ $lineHeightValues: map.values($lineHeightList);
16
+
17
+ // typo
18
+ $body-font-family: -apple-system, "BlinkMacSystemFont", "Segoe UI", "Roboto", "Oxygen-Sans", "Ubuntu", "Cantarell", "Helvetica Neue", sans-serif !default;
19
+ $body-font-size: var(--fs-1) !default;
20
+ $body-font-weight: var(--fw-0) !default;
21
+ $body-line-height: var(--lh-1) !default;
22
+
23
+ $caption-font-size: var(--fs-0) !default;
24
+ $caption-font-weight: var(--fw-0) !default;
25
+ $caption-line-height: var(--lh-0) !default;
26
+
27
+ $subheading-font-size: var(--fs-2) !default;
28
+ $subheading-font-weight: var(--fw-2) !default;
29
+ $subheading-line-height: var(--lh-1) !default;
30
+
31
+ $heading-font-size: var(--fs-3) !default;
32
+ $heading-font-weight: var(--fw-2) !default;
33
+ $heading-line-height: var(--lh-2) !default;
34
+
35
+ // generic
36
+ $base-prefix: quote(base) !default;
37
+ $round: 9999px !default;
38
+
39
+ $transition-function: var(--t-func) !default;
40
+ $transition-duration: var(--t-duration) !default;
@@ -1,2 +1,3 @@
1
- @import "tokens/design-tokens";
2
- @import "css-vars";
1
+ @forward "tokens/design-tokens";
2
+ @forward "css-vars";
3
+ @forward "initial";
@@ -39,36 +39,32 @@ $design-tokens: (
39
39
  error: #da1e28,
40
40
  warning: #f0d10d,
41
41
  success: #4ec00f,
42
- grey: #91969d,
43
- text: #1e232b,
44
- body-bg: #fff,
45
- white: #fff,
46
- black: #000,
47
42
  neutral-0: #fff,
48
43
  neutral-1: #f6f6f6,
49
44
  neutral-2: #dfdfdf,
50
45
  neutral-3: #c6c6c6,
51
46
  neutral-4: #91969d,
52
47
  neutral-5: #6c747d,
53
- neutral-6: #1e232b
48
+ neutral-6: #1e232b,
49
+ body-bg: #fff,
50
+ white: #fff,
51
+ black: #000
54
52
  ),
55
53
  dark: (
56
54
  primary: #178ae7,
57
55
  error: #da1e28,
58
56
  warning: #f0d10d,
59
57
  success: #4ec00f,
60
- grey: #91969d,
61
- c-text: #1e232b,
62
- c-body-bg: #fff,
63
- white: #fff,
64
- black: #000,
65
58
  neutral-0: #fff,
66
59
  neutral-1: #f6f6f6,
67
60
  neutral-2: #dfdfdf,
68
61
  neutral-3: #c6c6c6,
69
62
  neutral-4: #91969d,
70
63
  neutral-5: #6c747d,
71
- neutral-6: #1e232b
64
+ neutral-6: #1e232b,
65
+ c-body-bg: #fff,
66
+ white: #fff,
67
+ black: #000
72
68
  )
73
69
  )
74
70
  );