@medyll/cssfabric 0.1.0 → 0.1.1

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 (44) hide show
  1. package/lib/styles/core/box/box.css +756 -1842
  2. package/lib/styles/core/box/box.min.css +1 -1
  3. package/lib/styles/core/box/box.responsive.css +3757 -10552
  4. package/lib/styles/core/box/box.responsive.min.css +1 -1
  5. package/lib/styles/core/color/color.css +908 -266
  6. package/lib/styles/core/color/color.min.css +1 -1
  7. package/lib/styles/core/color/color.responsive.css +4011 -2368
  8. package/lib/styles/core/color/color.responsive.min.css +1 -1
  9. package/lib/styles/core/flex/flex.responsive.css +0 -126
  10. package/lib/styles/core/flex/flex.responsive.min.css +1 -1
  11. package/lib/styles/core/grid/grid.responsive.css +0 -121
  12. package/lib/styles/core/grid/grid.responsive.min.css +1 -1
  13. package/lib/styles/core/menu/menu.responsive.css +0 -81
  14. package/lib/styles/core/menu/menu.responsive.min.css +1 -1
  15. package/lib/styles/core/overflow/overflow.responsive.css +0 -61
  16. package/lib/styles/core/overflow/overflow.responsive.min.css +1 -1
  17. package/lib/styles/core/scale/scale.css +286 -206
  18. package/lib/styles/core/scale/scale.min.css +1 -1
  19. package/lib/styles/core/scale/scale.responsive.css +1157 -1478
  20. package/lib/styles/core/scale/scale.responsive.min.css +1 -1
  21. package/lib/styles/core/table/table.responsive.css +0 -74
  22. package/lib/styles/core/table/table.responsive.min.css +1 -1
  23. package/lib/styles/core/text/text.css +4 -0
  24. package/lib/styles/core/text/text.responsive.css +0 -549
  25. package/lib/styles/core/text/text.responsive.min.css +1 -1
  26. package/lib/styles/core/vars.css +261 -125
  27. package/lib/styles/core/vars.min.css +1 -1
  28. package/lib/styles/cssfabric.css +2626 -2850
  29. package/lib/styles/cssfabric.min.css +4 -4
  30. package/lib/styles/cssfabric.responsive.css +10959 -17444
  31. package/lib/styles/cssfabric.responsive.min.css +9 -9
  32. package/package.json +1 -1
  33. package/src/_generated/export.variables.json +77 -78
  34. package/src/cssfabric/_utils.scss +22 -12
  35. package/src/cssfabric/modules/_cssfabric-config.scss +87 -17
  36. package/src/cssfabric/modules/box/_box-build.scss +103 -84
  37. package/src/cssfabric/modules/box/_box-vars.scss +48 -46
  38. package/src/cssfabric/modules/color/_color-build.scss +108 -24
  39. package/src/cssfabric/modules/scale/_scale-build.scss +26 -13
  40. package/src/cssfabric/modules/scale/_scale-vars.scss +50 -51
  41. package/src/cssfabric/modules/text/_text-build.scss +60 -3
  42. package/src/cssfabric/modules/text/text-responsive.scss +1 -0
  43. package/src/cssfabric/modules/theme/_theme-build.scss +27 -10
  44. package/src/cssfabric/modules/vars.scss +19 -86
@@ -1,28 +1,48 @@
1
1
  @use '../../utils';
2
+ @use "../cssfabric-config";
2
3
 
4
+ $scale-sizes-config: (
5
+ full: 100%,
6
+ mid: 50%,
7
+ quarter: 25%,
8
+ tiers: 33%
9
+ );
10
+ $scale-content-config: (
11
+ content-max: max-content,
12
+ content-min: min-content
13
+ );
14
+
15
+ $scale-sizes-preset-config: (
16
+ tiny: 2,
17
+ small: 4,
18
+ medium: 8,
19
+ large: 16,
20
+ wide: 32,
21
+ );
22
+
23
+ $scale-grid-ratios-config: (16);
24
+
25
+ $scale-defined-steps: (
26
+ 1,
27
+ 2,
28
+ 4,
29
+ 8,
30
+ 16,
31
+ 24,
32
+ 32,
33
+ 48,
34
+ 64
35
+ );
36
+
37
+ $scale-shorthands: (
38
+ width: cssfabric-config.$scale-tag-width-shorthand,
39
+ height: cssfabric-config.$scale-tag-height-shorthand
40
+ );
3
41
 
