@medyll/cssfabric 0.0.10

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 (165) hide show
  1. package/.idea/codeStyles/codeStyleConfig.xml +5 -0
  2. package/.idea/cssfabric.iml +11 -0
  3. package/.idea/misc.xml +9 -0
  4. package/.idea/modules.xml +8 -0
  5. package/.idea/vcs.xml +6 -0
  6. package/.vscode/settings.json +24 -0
  7. package/README.md +240 -0
  8. package/cssfabric.config.js +3 -0
  9. package/cssfabric.json +8 -0
  10. package/gulpfile.js +610 -0
  11. package/lib/_generated/export.variables.json +583 -0
  12. package/lib/index.d.ts +2 -0
  13. package/lib/index.js +7 -0
  14. package/lib/scripts/cssfabric.d.ts +24 -0
  15. package/lib/scripts/cssfabric.js +48 -0
  16. package/lib/scripts/cssfabricClassNames.d.ts +14 -0
  17. package/lib/scripts/cssfabricClassNames.js +150 -0
  18. package/lib/scripts/utils.d.ts +5 -0
  19. package/lib/scripts/utils.js +40 -0
  20. package/lib/styles/core/animation/animation.css +0 -0
  21. package/lib/styles/core/animation/animation.min.css +0 -0
  22. package/lib/styles/core/base/base.css +222 -0
  23. package/lib/styles/core/base/base.min.css +1 -0
  24. package/lib/styles/core/box/box.css +2263 -0
  25. package/lib/styles/core/box/box.min.css +1 -0
  26. package/lib/styles/core/box/box.responsive.css +13590 -0
  27. package/lib/styles/core/box/box.responsive.min.css +1 -0
  28. package/lib/styles/core/color/color.css +923 -0
  29. package/lib/styles/core/color/color.min.css +1 -0
  30. package/lib/styles/core/color/color.responsive.css +5550 -0
  31. package/lib/styles/core/color/color.responsive.min.css +1 -0
  32. package/lib/styles/core/flex/flex.css +140 -0
  33. package/lib/styles/core/flex/flex.min.css +1 -0
  34. package/lib/styles/core/flex/flex.responsive.css +852 -0
  35. package/lib/styles/core/flex/flex.responsive.min.css +1 -0
  36. package/lib/styles/core/grid/grid.css +50 -0
  37. package/lib/styles/core/grid/grid.min.css +1 -0
  38. package/lib/styles/core/grid/grid.responsive.css +312 -0
  39. package/lib/styles/core/grid/grid.responsive.min.css +1 -0
  40. package/lib/styles/core/main.css +2263 -0
  41. package/lib/styles/core/main.min.css +1 -0
  42. package/lib/styles/core/menu/menu.css +97 -0
  43. package/lib/styles/core/menu/menu.min.css +1 -0
  44. package/lib/styles/core/menu/menu.responsive.css +504 -0
  45. package/lib/styles/core/menu/menu.responsive.min.css +1 -0
  46. package/lib/styles/core/overflow/overflow.css +60 -0
  47. package/lib/styles/core/overflow/overflow.min.css +1 -0
  48. package/lib/styles/core/overflow/overflow.responsive.css +367 -0
  49. package/lib/styles/core/overflow/overflow.responsive.min.css +1 -0
  50. package/lib/styles/core/scale/scale.css +639 -0
  51. package/lib/styles/core/scale/scale.min.css +1 -0
  52. package/lib/styles/core/scale/scale.responsive.css +3846 -0
  53. package/lib/styles/core/scale/scale.responsive.min.css +1 -0
  54. package/lib/styles/core/table/table.css +72 -0
  55. package/lib/styles/core/table/table.min.css +1 -0
  56. package/lib/styles/core/table/table.responsive.css +444 -0
  57. package/lib/styles/core/table/table.responsive.min.css +1 -0
  58. package/lib/styles/core/text/text.css +147 -0
  59. package/lib/styles/core/text/text.min.css +1 -0
  60. package/lib/styles/core/text/text.responsive.css +894 -0
  61. package/lib/styles/core/text/text.responsive.min.css +1 -0
  62. package/lib/styles/core/theme/theme.css +197 -0
  63. package/lib/styles/core/theme/theme.min.css +1 -0
  64. package/lib/styles/core/vars.css +278 -0
  65. package/lib/styles/core/vars.min.css +1 -0
  66. package/lib/styles/core/zindex/zindex.css +279 -0
  67. package/lib/styles/core/zindex/zindex.min.css +1 -0
  68. package/lib/styles/cssfabric.css +7631 -0
  69. package/lib/styles/cssfabric.min.css +15 -0
  70. package/lib/styles/cssfabric.responsive.css +26359 -0
  71. package/lib/styles/cssfabric.responsive.min.css +9 -0
  72. package/package.json +67 -0
  73. package/src/_generated/export.variables.json +756 -0
  74. package/src/_generated/export.variables.md +240 -0
  75. package/src/_generated/index.d.ts +3 -0
  76. package/src/cssfabric/_utils.scss +205 -0
  77. package/src/cssfabric/index.d.ts +3 -0
  78. package/src/cssfabric/modules/_cssfabric-config.scss +89 -0
  79. package/src/cssfabric/modules/_mixins.scss +1 -0
  80. package/src/cssfabric/modules/animation/_animation-build.scss +121 -0
  81. package/src/cssfabric/modules/animation/_animation-vars.scss +17 -0
  82. package/src/cssfabric/modules/animation/animation.scss +3 -0
  83. package/src/cssfabric/modules/base/_base-vars.scss +17 -0
  84. package/src/cssfabric/modules/base/base.scss +80 -0
  85. package/src/cssfabric/modules/box/_box-build.scss +215 -0
  86. package/src/cssfabric/modules/box/_box-vars.scss +119 -0
  87. package/src/cssfabric/modules/box/box-responsive.scss +18 -0
  88. package/src/cssfabric/modules/box/box.scss +3 -0
  89. package/src/cssfabric/modules/color/_color-build.scss +108 -0
  90. package/src/cssfabric/modules/color/_color-vars.scss +80 -0
  91. package/src/cssfabric/modules/color/color-responsive.scss +23 -0
  92. package/src/cssfabric/modules/color/color.scss +3 -0
  93. package/src/cssfabric/modules/css-fabric.scss +2 -0
  94. package/src/cssfabric/modules/flex/_flex-build.scss +169 -0
  95. package/src/cssfabric/modules/flex/_flex-vars.scss +87 -0
  96. package/src/cssfabric/modules/flex/flex-responsive.scss +25 -0
  97. package/src/cssfabric/modules/flex/flex.scss +3 -0
  98. package/src/cssfabric/modules/grid/_grid-build.scss +91 -0
  99. package/src/cssfabric/modules/grid/_grid-vars.scss +87 -0
  100. package/src/cssfabric/modules/grid/grid-responsive.scss +25 -0
  101. package/src/cssfabric/modules/grid/grid.scss +3 -0
  102. package/src/cssfabric/modules/main.scss +3 -0
  103. package/src/cssfabric/modules/menu/_menu-build.scss +119 -0
  104. package/src/cssfabric/modules/menu/_menu-vars.scss +29 -0
  105. package/src/cssfabric/modules/menu/menu-responsive.scss +19 -0
  106. package/src/cssfabric/modules/menu/menu.scss +3 -0
  107. package/src/cssfabric/modules/overflow/_overflow-build.scss +22 -0
  108. package/src/cssfabric/modules/overflow/_overflow-vars.scss +31 -0
  109. package/src/cssfabric/modules/overflow/overflow-responsive.scss +25 -0
  110. package/src/cssfabric/modules/overflow/overflow.scss +5 -0
  111. package/src/cssfabric/modules/scale/_scale-build.scss +129 -0
  112. package/src/cssfabric/modules/scale/_scale-vars.scss +75 -0
  113. package/src/cssfabric/modules/scale/scale-responsive.scss +23 -0
  114. package/src/cssfabric/modules/scale/scale.scss +3 -0
  115. package/src/cssfabric/modules/table/_table-build.scss +134 -0
  116. package/src/cssfabric/modules/table/_table-vars.scss +30 -0
  117. package/src/cssfabric/modules/table/table-responsive.scss +24 -0
  118. package/src/cssfabric/modules/table/table.scss +3 -0
  119. package/src/cssfabric/modules/text/_text-build.scss +109 -0
  120. package/src/cssfabric/modules/text/_text-vars.scss +87 -0
  121. package/src/cssfabric/modules/text/text-responsive.scss +25 -0
  122. package/src/cssfabric/modules/text/text.scss +5 -0
  123. package/src/cssfabric/modules/theme/_theme-build.scss +77 -0
  124. package/src/cssfabric/modules/theme/_theme-vars.scss +47 -0
  125. package/src/cssfabric/modules/theme/theme.scss +5 -0
  126. package/src/cssfabric/modules/vars.scss +120 -0
  127. package/src/cssfabric/modules/zindex/_zindex-vars.scss +19 -0
  128. package/src/cssfabric/modules/zindex/zindex.scss +18 -0
  129. package/src/index.d.ts +3 -0
  130. package/src/index.ts +4 -0
  131. package/src/scripts/cssfabric.ts +54 -0
  132. package/src/scripts/cssfabricClassNames.ts +216 -0
  133. package/src/scripts/utils.ts +37 -0
  134. package/src/vendor/index.d.ts +3 -0
  135. package/src/vendor/normalize/normalize.min.css +2 -0
  136. package/src/vendor/sass-json-export/CHANGELOG.md +26 -0
  137. package/src/vendor/sass-json-export/Gruntfile.js +60 -0
  138. package/src/vendor/sass-json-export/LICENSE +20 -0
  139. package/src/vendor/sass-json-export/README.md +90 -0
  140. package/src/vendor/sass-json-export/package.json +60 -0
  141. package/src/vendor/sass-json-export/stylesheets/encode/api/_json.scss +26 -0
  142. package/src/vendor/sass-json-export/stylesheets/encode/encode.scss +17 -0
  143. package/src/vendor/sass-json-export/stylesheets/encode/helpers/_quote.scss +9 -0
  144. package/src/vendor/sass-json-export/stylesheets/encode/mixins/_json.scss +42 -0
  145. package/src/vendor/sass-json-export/stylesheets/encode/types/_bool.scss +7 -0
  146. package/src/vendor/sass-json-export/stylesheets/encode/types/_color.scss +8 -0
  147. package/src/vendor/sass-json-export/stylesheets/encode/types/_list.scss +14 -0
  148. package/src/vendor/sass-json-export/stylesheets/encode/types/_map.scss +15 -0
  149. package/src/vendor/sass-json-export/stylesheets/encode/types/_null.scss +7 -0
  150. package/src/vendor/sass-json-export/stylesheets/encode/types/_number.scss +8 -0
  151. package/src/vendor/sass-json-export/stylesheets/encode/types/_string.scss +8 -0
  152. package/src/vendor/sass-json-export/stylesheets/sass-json-export.scss +2 -0
  153. package/src/vendor/sass-json-export/test/encode/_index.scss +14 -0
  154. package/src/vendor/sass-json-export/test/encode/api/_json.scss +29 -0
  155. package/src/vendor/sass-json-export/test/encode/helpers/_quote.scss +6 -0
  156. package/src/vendor/sass-json-export/test/encode/types/_bool.scss +6 -0
  157. package/src/vendor/sass-json-export/test/encode/types/_color.scss +7 -0
  158. package/src/vendor/sass-json-export/test/encode/types/_list.scss +25 -0
  159. package/src/vendor/sass-json-export/test/encode/types/_map.scss +17 -0
  160. package/src/vendor/sass-json-export/test/encode/types/_null.scss +8 -0
  161. package/src/vendor/sass-json-export/test/encode/types/_number.scss +68 -0
  162. package/src/vendor/sass-json-export/test/encode/types/_string.scss +9 -0
  163. package/src/vendor/sass-json-export/test/test.scss +9 -0
  164. package/tsconfig.json +46 -0
  165. package/webpack.config.js +53 -0
