@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,44 +1,39 @@
1
1
  @use "sass:map";
2
2
  @use "sass:math";
3
3
  @use '../../_utils';
4
- @use "../cssfabric-config" as fabricConfig;
4
+ @use "../cssfabric-config";
5
5
  @use "box-vars" as box;
6
6
 
7
- $fabric-config: fabricConfig.$cssfabric-config;
7
+ $fabric-config: cssfabric-config.$cssfabric-config;
8
8
  $box-config: box.$box-config;
9
9
  $box-docs: box.$box-docs;
10
10
 
11
- $cssProps: map-get($box-config, cssProps);
12
- $box-border-shorthands: map-get($cssProps, borderShorthands);
13
- $box-position-props: map-get($cssProps, positionProps);
14
- $box-display-props: map-get($cssProps, displayProps);
11
+ $box-border-shorthands: box.$box-border-shorthands;
12
+ $box-position-props: box.$box-position-shorthands;
13
+ $box-display-props: box.$box-display-shorthands;
15
14
 
16
- $box-unit-config: map-get($box-config, unit-config);
17
- $box-border-unit-config: map-get($box-config, border-unit-config);
18
- $box-unit-size-config: map-get($box-config, unit-size-config);
19
- $box-unit-border-size-config: map-get($box-config, unit-border-size-config);
20
- $box-sizes-config: map-get($box-config, sizes-config);
21
- $box-border-sizes-px-config: map-get($box-config, border-sizes-px-config);
15
+ $box-unit-config: box.$box-unit-config;
16
+ $box-border-unit-config: box.$box-border-unit-config;
17
+ $box-unit-size-config: box.$box-unit-size-config;
18
+ $box-unit-border-size-config: box.$box-unit-border-size-config;
19
+ $box-sizes-config: box.$box-sizes-config;
20
+ $box-border-sizes-px-config: box.$box-sizes-border-config;
22
21
 
23
- $box-position-shorthand-config: map-get($box-config, position-shorthand-config) !default;
24
- $box-display-shorthand-config: map-get($box-config, display-shorthand-config) !default;
25
- $box-shadow-shorthand-config: map-get($box-config, shadow-shorthand-config) !default;
22
+ $box-position-shorthand-config: cssfabric-config.$box-position-shorthand !default;
23
+ $box-display-shorthand-config: cssfabric-config.$box-display-shorthand !default;
24
+ $box-shadow-shorthand-config: cssfabric-config.$box-shadow-shorthand !default;
26
25
 
27
- $box-border-shorthand-config: map-get($box-config, border-shorthand-config) !default;
28
- $box-padding-shorthand-config: map-get($box-config, padding-shorthand-config) !default;
29
- $box-margin-shorthand-config: map-get($box-config, margin-shorthand-config) !default;
26
+ $box-border-shorthand-config: cssfabric-config.$box-border-shorthand !default;
27
+ $box-padding-shorthand-config: cssfabric-config.$box-padding-shorthand !default;
28
+ $box-margin-shorthand-config: cssfabric-config.$box-margin-shorthand !default;
30
29
 
31
- $box-shadows-steps: map-get($box-config, shadows-steps) !default;
32
- $box-shadows-step-multiplier: map-get($box-config, shadows-step_multiplier) !default;
30
+ $box-shadows-steps: box.$box-shadows-steps !default;
31
+ $box-shadows-step-multiplier: box.$box-shadows-step-multiplier !default;
33
32
 
34
- $box-radius: map-get($fabric-config, border-radius);
35
-
36
- $css-shorthands: (
37
- border: $box-border-shorthand-config,
38
- padding: $box-padding-shorthand-config,
39
- margin: $box-margin-shorthand-config
40
- );
33
+ $box-radius: cssfabric-config.$box-radius;
34
+ $box-unit-presets: cssfabric-config.$box-unit-presets;
41
35
 
36
+ $densities-ratios : cssfabric-config.$densities-ratios;
42
37
 
43
38
  // adding {border}-{r} shorthand css rule for .{border}-{r}-1
44
39
  @function raw_size_tag_rule($condition) {
@@ -49,74 +44,94 @@ $css-shorthands: (
49
44
  }
50
45
  }
51
46
 