4
42
  $_cssProps: (
5
- size: (
6
- full: 100%,
7
- mid: 50%,
8
- quarter: 25%,
9
- tiers: 33%
10
- ),
11
- content:(
12
- content-max: max-content,
13
- content-min: min-content
14
- ),
15
- defined-steps: (
16
- 1,
17
- 2,
18
- 4,
19
- 8,
20
- 16,
21
- 24,
22
- 32,
23
- 48,
24
- 64
25
- )
43
+ size: $scale-sizes-config,
44
+ content:$scale-content-config,
45
+ defined-steps: $scale-defined-steps
26
46
  );
27
47
 
28
48
  $scale-metadata: (
@@ -31,31 +51,11 @@ $scale-metadata: (
31
51
  description: "cssfabric scale module to set dimensions and ratios on all html elements"
32
52
  );
33
53
 
34
- $scale-config: (
35
- weight-config: 1em,
36
- unit-tag-config: (
37
- width: w,
38
- height: h
39
- ),
40
- grid-ratios-config: (
41
- 5,
42
- 12
43
- ),
44
- defined-step-size: 2,
45
- defined-step-unit: rem,
46
- defined-steps: (
47
- 1,
48
- 2,
49
- 4,
50
- 8,
51
- 16,
52
- 24,
53
- 32,
54
- 48,
55
- 64
56
- ),
57
- cssProps:$_cssProps
58
- );
54
+ $scale-font-weight-config: 1em;
55
+ $scale-grid-ratios-config: $scale-grid-ratios-config;
56
+ $scale-defined-step-size: 2;
57
+ $scale-defined-step-unit: rem;
58
+ $scale-grid-ratios-config: $scale-grid-ratios-config;
59
59
 
60
60
 
61
61
  $scale-docs: (
@@ -64,11 +64,10 @@ $scale-docs: (
64
64
  tag: scale,
65
65
  keys: (w, h),
66
66
  levels:(
67
- _size : utils.getObjectKeys(map-get($_cssProps, size)),
68
- _content: utils.getObjectKeys(map-get($_cssProps, content)),
69
- _defined-steps: utils.getObjectKeys(map-get($_cssProps, defined-steps)),
70
- _grid-5: utils.getObjectKeys(utils.cssDimensionPropertyBuilder(h, 5)),
71
- _grid-12: utils.getObjectKeys(utils.cssDimensionPropertyBuilder(h, 12))
67
+ _size : utils.getObjectKeys($scale-sizes-config),
68
+ _content: utils.getObjectKeys($scale-content-config),
69
+ _defined-steps: utils.getObjectKeys($scale-defined-steps),
70
+ _grid-16: utils.getObjectKeys(utils.cssDimensionPropertyBuilder(h, 16)),
72
71
  )
73
72
  )
74
73
  )
@@ -53,25 +53,45 @@ $step-size: math.div($size-diff, $steps);
53
53
  }
54
54
  }
55
55
 
56
+
57
+ }
58
+
59
+ @mixin textBuildTransform($tag_short) {
56
60
  .#{$tag_short} {
57
61
  @each $fabricRule, $value in $textTransform {
58
62
  @include utils.fabricAttributes("&" + $sep, $fabricRule, "text-transform", $value);
59
63
  }
64
+ }
65
+ }
60
66
 