@@ -0,0 +1,17 @@
1
+ @use '../../_utils';
2
+
3
+ $base-metadata: (
4
+ title: "base",
5
+ tag: "base",
6
+ description: "cssfabric base config variables"
7
+ );
8
+
9
+ $base-config: (
10
+ cfg-has-dimension-strict: true,
11
+ CFG_HAS_DIMENSION_MIN: true,
12
+ CFG_HAS_DIMENSION_MAX: true,
13
+ size_step: 0.5rem,
14
+ sizes: utils.get_fabric_conf(sizes)
15
+ );
16
+
17
+ $base-docs: ();
@@ -0,0 +1,80 @@
1
+ @use "sass:map";
2
+ @use '../../../vendor/normalize/normalize.min.css';
3
+
4
+
5
+ p {
6
+ margin: auto;
7
+ }
8
+
9
+ .hover-parent {
10
+ .hover-show {
11
+ display: none;
12
+ }
13
+
14
+ .hover-hide {
15
+ display: initial;
16
+ }
17
+
18
+ &:hover {
19
+ .hover-show {
20
+ display: initial;
21
+ }
22
+
23
+ .hover-hide {
24
+ display: none;
25
+ }
26
+ }
27
+
28
+ }
29
+
30
+ .block:not(:last-child) {
31
+ margin-bottom: 1.5rem;
32
+ }
33
+
34
+ h1,
35
+ h2,
36
+ h3,
37
+ h4,
38
+ h5,
39
+ h6 {
40
+ margin-block-start: 0 !important;
41
+ margin-block-end: 0 !important;
42
+ margin-inline-start: 0 !important;
43
+ margin-inline-end: 0 !important;
44
+ }
45
+
46
+
47
+
48
+
49
+ label, .label {
50
+ padding: 0.125rem 0.5rem;
51
+ border: 1px solid #ccc;
52
+ display: inline-block;
53
+ border-radius: 4px;
54
+ background-color: #ededed;
55
+ text-shadow: white;
56
+ }
57
+
58
+ .box-content {
59
+ padding: 0.25rem;
60
+ margin: 0.25rem 0;
61
+ }
62
+
63
+ .cell-padding {
64
+ & > * {
65
+ padding: 0.25em;
66
+ }
67
+ }
68
+
69
+ .cell-spacing {
70
+ & > * {
71
+ margin: 0.25em;
72
+ }
73
+ }
74
+
75
+ code {
76
+ padding: 0.25em;
77
+ border: 1px solid #cccccc;
78
+ background-color: #ededed;
79
+ border-radius: 5px;
80
+ }
@@ -0,0 +1,215 @@
1
+ @use "sass:map";
2
+ @use "sass:math";
3
+ @use '../../_utils';
4
+ @use "../cssfabric-config";
5
+ @use "box-vars" as box;
6
+
7
+ $box-config: box.$box-config;
8
+ $box-docs: box.$box-docs;
9
+
10
+ $cssProps: map-get($box-config, cssProps);
11
+ $box-border-shorthands: map-get($cssProps, borderShorthands);
12
+ $box-position-props: map-get($cssProps, positionProps);
13
+ $box-display-props: map-get($cssProps, displayProps);
14
+
15
+ $box-unit-config: map-get($box-config, unit-config);
16
+ $box-border-unit-config: map-get($box-config, border-unit-config);
17
+ $box-unit-size-config: map-get($box-config, unit-size-config);
18
+ $box-unit-border-size-config: map-get($box-config, unit-border-size-config);
19
+ $box-sizes-config: map-get($box-config, sizes-config);
20
+ $box-border-sizes-px-config: map-get($box-config, border-sizes-px-config);
21
+
22
+ $box-position-shorthand-config: map-get($box-config, position-shorthand-config) !default;
23
+ $box-display-shorthand-config: map-get($box-config, display-shorthand-config) !default;
24
+ $box-shadow-shorthand-config: map-get($box-config, shadow-shorthand-config) !default;
25
+
26
+ $box-border-shorthand-config: map-get($box-config, border-shorthand-config) !default;
27
+ $box-padding-shorthand-config: map-get($box-config, padding-shorthand-config) !default;
28
+ $box-margin-shorthand-config: map-get($box-config, margin-shorthand-config) !default;
29
+
30
+ $box-shadows-steps: map-get($box-config, shadows-steps) !default;
31
+ $box-shadows-step-multiplier: map-get($box-config, shadows-step_multiplier) !default;
32
+
33
+ $css-shorthands: (
34
+ border: $box-border-shorthand-config,
35
+ padding: $box-padding-shorthand-config,
36
+ margin: $box-margin-shorthand-config
37
+ );
38
+
39
+
40
+ // adding {border}-{r} shorthand css rule for .{border}-{r}-1
41
+ @function raw_size_tag_rule($condition) {
42
+ @if ($condition==1) {
43
+ @return "&,";
44
+ } @else {
45
+ @return "";
46
+ }
47
+ }
48
+
49
+ @function write-box-rule($_args) {
50
+ $rule_value: map-get($_args, rule_value);
51
+ $rule_type: map-get($_args, rule_type);
52
+ $css_prop: map-get($_args, css_prop);
53
+ $grid_size_value: map-get($_args, grid_size_value);
54
+
55
+ $computed_value: "";
56
+
57
+
58
+ //
59
+ @if ($css_prop== "padding" or $css_prop== "margin") {
60
+ $computed_value: var(--box-sp-#{$grid_size_value});
61
+ }
62
+
63
+ // complex write method: 1px value
64
+ @if ($css_prop== "border") {
65
+ $computed_value: $rule_value + " solid #ccc";
66
+ }
67
+
68
+ @return $computed_value;
69
+ }
70
+
71
+ @mixin pmbCssVars() {
72
+ $iterator: $box-sizes-config;
73
+ @for $grid_size_value from 1 through $iterator {
74
+ $css_size_value: ($grid_size_value * $box-unit-size-config) + $box-unit-config;
75
+ --box-sp-#{$grid_size_value} : #{$css_size_value};
76
+ }
77
+ }
78
+
79
+ // prop : ...top bottom for border | margin | padding
80
+ @mixin fabric-pmb($fabric_box_position_prop, $fabric_box_position_prop_short) {
81
+ @each $fabric_box_pmb_side_shorthand, $rule in $box-border-shorthands {
82
+ $iterator: if($fabric_box_position_prop== border, $box-border-sizes-px-config, $box-sizes-config);
83
+ $unit: if($fabric_box_position_prop== border, $box-border-unit-config, $box-unit-config);
84
+ // box_unit_border_size
85
+ $unit_size: if($fabric_box_position_prop== border, $box-unit-border-size-config, $box-unit-size-config);
86
+
87
+ // css property name
88
+ // remove _ is present
89
+ $shorthand: if($fabric_box_pmb_side_shorthand== "_", "", -#{$fabric_box_pmb_side_shorthand});
90
+
91
+ .#{$fabric_box_position_prop_short}#{$shorthand} {
92
+ // todo use utils.getBoxIterator
93
+ @for $grid_size_value from 1 through $iterator {
94
+ $css_size_value: ($grid_size_value * $unit_size) + $unit;
95
+ // css property name is aggregated with size value $i
96
+ #{raw_size_tag_rule($grid_size_value)} &-#{$grid_size_value} {
97
+ @if length($rule) ==4 {
98
+ $_args: (
99
+ rule_value: $css_size_value,
100
+ rule_type: "pmb",
101
+ css_prop: $fabric_box_position_prop,
102
+ grid_size_value: $grid_size_value
103
+ );
104
+
105
+ #{$fabric_box_position_prop}: write-box-rule($_args);
106
+ } @else {
107
+
108
+ @each $rule_value in $rule {
109
+ $_args: (
110
+ rule_value: $css_size_value,
111
+ rule_type: "pmb",
112
+ css_prop: $fabric_box_position_prop,
113
+ grid_size_value: $grid_size_value
114
+ );
115
+
116
+ #{$fabric_box_position_prop}-#{$rule_value}: write-box-rule($_args);
117
+ }
118
+ }
119
+ }
120
+ }
121
+ }
122
+ }
123
+ }
124
+
125
+ // stupid, make three calls
126
+ // pmb as padding margin border property
127
+ @mixin padding-margin-border($mq_key) {
128
+ @each $box_pmb_shorthand_value, $box_pmb_shorthand in $css-shorthands {
129
+ $shorthand: if($mq_key, #{$box_pmb_shorthand}-#{$mq_key}, #{$box_pmb_shorthand});
130
+
131
+ @include fabric-pmb($box_pmb_shorthand_value, $shorthand);
132
+ }
133
+ }
134
+
135
+ // display property
136
+ @mixin display($mq_key) {
137
+
138
+ $shorthand: if($mq_key, #{$box-display-shorthand-config}-#{$mq_key}, #{$box-display-shorthand-config});
139
+
140
+ @each $css-shorthand, $css-value in $box-display-props {
141
+ // css property
142
+ $prop_re: #{$shorthand}-#{$css-shorthand};
143
+
144
+ .#{$prop_re} {
145
+ display: $css-value;
146
+ }
147
+ }
148
+ }
149
+
150
+ // position property
151
+ @mixin position($mq_key) {
152
+ $shorthand: if($mq_key, #{$box-position-shorthand-config}-#{$mq_key}, #{$box-position-shorthand-config});
153
+
154
+ @each $css-shorthand, $css-value in $box-position-props {
155
+ // css property
156
+ $prop_re: #{$shorthand}-#{$css-shorthand};
157
+
158
+ .#{$prop_re} {
159
+ position: $css-value;
160
+ // if sticky
161
+ @if sticky == $css-value {
162
+ top: 0;
163
+ margin-top: 0;
164
+ }
165
+ }
166
+ }
167
+ }
168
+
169
+ @function buildShadowsValues($shadows_step:0) {
170
+ $v_fact: 2.4;
171
+ $h_fact: 1.16;
172
+
173
+ $v_fact_2: 13.1;
174
+ $h_fact_2: 4.3;
175
+
176
+ $acc: 1;
177
+
178
+ $acc: $acc * $shadows_step * 2;
179
+ $v: $shadows_step * 2;
180
+
181
+ $v_val: math.div($acc, $v_fact);
182
+ $h_val: math.div($acc, $h_fact);
183
+
184
+ $v_val_2: math.div($acc, $v_fact_2);
185
+ $h_val_2: math.div($acc, $h_fact_2);
186
+
187
+ @return 0 #{$v_val}px #{$h_val}px 0 rgb(0 0 0 / 15%), 0 #{$v_val_2}px #{$h_val_2}px 0 rgb(0 0 0 / 10%);
188
+ }
189
+
190
+ @mixin shadows($mq_key) {
191
+ $shorthand: if($mq_key, #{$box-shadow-shorthand-config}-#{$mq_key}, #{$box-shadow-shorthand-config});
192
+
193
+ @for $shadows_step from 1 through $box-shadows-steps {
194
+
195
+ .#{$shorthand}-#{$shadows_step} {
196
+ box-shadow: var(--box-#{$shorthand}-#{$shadows_step});
197
+ }
198
+ }
199
+ }
200
+
201
+ // css vars rendered in :root
202
+ @mixin shadowsCssVars($mq_key:null) {
203
+ $shorthand: if($mq_key, #{$box-shadow-shorthand-config}-#{$mq_key}, #{$box-shadow-shorthand-config});
204
+
205
+ @for $shadows_step from 1 through $box-shadows-steps {
206
+ --box-#{$shorthand}-#{$shadows_step}: #{buildShadowsValues($shadows_step)};
207
+ }
208
+ }
209
+
210
+ @mixin buildBox($mq_key: null) {
211
+ @include padding-margin-border($mq_key);
212
+ @include display($mq_key);
213
+ @include position($mq_key);
214
+ @include shadows($mq_key);
215
+ }
@@ -0,0 +1,119 @@
1
+ @use '../../utils';
2
+
3
+ $_unit-config: rem;
4
+ $_border-unit-config: px;
5
+ $_unit-size-config: 0.5;
6
+ $_unit-border-size-config: 1;
7
+
8
+ $_sizes-config: 32;
9
+ $_sizes-border-config: 5;
10
+
11
+ $_shadows-steps: 10;
12
+ $_shadows-step-multiplier: 2;
13
+
14
+ $_shadows-v_fact: 2.4;
15
+ $_shadows-h_fact: 1.16;
16
+
17
+ $_shadows-v_fact_2: 13.1;
18
+ $_shadows-h_fact_2: 4.3;
19
+
20
+ $shadow-factors: (
21
+ v_fact:$_shadows-v_fact,
22
+ h_fact:$_shadows-h_fact,
23
+ v_fact_2:$_shadows-v_fact_2,
24
+ h_fact_2:$_shadows-h_fact_2,
25
+ );
26
+
27
+ $_border-shorthands: (
28
+ _: top bottom left right,
29
+ t: top,
30
+ b: bottom,
31
+ l: left,
32
+ r: right,
33
+ all: top bottom left right,
34
+ u: bottom left right,
35
+ ii: left right,
36
+ tb: top bottom
37
+ );
38
+
39
+ $_position-props: (
40
+ abs: absolute,
41
+ rel: relative,
42
+ stat: static,
43
+ fix: fixed,
44
+ sticky: sticky
45
+ );
46
+
47
+ $_display-props: (
48
+ block: block,
49
+ none: none,
50
+ inline: inline,
51
+ block-inline: inline-block,
52
+ flex-inline: inline-flex,
53
+ tbl: table,
54
+ tbl-row: table-row,
55
+ tbl-cell: table-cell,
56
+ tbl-column: table-column
57
+ );
58
+
59
+ $box-metadata: (
60
+ title: "box",
61
+ tag: "box",
62
+ description: "cssfabric box module to set heights, paddings, margins and shadows on all html elements"
63
+ );
64
+
65
+ $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,
74
+ //
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,
81
+ cssProps:(
82
+ borderShorthands: $_border-shorthands,
83
+ positionProps: $_position-props,
84
+ displayProps: $_display-props
85
+ )
86
+ );
87
+
88
+
89
+ $box-docs: (
90
+ attributes:(
91
+ 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))),
96
+ about: "padding properties for html elements"
97
+ ),
98
+ 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))),
103
+ about: "margin properties for html elements"
104
+ ),
105
+ 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))),
110
+ about: "border properties for html elements"
111
+ ),
112
+ 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))
116
+ ),
117
+ about: "applying shadows give depth and levels to your design"
118
+ )
119
+ ));
@@ -0,0 +1,18 @@
1
+
2
+ @use '../../_utils';
3
+ @use "_box-build" as build;
4
+ @use "../cssfabric-config";
5
+ // load general config variables
6
+ $config: cssfabric-config.$cssfabric-config;
7
+
8
+ $_media_quey_sizes: map-get($config, media_quey_sizes);
9
+
10
+ // builder responsive
11
+ $min_value: 0;
12
+
13
+ @each $mq_size_key, $mq_size_value in $_media_quey_sizes {
14
+ @include utils.fabricResponsiveEncloser($mq_size_value, $min_value) {
15
+ @include build.buildBox($mq_size_key);
16
+ }
17
+ $min_value: $mq_size_value;
18
+ }
@@ -0,0 +1,3 @@
1
+ @use "_box-build" as build;
2
+
3
+ @include build.buildBox();
@@ -0,0 +1,108 @@
1
+ @use "sass:map";
2
+ // load scss config file
3
+ @use '../../_utils';
4
+ @use 'color-vars';
5
+ @use "sass:math";
6
+
7
+ $color-config: color-vars.$color-config;
8
+
9
+ // COLOR TYPES
10
+ $color-types-config: map-get($color-config, color-types-config);
11
+
12
+ // COLOR SCHEMES
13
+ $color-schemes: map-get($color-config, scheme);
14
+
15
+ // COLOR PALETTE
16
+ $color-palette: map-get($color-config, palette);
17
+
18
+ // COLOR THEME
19
+ $color-theme: map-get($color-config, theme);
20
+
21
+ // 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;
26
+ $gray-schemes: utils.getGraySteps($color-gray-steps, $color-gray-start, $color-gray-end);
27
+
28
+ @function text-contrast($n) {
29
+ $color-brightness: round((red($n) * 299) + (green($n) * 587) + math.div(blue(#ffffff) * 114, 1000));
30
+ $light-color: round((red(#ffffff) * 299) + (green(#ffffff) * 587) + math.div(blue(#ffffff) * 114, 1000));
31
+ $color: black;
32
+
33
+ @if abs($color-brightness) < math.div($light-color,2) {
34
+ $color: white;
35
+ }
36
+
37
+ @return $color;
38
+ }
39
+
40
+ @mixin colorFactory($tag_short, $color_prop) {
41
+ $switch-tag_short: utils.getColorPropertyType($tag_short);
42
+
43
+ @each $colorTint in (light lighter dark darker complement invert) {
44
+
45
+ $newColor: utils.applyColorEffect($colorTint, $color_prop);
46
+
47
+ &-#{$colorTint} {
48
+ @if $tag_short== "bg-themed" {
49
+ color: text-contrast($newColor);
50
+ }
51
+ #{$switch-tag_short}: $newColor;
52
+ }
53
+ }
54
+ }
55
+
56
+ @mixin fabricColors($color-type,$color-type-list, $color-type-key, $mq-key, $has-color-factory:null) {
57
+
58
+ $switch-tag_short: utils.getColorPropertyType($color-type-key);
59
+
60
+ $prop: "";
61
+
62
+ $property_key: #{$color-type-key}-#{$color-type} + if($mq-key, -#{$mq-key}, "");
63
+ /**
64
+ #{$color-type-key} ?
65
+ */
66
+ .#{$property_key} {
67
+ @each $type-key, $type-prop in $color-type-list {
68
+ &#{"-" + $type-key} {
69
+
70
+ // border-color: ;
71
+ @if $color-type-key==border-color {
72
+ border-color: utils.applyColorEffect('dark',$type-prop)!important;
73
+ }
74
+
75
+ @if $color-type-key==color { // nope for gray
76
+ color: $type-prop;
77
+ @if $has-color-factory {
78
+ @include colorFactory($color-type-key, $type-prop);
79
+ }
80
+ }
81
+
82
+ @if $color-type-key==bg {
83
+ background-color: $type-prop;
84
+ @if $has-color-factory {
85
+ @include colorFactory($color-type-key, $type-prop);
86
+ }
87
+ }
88
+
89
+ @if $color-type-key == "bg-themed" {
90
+ color: text-contrast($type-prop);
91
+ text-shadow: 0 0 0.125rem utils.applyColorEffect("dark", $type-prop);
92
+ background-color: $type-prop;
93
+ @if $has-color-factory {
94
+ @include colorFactory($color-type-key, $type-prop);
95
+ }
96
+ }
97
+ }
98
+ }
99
+ }
100
+ }
101
+
102
+ @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("gray", $gray-schemes, $color-type-key, $mq_size_key);
107
+ }
108
+ }
@@ -0,0 +1,80 @@
1
+ @use '../../_utils';
2
+
3
+ $_color-types-config: (color bg bg-themed border-color);
4
+ $_color-tint: (_ lighter light dark darker complement); // invert
5
+
6
+ $color-metadata: (
7
+ title: color,
8
+ title_tag: "its about colors",
9
+ description: "cssfabric color system: its about colors"
10
+ );
11
+ $color-config: (
12
+ gray-config: utils.get_fabric_conf(gray-config),
13
+ color-types-config: $_color-types-config,
14
+ theme: utils.get_fabric_conf(theme),
15
+ scheme: utils.get_fabric_conf(scheme),
16
+ palette: utils.get_fabric_conf(palette),
17
+ gray: utils.get_fabric_conf(gray)
18
+ );
19
+
20
+ $color-docs: (
21
+ attributes: (
22
+ color: (
23
+ tag: color,
24
+ keys: (
25
+ scheme palette gray
26
+ ),
27
+ levelsLinked: (
28
+ scheme: utils.getObjectKeys(utils.get_fabric_conf(scheme)),
29
+ palette: utils.getObjectKeys(utils.get_fabric_conf(palette)),
30
+ gray: utils.getObjectKeys(utils.get_fabric_conf(gray))
31
+ ),
32
+ levelsDeclin: (
33
+ palette: $_color-tint
34
+ ),
35
+ about: "color for text level html elements"
36
+ ),
37
+ background-color: (
38
+ tag: bg,
39
+ keys: (
40
+ scheme palette gray
41
+ ),
42
+ levelsLinked: (
43
+ scheme: utils.getObjectKeys(utils.get_fabric_conf(scheme)),
44
+ palette: utils.getObjectKeys(utils.get_fabric_conf(palette)),
45
+ gray: utils.getObjectKeys(utils.get_fabric_conf(gray)) // prefix with gray
46
+ ),
47
+ levelsDeclin: (
48
+ palette: $_color-tint
49
+ ),
50
+ about: "background colors"
51
+ ),
52
+ background-themed: (
53
+ tag: "bg-themed",
54
+ keys: (
55
+ scheme palette gray
56
+ ),
57
+ levelsLinked: (
58
+ gray: utils.getObjectKeys(utils.get_fabric_conf(gray)),
59
+ scheme: utils.getObjectKeys(utils.get_fabric_conf(scheme)),
60
+ palette: utils.getObjectKeys(utils.get_fabric_conf(palette))
61
+ ),
62
+ levelsDeclin: (
63
+ palette: $_color-tint
64
+ ),
65
+ about: "same as background-color, but with added contrasted color to text"
66
+ ),
67
+ border-color: (
68
+ tag: border-color,
69
+ keys: (
70
+ palette gray
71
+ ),
72
+ levelsLinked: (
73
+ gray: utils.getObjectKeys(utils.get_fabric_conf(gray)),
74
+ scheme: utils.getObjectKeys(utils.get_fabric_conf(scheme)),
75
+ palette: utils.getObjectKeys(utils.get_fabric_conf(palette))
76
+ ),
77
+ about: "border colors are slightly darker to maximize surrounding effect"
78
+ )
79
+ )
80
+ );
@@ -0,0 +1,23 @@
1
+
2
+ @use "sass:map";
3
+ // load scss config file
4
+ @use '../../_utils';
5
+ @use 'color-build' as build;
6
+ @use "../cssfabric-config";
7
+ // load general config variables
8
+ $config: cssfabric-config.$cssfabric-config;
9
+
10
+ // load general config variables
11
+ // media queries sizes, in rem
12
+ $_media_quey_sizes: map-get($config, media_quey_sizes);
13
+
14
+ // builder responsive
15
+ $min_value: 0;
16
+
17
+ @each $mq_size_key,
18
+ $mq_size_value in $_media_quey_sizes {
19
+ @include utils.fabricResponsiveEncloser($mq_size_value,$min_value) {
20
+ @include build.buildColor($mq_size_key);
21
+ }
22
+ $min_value: $mq_size_value;
23
+ }
@@ -0,0 +1,3 @@
1
+ @use '_color-build' as build;
2
+
3
+ @include build.buildColor(null);
@@ -0,0 +1,2 @@
1
+ @use '../../../src/vendor/normalize/normalize.min.css';
2
+