52
- @function write-box-rule($_args) {
53
- $rule_value: map-get($_args, rule_value);
54
- $rule_type: map-get($_args, rule_type);
55
- $css_prop: map-get($_args, css_prop);
56
- $grid_size_value: map-get($_args, grid_size_value);
57
-
58
- $computed_value: "";
59
-
60
-
61
- //
62
- @if ($css_prop== "padding" or $css_prop== "margin") {
63
- $computed_value: var(--box-unit-#{$grid_size_value});
64
- }
65
-
66
- // complex write method: 1px value
67
- @if ($css_prop== "border") {
68
- $computed_value: $rule_value + " solid #ccc";
69
- }
70
-
71
- @return $computed_value;
72
- }
73
-
47
+ // support ratios
48
+ // for paddings margins positions
74
49
  @mixin pmbCssVars() {
75
50
  $iterator: $box-sizes-config;
76
51
  @for $grid_size_value from 0 through $iterator {
77
52
  $css_size_value: ($grid_size_value * $box-unit-size-config) + $box-unit-config;
78
- --box-unit-#{$grid_size_value} : #{$css_size_value};
53
+ --box-density-#{$grid_size_value} : #{$css_size_value};
54
+ }
55
+
56
+ // presets
57
+ @each $preset, $preset-value in $box-unit-presets{
58
+ $value: ($preset-value * $box-unit-size-config) + $box-unit-config;
59
+ --box-density-preset-#{$preset}: #{$value};
60
+ }
61
+
62
+ // $ratios: tiny small medium large full
63
+ @each $ratio, $val in $densities-ratios {
64
+ [density=#{$ratio}] {
65
+ @for $grid_size_value from 0 through $iterator {
66
+ $css_size_value: (($grid_size_value * $box-unit-size-config)*$val) + $box-unit-config;
67
+ --box-density-#{$grid_size_value} : #{$css_size_value};
68
+ }
69
+ // presets
70
+ @each $preset, $preset-value in $box-unit-presets{
71
+ $value: (($preset-value * $box-unit-size-config)*$val) + $box-unit-config;
72
+ --box-density-preset-#{$preset}: #{$value};
73
+ }
74
+ }
79
75
  }
80
76
  }
81
77
 
82
- // prop : ...top bottom for border | margin | padding
78
+ // border
83
79
  @mixin fabric-pmb($fabric_box_position_prop, $fabric_box_position_prop_short) {
84
80
  @each $fabric_box_pmb_side_shorthand, $rule in $box-border-shorthands {
85
- $iterator: if($fabric_box_position_prop== border, $box-border-sizes-px-config, $box-sizes-config);
86
- $unit: if($fabric_box_position_prop== border, $box-border-unit-config, $box-unit-config);
87
- // box_unit_border_size
88
- $unit_size: if($fabric_box_position_prop== border, $box-unit-border-size-config, $box-unit-size-config);
89
81
 
90
- // css property name
91
- // remove _ is present
82
+ // remove _ if present
92
83
  $shorthand: if($fabric_box_pmb_side_shorthand== "_", "", -#{$fabric_box_pmb_side_shorthand});
93
84
 
94
85
  .#{$fabric_box_position_prop_short}#{$shorthand} {
95
- // todo use utils.getBoxIterator
96
- @for $grid_size_value from 1 through $iterator {
97
- $css_size_value: ($grid_size_value * $unit_size) + $unit;
86
+
87
+ @for $grid_size_value from 1 through $box-border-sizes-px-config {
88
+ $css_size_value: ($grid_size_value * $box-unit-border-size-config) + $box-border-unit-config;
98
89
  // css property name is aggregated with size value $i
90
+
91
+ $computed_value: $css_size_value + " solid #ededed";
92
+
99
93
  #{raw_size_tag_rule($grid_size_value)} &-#{$grid_size_value} {
100
- @if length($rule) ==4 {
101
- $_args: (
102
- rule_value: $css_size_value,
103
- rule_type: "pmb",
104
- css_prop: $fabric_box_position_prop,
105
- grid_size_value: $grid_size_value
106
- );
107
-
108
- #{$fabric_box_position_prop}: write-box-rule($_args);
94
+ @if length($rule) == 4 {
95
+ #{$fabric_box_position_prop}: #{$computed_value};
109
96
  } @else {
110
97
 
111
98
  @each $rule_value in $rule {
112
- $_args: (
113
- rule_value: $css_size_value,
114
- rule_type: "pmb",
115
- css_prop: $fabric_box_position_prop,
116
- grid_size_value: $grid_size_value
117
- );
118
-
119
- #{$fabric_box_position_prop}-#{$rule_value}: write-box-rule($_args);
99
+ #{$fabric_box_position_prop}-#{$rule_value}: #{$computed_value};
100
+ }
101
+ }
102
+ }
103
+ }
104
+ }
105
+ }
106
+ }
107
+
108
+ // prop : ... margin | padding
109
+ @mixin fabric-pm($fabric_box_position_prop, $fabric_box_position_prop_short) {
110
+ @each $fabric_box_pmb_side_shorthand, $rule in $box-border-shorthands {
111
+
112
+ $shorthand: if($fabric_box_pmb_side_shorthand== "_", "", -#{$fabric_box_pmb_side_shorthand});
113
+
114
+ .#{$fabric_box_position_prop_short}#{$shorthand} {
115
+
116
+ // presets
117
+ @each $preset, $preset-value in $box-unit-presets{
118
+ .#{$fabric_box_position_prop_short}#{$shorthand}-#{$preset}{
119
+ #{$fabric_box_position_prop}: --box-density-preset-#{$preset};
120
+ }
121
+ }
122
+
123
+ @for $grid_size_value from 1 through $box-sizes-config {
124
+ $css_size_value: ($grid_size_value * $box-unit-size-config) + $box-unit-config;
125
+ // css property name is aggregated with size value $i
126
+
127
+ $computed_value: var(--box-density-#{$grid_size_value});
128
+
129
+ #{raw_size_tag_rule($grid_size_value)} &-#{$grid_size_value} {
130
+ @if length($rule) == 4 {
131
+ #{$fabric_box_position_prop}: #{$computed_value};
132
+ } @else {
133
+ @each $rule_value in $rule {
134
+ #{$fabric_box_position_prop}-#{$rule_value}: #{$computed_value};
120
135
  }
121
136
  }
122
137
  }
@@ -125,21 +140,25 @@ $css-shorthands: (
125
140
  }
126
141
  }
127
142
 
128
- // stupid, make three calls
129
143
  // pmb as padding margin border property
144
+ // padding-tiny padding-small padding
130
145
  @mixin padding-margin-border($mq_key) {
131
- @each $box_pmb_shorthand_value, $box_pmb_shorthand in $css-shorthands {
132
- $shorthand: if($mq_key, #{$box_pmb_shorthand}-#{$mq_key}, #{$box_pmb_shorthand});
133
146
 
134
- @include fabric-pmb($box_pmb_shorthand_value, $shorthand);
135
- }
147
+ $shorthand: if($mq_key, #{$box-margin-shorthand-config}-#{$mq_key}, #{$box-margin-shorthand-config});
148
+ @include fabric-pm(margin, $shorthand);
149
+
150
+ $shorthand: if($mq_key, #{$box-padding-shorthand-config}-#{$mq_key}, #{$box-padding-shorthand-config});
151
+ @include fabric-pm(padding, $shorthand);
152
+
153
+ $shorthand: if($mq_key, #{$box-border-shorthand-config}-#{$mq_key}, #{$box-border-shorthand-config});
154
+ @include fabric-pmb(border, $shorthand);
155
+
136
156
  }
137
157
 
138
158
  // radius
139
159
  @mixin radius($mq_key) {
140
160
  $shorthand: if($mq_key, radius-#{$mq_key}, radius);
141
161
 
142
- @debug $box-radius;
143
162
  /*radius*/
144
163
  @each $radius, $value in $box-radius {
145
164
  .#{$shorthand}-#{$radius} {
@@ -177,7 +196,7 @@ $css-shorthands: (
177
196
  @each $place in $places {
178
197
  @for $size from 0 through 8 {
179
198
  .#{$place}-#{$shorthand}#{$size} {
180
- #{$place}: var(--box-unit-#{$size});
199
+ #{$place}: var(--box-density-#{$size});
181
200
  }
182
201
  }
183
202
  }
@@ -1,15 +1,16 @@
1
1
  @use '../../utils';
2
+ @use "../cssfabric-config";
2
3
 
3
- $_unit-config: rem;
4
- $_border-unit-config: px;
5
- $_unit-size-config: 0.5;
6
- $_unit-border-size-config: 1;
4
+ $box-unit-config: rem;
5
+ $box-border-unit-config: px;
6
+ $box-unit-size-config: 0.5;
7
+ $box-unit-border-size-config: 1;
7
8
 
8
- $_sizes-config: 32;
9
- $_sizes-border-config: 5;
9
+ $box-sizes-config: 12;
10
+ $box-sizes-border-config: 3;
10
11
 
11
- $_shadows-steps: 5;
12
- $_shadows-step-multiplier: 2;
12
+ $box-shadows-steps: 5;
13
+ $box-shadows-step-multiplier: 2;
13
14
 
14
15
  $_shadows-v_fact: 2.4;
15
16
  $_shadows-h_fact: 1.16;
@@ -22,9 +23,9 @@ $shadow-factors: (
22
23
  h_fact:$_shadows-h_fact,
23
24
  v_fact_2:$_shadows-v_fact_2,
24
25
  h_fact_2:$_shadows-h_fact_2,
25
- );
26
+ )!default;
26
27
 
27
- $_border-shorthands: (
28
+ $box-border-shorthands: (
28
29
  _: top bottom left right,
29
30
  t: top,
30
31
  b: bottom,
@@ -34,17 +35,17 @@ $_border-shorthands: (
34
35
  u: bottom left right,
35
36
  ii: left right,
36
37
  tb: top bottom
37
- );
38
+ )!default;
38
39
 
39
- $_position-props: (
40
+ $box-position-shorthands: (
40
41
  abs: absolute,
41
42
  rel: relative,
42
43
  stat: static,
43
44
  fix: fixed,
44
45
  sticky: sticky
45
- );
46
+ )!default;
46
47
 
47
- $_display-props: (
48
+ $box-display-shorthands: (
48
49
  block: block,
49
50
  none: none,
50
51
  inline: inline,
@@ -63,25 +64,26 @@ $box-metadata: (
63
64
  );
64
65
 
65
66
  $box-config: (
66
- unit-config: $_unit-config,
67
- border-unit-config: $_border-unit-config,
68
- unit-size-config: $_unit-size-config,
69
- unit-border-size-config: $_unit-border-size-config,
70
- sizes-config: $_sizes-config,
71
- border-sizes-px-config: 5,
72
- shadows-steps: $_shadows-steps,
73
- shadows_step_multiplier: $_shadows-step-multiplier,
67
+ unit-config: $box-unit-config,
68
+ border-unit-config: $box-border-unit-config,
69
+ unit-size-config: $box-unit-size-config,
70
+ unit-border-size-config: $box-unit-border-size-config,
71
+ sizes-config: $box-sizes-config,
72
+ border-sizes-px-config: $box-sizes-border-config,
73
+ shadows-steps: $box-shadows-steps,
74
+ shadows_step_multiplier: $box-shadows-step-multiplier,
74
75
  //
75
- position-shorthand-config: pos,
76
- display-shorthand-config: dsp,
77
- shadow-shorthand-config: shad,
78
- border-shorthand-config: border,
79
- padding-shorthand-config: pad,
80
- margin-shorthand-config: marg,
76
+ position-shorthand-config: cssfabric-config.$box-position-shorthand,
77
+ display-shorthand-config: cssfabric-config.$box-display-shorthand,
78
+ shadow-shorthand-config:cssfabric-config.$box-shadow-shorthand,
79
+ border-shorthand-config: cssfabric-config.$box-border-shorthand,
80
+ padding-shorthand-config: cssfabric-config.$box-padding-shorthand,
81
+ margin-shorthand-config: cssfabric-config.$box-margin-shorthand,
82
+
81
83
  cssProps:(
82
- borderShorthands: $_border-shorthands,
83
- positionProps: $_position-props,
84
- displayProps: $_display-props
84
+ borderShorthands: $box-border-shorthands,
85
+ positionProps: $box-position-shorthands,
86
+ displayProps: $box-display-shorthands
85
87
  )
86
88
  );
87
89
 
@@ -89,30 +91,30 @@ $box-config: (
89
91
  $box-docs: (
90
92
  attributes:(
91
93
  padding: (
92
- tag: map-get($box-config, padding-shorthand-config),
93
- keys: utils.getObjectKeys($_border-shorthands),
94
- values: utils.getBoxIterator($_sizes-config, $_unit-config, $_unit-size-config),
95
- levels: ("_":utils.getObjectKeys(utils.getBoxIterator($_sizes-config, $_unit-config, $_unit-size-config))),
94
+ tag: cssfabric-config.$box-padding-shorthand,
95
+ keys: utils.getObjectKeys($box-border-shorthands),
96
+ values: utils.getBoxIterator($box-sizes-config, $box-unit-config, $box-unit-size-config),
97
+ levels: ("_":utils.getObjectKeys(utils.getBoxIterator($box-sizes-config, $box-unit-config, $box-unit-size-config))),
96
98
  about: "padding properties for html elements"
97
99
  ),
98
100
  margin: (
99
- tag: map-get($box-config, margin-shorthand-config),
100
- keys: utils.getObjectKeys($_border-shorthands),
101
- values: utils.getBoxIterator($_sizes-config, $_unit-config, $_unit-size-config),
102
- levels: ("_":utils.getObjectKeys(utils.getBoxIterator($_sizes-config, $_unit-config, $_unit-size-config))),
101
+ tag: cssfabric-config.$box-margin-shorthand,
102
+ keys: utils.getObjectKeys($box-border-shorthands),
103
+ values: utils.getBoxIterator($box-sizes-config, $box-unit-config, $box-unit-size-config),
104
+ levels: ("_":utils.getObjectKeys(utils.getBoxIterator($box-sizes-config, $box-unit-config, $box-unit-size-config))),
103
105
  about: "margin properties for html elements"
104
106
  ),
105
107
  border: (
106
- tag: map-get($box-config, border-shorthand-config),
107
- keys: utils.getObjectKeys($_border-shorthands),
108
- values: utils.getBoxIterator($_sizes-border-config, $_border-unit-config, $_unit-border-size-config),
109
- levels: ("_":utils.getObjectKeys(utils.getBoxIterator($_sizes-border-config, $_border-unit-config, $_unit-border-size-config))),
108
+ tag: cssfabric-config.$box-border-shorthand,
109
+ keys: utils.getObjectKeys($box-border-shorthands),
110
+ values: utils.getBoxIterator($box-sizes-border-config, $box-border-unit-config, $box-unit-border-size-config),
111
+ levels: ("_":utils.getObjectKeys(utils.getBoxIterator($box-sizes-border-config, $box-border-unit-config, $box-unit-border-size-config))),
110
112
  about: "border properties for html elements"
111
113
  ),
112
114
  shadow: (
113
- tag: map-get($box-config, shadow-shorthand-config),
114
- values: utils.getShadowIterator($shadow-factors, 8),
115
- levels:("_": utils.getObjectKeys(utils.getShadowIterator($shadow-factors, 8))
115
+ tag: cssfabric-config.$box-shadow-shorthand,
116
+ values: utils.getShadowIterator($shadow-factors, $box-shadows-steps),
117
+ levels:("_": utils.getObjectKeys(utils.getShadowIterator($shadow-factors, $box-shadows-steps))
116
118
  ),
117
119
  about: "applying shadows give depth and levels to your design"
118
120
  )
@@ -1,28 +1,26 @@
1
1
  @use "sass:map";
2
- // load scss config file
3
- @use '../../_utils';
4
2
  @use 'color-vars';
5
3
  @use "sass:math";
4
+ // load scss config file
5
+ @use '../../_utils';
6
+ @use '../cssfabric-config';
6
7
 
7
8
  $color-config: color-vars.$color-config;
8
9
 
9
10
  // COLOR TYPES
10
11
  $color-types-config: map-get($color-config, color-types-config);
11
-
12
12
  // COLOR SCHEMES
13
- $color-schemes: map-get($color-config, scheme);
14
-
13
+ $color-schemes: map-get($color-config, scheme) !default;
15
14
  // COLOR PALETTE
16
- $color-palette: map-get($color-config, palette);
17
-
15
+ $color-palette: map-get($color-config, palette) !default;
18
16
  // COLOR THEME
19
- $color-theme: map-get($color-config, theme);
17
+ $color-theme: map-get($color-config, theme) !default;
18
+
20
19
 
21
20
  // GRAYS
22
- $gray-config: map-get($color-config, gray-config) !default;
23
- $color-gray-start: map-get($gray-config, start) !default;
24
- $color-gray-end: map-get($gray-config, end) !default;
25
- $color-gray-steps: map-get($gray-config, steps) !default;
21
+ $color-gray-start: cssfabric-config.$gray-start !default;
22
+ $color-gray-end: cssfabric-config.$gray-end !default;
23
+ $color-gray-steps: cssfabric-config.$gray-steps !default;
26
24
  $gray-schemes: utils.getGraySteps($color-gray-steps, $color-gray-start, $color-gray-end);
27
25
 
28
26
  @function text-contrast($n) {
@@ -37,6 +35,41 @@ $gray-schemes: utils.getGraySteps($color-gray-steps, $color-gray-start, $color-g
37
35
  @return $color;
38
36
  }
39
37
 
38
+ @mixin buildColorCssVars() {
39
+
40
+ /* color-scheme primary secondary tertiary */
41
+ @each $type-key, $type-prop in $color-schemes {
42
+ --color-scheme-#{$type-key} : #{$type-prop};
43
+ --color-scheme-#{$type-key}-light: #{utils.applyColorEffect('light',$type-prop)};
44
+ --color-scheme-#{$type-key}-dark: #{utils.applyColorEffect('dark',$type-prop)};
45
+ @include utils.alphaTize(--color-scheme-#{$type-key}, $type-prop);
46
+ }
47
+
48
+ /* color-palette */
49
+ @each $type-key, $type-prop in $color-palette {
50
+ --color-palette-#{$type-key} : #{$type-prop};
51
+ @include utils.alphaTize(--color-palette-#{$type-key}, $type-prop);
52
+
53
+ --color-palette-#{$type-key}-lighter: #{utils.applyColorEffect('lighter',$type-prop)};
54
+ --color-palette-#{$type-key}-light: #{utils.applyColorEffect('light',$type-prop)};
55
+ --color-palette-#{$type-key}-dark: #{utils.applyColorEffect('dark',$type-prop)};
56
+ --color-palette-#{$type-key}-darker: #{utils.applyColorEffect('darker',$type-prop)};
57
+
58
+ --color-palette-#{$type-key}-complement: #{utils.applyColorEffect('complement',$type-prop)};
59
+ @include utils.alphaTize(--color-palette-#{$type-key}-complement, utils.applyColorEffect('complement', $type-prop));
60
+
61
+ --color-palette-#{$type-key}-invert: #{utils.applyColorEffect('invert',$type-prop)};
62
+ @include utils.alphaTize(--color-palette-#{$type-key}-invert, utils.applyColorEffect('invert', $type-prop));
63
+ // backdrop-filter: blur(5px);
64
+ }
65
+
66
+ /* grays */
67
+ @each $type-key, $type-prop in $gray-schemes {
68
+ --color-gray-#{$type-key} : #{$type-prop};
69
+ @include utils.alphaTize(--color-gray-#{$type-key}, $type-prop);
70
+ }
71
+ }
72
+
40
73
  @mixin colorFactory($tag_short, $color_prop) {
41
74
  $switch-tag_short: utils.getColorPropertyType($tag_short);
42
75
 
@@ -60,19 +93,18 @@ $gray-schemes: utils.getGraySteps($color-gray-steps, $color-gray-start, $color-g
60
93
  $prop: "";
61
94
 
62
95
  $property_key: #{$color-type-key}-#{$color-type} + if($mq-key, -#{$mq-key}, "");
63
- /**
64
- #{$color-type-key} ?
65
- */
96
+
97
+
66
98
  .#{$property_key} {
67
- @each $type-key, $type-prop in $color-type-list {
99
+ @each $type-key, $type-prop in $color-type-list {
68
100
  &#{"-" + $type-key} {
69
101
 
70
102
  // border-color: ;
71
- @if $color-type-key==border-color {
72
- border-color: utils.applyColorEffect('dark',$type-prop)!important;
103
+ @if $color-type-key==border-color {
104
+ border-color: utils.applyColorEffect('dark', $type-prop) !important;
73
105
  }
74
106
 
75
- @if $color-type-key==color { // nope for gray
107
+ @if $color-type-key==foreground {
76
108
  color: $type-prop;
77
109
  @if $has-color-factory {
78
110
  @include colorFactory($color-type-key, $type-prop);
@@ -84,7 +116,7 @@ $gray-schemes: utils.getGraySteps($color-gray-steps, $color-gray-start, $color-g
84
116
  @if $has-color-factory {
85
117
  @include colorFactory($color-type-key, $type-prop);
86
118
  }
87
- }
119
+ }
88
120
 
89
121
  @if $color-type-key == "bg-themed" {
90
122
  color: text-contrast($type-prop);
@@ -100,9 +132,61 @@ $gray-schemes: utils.getGraySteps($color-gray-steps, $color-gray-start, $color-g
100
132
  }
101
133
 
102
134
  @mixin buildColor($mq_size_key:null) {
103
- @each $color-type-key in $color-types-config {
104
- @include fabricColors("palette", $color-palette, $color-type-key, $mq_size_key, true);
105
- @include fabricColors("scheme", $color-schemes, $color-type-key, $mq_size_key);
106
- @include fabricColors("grey", $gray-schemes, $color-type-key, $mq_size_key);
135
+ // "foreground" ,
136
+ // "bg",
137
+ // "bg-themed",
138
+ // "border-color"
139
+
140
+ // $has-color-palette
141
+ @if ((cssfabric-config.$has-color-palette==true) or ($mq_size_key!=null and cssfabric-config.$has-color-palette-responsive==true)) {
142
+ // $has-color-foreground
143
+ @if (cssfabric-config.$has-color-foreground) {
144
+ @include fabricColors("palette", $color-palette, foreground, $mq_size_key, true);
145
+ }
146
+ // $has-color-bg
147
+ @if (cssfabric-config.$has-color-bg) {
148
+ @include fabricColors("palette", $color-palette, bg, $mq_size_key, true);
149
+ }
150
+ // $has-color-bg-themed
151
+ @if (cssfabric-config.$has-color-bg-themed) {
152
+ @include fabricColors("palette", $color-palette, bg-themed, $mq_size_key, true);
153
+ }
154
+ // $has-color-border
155
+ @if (cssfabric-config.$has-color-border) {
156
+ @include fabricColors("palette", $color-palette, border-color, $mq_size_key, true);
157
+ }
107
158
  }
159
+
160
+ // $has-color-scheme
161
+ @if ((cssfabric-config.$has-color-scheme==true) or ($mq_size_key!=null and cssfabric-config.$has-color-scheme-responsive==true)) {
162
+ @if (cssfabric-config.$has-color-foreground) {
163
+ @include fabricColors("scheme", $color-schemes, foreground, $mq_size_key, true);
164
+ }
165
+ @if (cssfabric-config.$has-color-bg) {
166
+ @include fabricColors("scheme", $color-schemes, bg, $mq_size_key, true);
167
+ }
168
+ @if (cssfabric-config.$has-color-bg-themed) {
169
+ @include fabricColors("palette", $color-schemes, bg-themed, $mq_size_key, true);
170
+ }
171
+ @if (cssfabric-config.$has-color-border) {
172
+ @include fabricColors("scheme", $color-schemes, border-color, $mq_size_key);
173
+ }
174
+ }
175
+
176
+ // $has-color-gray
177
+ @if ((cssfabric-config.$has-color-gray==true) or ($mq_size_key!=null and cssfabric-config.$has-color-gray-responsive==true)) {
178
+ @if (cssfabric-config.$has-color-foreground) {
179
+ @include fabricColors("grey", $gray-schemes, foreground, $mq_size_key, true);
180
+ }
181
+ @if (cssfabric-config.$has-color-bg) {
182
+ @include fabricColors("grey", $gray-schemes, bg, $mq_size_key, true);
183
+ }
184
+ @if (cssfabric-config.$has-color-bg-themed) {
185
+ @include fabricColors("palette", $gray-schemes, bg-themed, $mq_size_key, true);
186
+ }
187
+ @if (cssfabric-config.$has-color-border) {
188
+ @include fabricColors("grey", $gray-schemes, border-color, $mq_size_key);
189
+ }
190
+ }
191
+
108
192
  }
@@ -2,25 +2,24 @@
2
2
  @use '../../_utils';
3
3
  @use "sass:math";
4
4
 
5
- $scale-config: scale-vars.$scale-config;
6
5
  $_cfg: utils.get_fabric_conf();
7
- $cssProps: map-get($scale-config, cssProps);
8
6
 
9
7
  // read variables
10
8
  $_has_dimensions_strict: map-get($_cfg, has_dimensions_strict);
11
9
  $_has_dimensions_min: true; // map-get($_cfg, has_dimensions_min);
12
10
  $_has_dimensions_max: true; // map-get($_cfg, has_dimensions_max);
13
11
 
14
- $scale-defined-steps: map-get($scale-config, defined-steps);
15
- $scale-defined-step-unit: map-get($scale-config, defined-step-unit);
16
- $scale-defined-step-size: map-get($scale-config, defined-step-size);
17
- $scale-grid-ratios-config: map-get($scale-config, grid-ratios-config);
12
+ $scale-defined-steps: scale-vars.$scale-defined-steps;
13
+ $scale-defined-step-unit: scale-vars.$scale-defined-step-unit;
14
+ $scale-defined-step-size: scale-vars.$scale-defined-step-size;
15
+ $scale-grid-ratios-config: scale-vars.$scale-grid-ratios-config;
18
16
 
19
- $scale-sizes: map-get($cssProps, size);
20
- $scale-content: map-get($cssProps, content);
17
+ $scale-sizes: scale-vars.$scale-sizes-config;
18
+ $scale-content: scale-vars.$scale-content-config;
21
19
 
22
- $weight-config: map-get($scale-config, weight-config)!default;
23
- $unit-tag-config: map-get($scale-config, unit-tag-config)!default;
20
+ $weight-config: scale-vars.$scale-font-weight-config ;
21
+ $unit-tag-config: scale-vars.$scale-shorthands;
22
+ $scale-sizes-preset-config: scale-vars.$scale-sizes-preset-config;
24
23
 
25
24
  /// css dimensions rules builder
26
25
  @mixin scale-classname-builder($scale_prop, $size_code, $size_value, $media_query_code) {
@@ -67,10 +66,10 @@ $unit-tag-config: map-get($scale-config, unit-tag-config)!default;
67
66
  }
68
67
  }
69
68
 
70
- // loop on dimensions
69
+ // content-max-min
71
70
  @mixin play_dimensions_loop($scale_prop, $mq_size_key) {
72
71
  // loop on dimensions
73
- @each $scale_css_key , $scale_css_value in $scale-content {
72
+ @each $scale_css_key, $scale_css_value in $scale-content {
74
73
  @include scale-classname-builder($scale_prop, $scale_css_key, $scale_css_value, $mq_size_key);
75
74
  }
76
75
  }
@@ -96,6 +95,7 @@ $unit-tag-config: map-get($scale-config, unit-tag-config)!default;
96
95
  );
97
96
  }
98
97
  }
98
+ $--var-oi: yt;
99
99
 
100
100
  // loop on ratio dimensions
101
101
  @mixin play_ratio_dimensions_loop($scale_prop, $mq_size_key) {
@@ -112,14 +112,27 @@ $unit-tag-config: map-get($scale-config, unit-tag-config)!default;
112
112
  }
113
113
  }
114
114
 
115
+ @mixin play_preset_loop($scale_prop, $mq_size_key) {
116
+
117
+ @each $preset, $value in $scale-sizes-preset-config {
118
+ @include scale-classname-builder(
119
+ $scale_prop,
120
+ $preset,
121
+ $value + #{$scale-defined-step-unit},
122
+ $mq_size_key
123
+ );
124
+ }
125
+ }
126
+
115
127
  @mixin buildScale($mq_size_key:null) {
116
128
  @each $scale_prop, $scale_prop_short in $unit-tag-config {
117
- // loop on shorthands
129
+ // loop on shorthands mid tiers ...
118
130
  @include play_shorthand_loop($scale_prop, $mq_size_key);
119
131
 
120
132
  // loop on dimensions
121
133
  @include play_dimensions_loop($scale_prop, $mq_size_key);
122
134
 
135
+ @include play_preset_loop($scale_prop, $mq_size_key);
123
136
  // loop on defined dimensions
124
137
  @include play_defined_dimensions_loop($scale_prop, $mq_size_key);
125
138