67
+ @mixin textBuildAlign($tag_short) {
68
+ .#{$tag_short} {
61
69
  @each $fabricRule, $value in $textAlign {
62
70
  @include utils.fabricAttributes("&" + $sep, $fabricRule, "text-align", $value);
63
71
  }
72
+ }
73
+ }
64
74
 
75
+ @mixin textBuildFontWeight($tag_short) {
76
+ .#{$tag_short} {
65
77
  @each $fabricRule, $value in $fontWeight {
66
78
  @include utils.fabricAttributes("&" + $sep, $fabricRule, "font-weight", var(--font-weight-#{$fabricRule}));
67
79
  }
80
+ }
81
+ }
68
82
 
69
- // text shadows color_schemes
83
+ @mixin textBuildShadowColorScheme($tag_short) {
84
+ // text shadows color_schemes
85
+ .#{$tag_short} {
70
86
  @each $fabricRule, $value in $color-schemes {
71
- @include utils.fabricAttributes("&" + $sep + shad + $sep, $fabricRule, "text-shadow", var(--text-shadow-#{$fabricRule}));
87
+ @include utils.fabricAttributes("&" + $sep + shad + $sep, $fabricRule, "text-shadow", var(--text-shadow-#{$fabricRule}));
72
88
  }
89
+ }
90
+ }
73
91
 
74
- // text shadows color_palette_props
92
+ @mixin textBuildShadowPalette($tag_short) {
93
+ // text shadows color_palette_props
94
+ .#{$tag_short} {
75
95
  @each $fabricRule, $value in $color-palette-props {
76
96
  @include utils.fabricAttributes("&" + $sep+ shad + $sep, $fabricRule, "text-shadow", var(--text-shadow-#{$fabricRule}));
77
97
  }
@@ -106,4 +126,41 @@ $step-size: math.div($size-diff, $steps);
106
126
  $property_key: if($mq_size_key, #{$moduleNameShort}-#{$mq_size_key}, #{$moduleNameShort});
107
127
 
108
128
  @include fabric_text($property_key);
129
+
130
+ @if ($mq_size_key == null) {
131
+ @if (cssfabric-config.$has-text-transform) {
132
+ @include textBuildTransform($property_key)
133
+ }
134
+ @if (cssfabric-config.$has-text-align) {
135
+ @include textBuildAlign($property_key)
136
+ }
137
+ @if (cssfabric-config.$has-text-font) {
138
+ @include textBuildFontWeight($property_key)
139
+ }
140
+ @if (cssfabric-config.$has-text-shadow-color-scheme) {
141
+ @include textBuildShadowColorScheme($property_key)
142
+ }
143
+ @if (cssfabric-config.$has-text-shadow-color-palette) {
144
+ @include textBuildShadowPalette($property_key)
145
+ }
146
+ }
147
+
148
+ @if ($mq_size_key != null) {
149
+ @if (cssfabric-config.$has-text-transform-responsive) {
150
+ @include textBuildTransform($property_key)
151
+ }
152
+ @if (cssfabric-config.$has-text-align-responsive) {
153
+ @include textBuildAlign($property_key)
154
+ }
155
+ @if (cssfabric-config.$has-text-font-responsive) {
156
+ @include textBuildFontWeight($property_key)
157
+ }
158
+ @if (cssfabric-config.$has-text-shadow-color-scheme-responsive) {
159
+ @include textBuildShadowColorScheme($property_key)
160
+ }
161
+ @if (cssfabric-config.$has-text-shadow-color-palette-responsive) {
162
+ @include textBuildShadowPalette($property_key)
163
+ }
164
+ }
165
+
109
166
  }
@@ -20,6 +20,7 @@ $mq_size_value in $_media_quey_sizes {
20
20
  @include utils.fabricResponsiveEncloser($mq_size_value,$min_value) {
21
21
  @include build.buildText($mq_size_key);
22
22
  }
23
+
23
24
  $min_value: $mq_size_value;
24
25
  }
25
26
 
@@ -3,6 +3,7 @@
3
3
  @use "../../_utils";
4
4
  @use "sass:color";
5
5
 
6
+ $config: cssfabric-config.$cssfabric-config;
6
7
  $theme-config: theme-vars.$theme-config;
7
8
 
8
9
  // COLOR THEME
@@ -18,18 +19,22 @@ $color-tertiary: map-get($color-themes, tertiary);
18
19
 
19
20
  $declinations-config: map-get($theme-config, declinations-config);
20
21
 
22
+ $themes: map-get($config, themes) !default;
23
+ $theme-light: map-get($themes, light) !default;
24
+ $theme-dark: map-get($themes, dark) !default;
25
+
21
26
  @mixin fabric_theme($mq_size_key: null) {
22
- // loop on each color grades
27
+ // loop on each color grades primary secondary tertiary
23
28
  @each $color-grade in $declinations-config {
24
-
29
+ // text, bg, border
25
30
  @each $text-or-bg-or-border in $theme-properties-apply-config {
26
31
  $property_key: if($mq_size_key, #{$text-or-bg-or-border}-#{$mq_size_key}, #{$text-or-bg-or-border});
27
-
32
+ // font-size border-color background-color
28
33
  $switch-tag-type: utils.getColorPropertyType($text-or-bg-or-border);
29
34
 
30
35
  .#{$moduleNameShort}-#{$property_key}-#{$color-grade} {
31
36
  #{$switch-tag-type}: var(--theme-color-#{$color-grade});
32
-
37
+ // light lighter dark ...
33
38
  @each $theme-level in $theme-levels {
34
39
  $newColor: var(--theme-color-#{$color-grade}-#{$theme-level});
35
40
 
@@ -40,14 +45,27 @@ $declinations-config: map-get($theme-config, declinations-config);
40
45
  }
41
46
  }
42
47
 
48
+ @mixin themeBaseVars($theme:$theme-light) {
49
+ /* theme base colors*/
50
+ --theme-color-text: #{map-get($theme, foreground)};
51
+ --theme-color-foreground: #{map-get($theme, foreground)};
52
+ @include utils.alphaTize(--theme-color-foreground, map-get($theme, foreground));
53
+ --theme-color-background: #{map-get($theme, background)};
54
+ @include utils.alphaTize(--theme-color-background, map-get($theme, foreground));
55
+ --theme-color-paper: #{map-get($theme-light, paper)};
56
+ @include utils.alphaTize(--theme-color-paper, map-get($theme, paper));
57
+ }
58
+
59
+
43
60
  @mixin themeCssVars() {
44
61
  /* theme primary colors*/
45
62
  --theme-color-primary: #{$color-primary};
46
63
  @each $theme-level in $theme-levels {
47
64
  --theme-color-primary-#{$theme-level}: #{utils.applyColorEffect($theme-level,$color-primary)};
48
65
  }
66
+
49
67
  --theme-color-primary-alpha-low: #{color.change($color-primary,$alpha:0.8)};
50
- --theme-color-primary-alpha-mid: #{color.change($color-primary,$alpha:0.3)};
68
+ --theme-color-primary-alpha: #{color.change($color-primary,$alpha:0.3)};
51
69
  --theme-color-primary-alpha-high: #{color.change($color-primary,$alpha:0.1)};
52
70
 
53
71
  /* theme secondary colors*/
@@ -56,7 +74,7 @@ $declinations-config: map-get($theme-config, declinations-config);
56
74
  --theme-color-secondary-#{$theme-level}: #{utils.applyColorEffect($theme-level,$color-secondary)};
57
75
  }
58
76
  --theme-color-secondary-alpha-low: #{color.change($color-secondary,$alpha:0.8)};
59
- --theme-color-secondary-alpha-mid: #{color.change($color-secondary,$alpha:0.3)};
77
+ --theme-color-secondary-alpha: #{color.change($color-secondary,$alpha:0.3)};
60
78
  --theme-color-secondary-alpha-high: #{color.change($color-secondary,$alpha:0.1)};
61
79
 
62
80
  /* theme tertiary colors*/
@@ -65,12 +83,11 @@ $declinations-config: map-get($theme-config, declinations-config);
65
83
  --theme-color-tertiary-#{$theme-level}: #{utils.applyColorEffect($theme-level,$color-tertiary)};
66
84
  }
67
85
  --theme-color-tertiary-alpha-low: #{color.change($color-tertiary,$alpha:0.8)};
68
- --theme-color-tertiary-alpha-mid: #{color.change($color-tertiary,$alpha:0.3)};
86
+ --theme-color-tertiary-alpha: #{color.change($color-tertiary,$alpha:0.3)};
69
87
  --theme-color-tertiary-alpha-high: #{color.change($color-tertiary,$alpha:0.1)};
70
-
71
88
  }
72
89
 
73
90
  @mixin buildTheme($mq_size_key: null) {
74
-
75
- @include fabric_theme($mq_size_key);
91
+
92
+ @include fabric_theme($mq_size_key);
76
93
  }
@@ -2,6 +2,7 @@
2
2
  @use "sass:color";
3
3
  @use 'cssfabric-config';
4
4
  @use '../../cssfabric/modules/color/color-vars';
5
+ @use '../../cssfabric/modules/color/color-build' as colorBuild;
5
6
  @use "../../cssfabric/modules/box/box-vars" as box;
6
7
  @use "../../cssfabric/modules/box/box-build" as boxBuild;
7
8
  @use "../../cssfabric/modules/theme/theme-build" as themeBuild;
@@ -9,110 +10,42 @@
9
10
 
10
11
 
11
12
  $config: cssfabric-config.$cssfabric-config;
12
- /* cssFabric vars */
13
-
14
- $tru: utils.get_fabric_conf('themes','light');
15
-
16
- // COLOR config
17
- $color-config: color-vars.$color-config;
18
- // COLOR SCHEMES
19
- $color-schemes: map-get($color-config, scheme);
20
- // COLOR PALETTE
21
- $color-palette: map-get($color-config, palette);
22
- // COLOR TYPES
23
- $color-types-config: map-get($color-config, color-types-config);
24
13
 
25
14
  $themes: map-get($config, themes) !default;
26
15
  $theme-light: map-get($themes, light) !default;
27
16
  $theme-dark: map-get($themes, dark) !default;
28
17
 
29
- // GREYS
30
- $gray-config: map-get($color-config, gray-config) !default;
31
- $color-gray-start: map-get($gray-config, start) !default;
32
- $color-gray-end: map-get($gray-config, end) !default;
33
- $color-gray-steps: map-get($gray-config, steps) !default;
34
- $gray-schemes: utils.getGraySteps($color-gray-steps, $color-gray-start, $color-gray-end);
35
-
36
-
37
- // BOX config
38
- $box-config: box.$box-config;
39
-
40
- $box-shadows-steps: map-get($box-config, shadows-steps) !default;
41
- $box-shadows-step-multiplier: map-get($box-config, shadows-step_multiplier) !default;
42
- $box-shadow-shorthand-config: map-get($box-config, shadow-shorthand-config) !default;
43
-
18
+ /* cssFabric vars */
44
19
  :root {
45
-
46
20
  @include themeBuild.themeCssVars();
47
-
48
- --theme-color-foreground: #{map-get($theme-light, foreground)};
49
- --theme-color-text: #{map-get($theme-light, foreground)};
50
- --theme-color-background: #{map-get($theme-light, background)};
51
- --theme-color-paper: #{map-get($theme-light, paper)};
52
-
53
- --theme-color-border: rgba(208, 191, 151, 0.3);
54
- --theme-color-overlay: rgba(208, 191, 151, 0.2);
55
-
56
- /* color-scheme */
57
- @each $type-key, $type-prop in $color-schemes {
58
- --color-scheme-#{$type-key} : #{$type-prop};
59
- --color-scheme-#{$type-key}-light: #{utils.applyColorEffect('light',$type-prop)};
60
- --color-scheme-#{$type-key}-dark: #{utils.applyColorEffect('dark',$type-prop)};
61
- }
62
-
63
- /* color-palette */
64
- @each $type-key, $type-prop in $color-palette {
65
- /* color-palette #{$type-key} */
66
- --color-palette-#{$type-key} : #{$type-prop};
67
-
68
- --color-palette-#{$type-key}-lighter: #{utils.applyColorEffect('lighter',$type-prop)};
69
- --color-palette-#{$type-key}-light: #{utils.applyColorEffect('light',$type-prop)};
70
- --color-palette-#{$type-key}-dark: #{utils.applyColorEffect('dark',$type-prop)};
71
- --color-palette-#{$type-key}-darker: #{utils.applyColorEffect('darker',$type-prop)};
72
- --color-palette-#{$type-key}-complement: #{utils.applyColorEffect('complement',$type-prop)};
73
- --color-palette-#{$type-key}-invert: #{utils.applyColorEffect('invert',$type-prop)};
74
-
75
- --color-palette-#{$type-key}-alpha-low: #{color.change($type-prop,$alpha:0.8)};
76
- --color-palette-#{$type-key}-alpha-mid: #{color.change($type-prop,$alpha:0.3)};
77
- --color-palette-#{$type-key}-alpha-high: #{color.change($type-prop,$alpha:0.1)};
78
- }
79
-
80
- /* grays */
81
- @each $type-key, $type-prop in $gray-schemes {
82
- --color-gray-#{$type-key} : #{$type-prop};
83
- --color-gray-#{$type-key}-alpha-low: #{color.change($type-prop,$alpha:0.8)};
84
- }
85
-
86
- /* shadows */
87
- @include boxBuild.shadowsCssVars();
21
+ @include colorBuild.buildColorCssVars();
88
22
  /* boxes */
89
23
  @include boxBuild.pmbCssVars();
90
24
  /* text */
91
25
  @include textBuild.textCssVars();
92
26
 
93
- }
27
+ /* shadows */
28
+ @include boxBuild.shadowsCssVars();
29
+ /* themes */
30
+ @include themeBuild.themeBaseVars($theme-light);
94
31
 
95
- /*[data-theme="light"] {
32
+ &,[data-theme="light"] {
33
+ @include themeBuild.themeBaseVars($theme-light);
96
34
 
97
- --theme-color-foreground: #{map-get($theme-light, foreground)};
98
- --theme-color-text: #{map-get($theme-light, foreground)};
99
- --theme-color-background: #{map-get($theme-light, background)};
100
- --theme-color-paper: #{map-get($theme-light, paper)};
35
+ --theme-color-border: #{color.change(map-get($theme-light, paper),$alpha:0.2)};
36
+ --theme-color-overlay: rgba(208, 191, 151, 0.2);
37
+ }
101
38
 
102
- --theme-color-border: var(--theme-color-primary-alpha-mid);
103
- --theme-color-overlay: '';
104
- }*/
39
+ [data-theme="dark"] {
40
+ @include themeBuild.themeBaseVars($theme-dark);
41
+
42
+ --theme-color-border: #{color.change(map-get($theme-dark, paper),$alpha:0.2)};
43
+ --theme-color-overlay: rgba(255, 255, 255, 0.1);
44
+ }
45
+ }
105
46
 
106
- [data-theme="dark"] {
107
47
 
108
- --theme-color-foreground: #{map-get($theme-dark, foreground)};
109
- --theme-color-text: #{map-get($theme-dark, foreground)};
110
- --theme-color-background: #{map-get($theme-dark, background)};
111
- --theme-color-paper: #{map-get($theme-dark, paper)};
112
48
 
113
- --theme-color-border: rgba(255, 255, 255, 0.2);
114
- --theme-color-overlay: rgba(255,255,255,0.1);
115
- }
116
49
 
117
50
 
118
51