@medyll/cssfabric 0.2.0 → 0.2.3

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 (211) hide show
  1. package/.github/workflows/main.yml +33 -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/bin/index.js +8 -0
  8. package/cssfabric.sass.js +8 -0
  9. package/gulpfile.js +532 -0
  10. package/package.json +17 -61
  11. package/src/app.css +107 -0
  12. package/src/app.d.ts +15 -0
  13. package/src/app.html +13 -0
  14. package/src/components/Header.svelte +17 -0
  15. package/src/components/HeaderSiteTitle.svelte +12 -0
  16. package/src/components/InnerMenu.svelte +27 -0
  17. package/src/components/SubHeader.svelte +10 -0
  18. package/src/components/SubHeaderH.svelte +3 -0
  19. package/src/components/SubSubHeader.svelte +22 -0
  20. package/src/components/demo/DemoElement.svelte +86 -0
  21. package/src/components/demo/elements/DemoElementBackgroundColor.svelte +7 -0
  22. package/src/components/demo/elements/DemoElementBorder.svelte +8 -0
  23. package/src/components/demo/elements/DemoElementBorderColor.svelte +8 -0
  24. package/src/components/demo/elements/DemoElementColor.svelte +8 -0
  25. package/src/components/demo/elements/DemoElementGrid.svelte +53 -0
  26. package/src/components/demo/elements/DemoElementMargin.svelte +8 -0
  27. package/src/components/demo/elements/DemoElementPadding.svelte +10 -0
  28. package/src/components/demo/elements/DemoElementScale.svelte +9 -0
  29. package/src/components/demo/elements/DemoElementTable.svelte +34 -0
  30. package/src/components/demo/elements/DemoElementText.svelte +10 -0
  31. package/src/components/demo/proxy/ProxyDsp.svelte +12 -0
  32. package/src/components/demo/proxy/ProxyDspArray.svelte +19 -0
  33. package/src/components/demo/proxy/ProxyDspObject.svelte +17 -0
  34. package/src/components/docs/Docs.svelte +97 -0
  35. package/src/components/docs/DocsClassNames.svelte +34 -0
  36. package/src/components/docs/DocsDemo.svelte +84 -0
  37. package/src/components/header/Header.svelte +105 -0
  38. package/src/components/header/svelte-logo.svg +1 -0
  39. package/src/cssfabric/_utils.scss +203 -0
  40. package/{_generated → src/cssfabric}/index.d.ts +0 -0
  41. package/src/cssfabric/modules/_cssfabric-config.scss +173 -0
  42. package/src/cssfabric/modules/_mixins.scss +1 -0
  43. package/src/cssfabric/modules/animation/_animation-vars.scss +17 -0
  44. package/src/cssfabric/modules/animation/animation.scss +3 -0
  45. package/src/cssfabric/modules/base/_base-vars.scss +19 -0
  46. package/src/cssfabric/modules/base/base.scss +75 -0
  47. package/src/cssfabric/modules/box/_box-build.scss +304 -0
  48. package/src/cssfabric/modules/box/_box-vars.scss +121 -0
  49. package/src/cssfabric/modules/box/box-responsive.scss +18 -0
  50. package/src/cssfabric/modules/box/box.scss +3 -0
  51. package/src/cssfabric/modules/color/_color-build.scss +196 -0
  52. package/src/cssfabric/modules/color/_color-vars.scss +80 -0
  53. package/src/cssfabric/modules/color/color-responsive.scss +23 -0
  54. package/src/cssfabric/modules/color/color.scss +9 -0
  55. package/src/cssfabric/modules/css-fabric.scss +2 -0
  56. package/src/cssfabric/modules/flex/_flex-build.scss +150 -0
  57. package/src/cssfabric/modules/flex/_flex-vars.scss +84 -0
  58. package/src/cssfabric/modules/flex/flex-responsive.scss +25 -0
  59. package/src/cssfabric/modules/flex/flex.scss +3 -0
  60. package/src/cssfabric/modules/grid/_grid-build.scss +84 -0
  61. package/src/cssfabric/modules/grid/_grid-vars.scss +88 -0
  62. package/src/cssfabric/modules/grid/grid-responsive.scss +25 -0
  63. package/src/cssfabric/modules/grid/grid.scss +6 -0
  64. package/src/cssfabric/modules/menu/_menu-build.scss +120 -0
  65. package/src/cssfabric/modules/menu/_menu-vars.scss +29 -0
  66. package/src/cssfabric/modules/menu/menu-responsive.scss +19 -0
  67. package/src/cssfabric/modules/menu/menu.scss +6 -0
  68. package/src/cssfabric/modules/overflow/_overflow-build.scss +22 -0
  69. package/src/cssfabric/modules/overflow/_overflow-vars.scss +31 -0
  70. package/src/cssfabric/modules/overflow/overflow-responsive.scss +25 -0
  71. package/src/cssfabric/modules/overflow/overflow.scss +7 -0
  72. package/src/cssfabric/modules/scale/_scale-build.scss +142 -0
  73. package/src/cssfabric/modules/scale/_scale-vars.scss +84 -0
  74. package/src/cssfabric/modules/scale/scale-responsive.scss +23 -0
  75. package/src/cssfabric/modules/scale/scale.scss +8 -0
  76. package/src/cssfabric/modules/table/_table-build.scss +134 -0
  77. package/src/cssfabric/modules/table/_table-vars.scss +30 -0
  78. package/src/cssfabric/modules/table/table-responsive.scss +24 -0
  79. package/src/cssfabric/modules/table/table.scss +8 -0
  80. package/src/cssfabric/modules/text/_text-build.scss +166 -0
  81. package/src/cssfabric/modules/text/_text-vars.scss +87 -0
  82. package/src/cssfabric/modules/text/text-responsive.scss +26 -0
  83. package/src/cssfabric/modules/text/text.scss +6 -0
  84. package/src/cssfabric/modules/theme/_theme-build.scss +133 -0
  85. package/src/cssfabric/modules/theme/_theme-vars.scss +46 -0
  86. package/src/cssfabric/modules/theme/theme.scss +6 -0
  87. package/src/cssfabric/modules/vars.scss +49 -0
  88. package/src/cssfabric/modules/zindex/_zindex-vars.scss +14 -0
  89. package/src/cssfabric/modules/zindex/zindex.scss +15 -0
  90. package/src/hooks.ts +27 -0
  91. package/src/index.d.ts +3 -0
  92. package/src/index.ts +4 -0
  93. package/{_generated → src/lib/_generated}/cssFabric.vars.json +1 -1
  94. package/{_generated → src/lib/_generated}/export.variables.md +0 -0
  95. package/src/lib/_generated/index.d.ts +3 -0
  96. package/{_generated → src/lib/_generated}/readme.md +0 -0
  97. package/{init/importCssVars.js → src/lib/init/importCssVars.ts} +3 -2
  98. package/src/lib/scripts/cssfabric.ts +54 -0
  99. package/{scripts/cssfabricClassNames.js → src/lib/scripts/cssfabricClassNames.ts} +112 -42
  100. package/{scripts → src/lib/scripts}/index.d.ts +0 -0
  101. package/src/lib/scripts/index.ts +8 -0
  102. package/src/lib/scripts/utils.ts +37 -0
  103. package/{styles → src/lib/styles}/animation/animation.css +0 -0
  104. package/{styles → src/lib/styles}/animation/animation.min.css +0 -0
  105. package/{styles → src/lib/styles}/base/base.css +0 -0
  106. package/{styles → src/lib/styles}/base/base.min.css +0 -0
  107. package/{styles → src/lib/styles}/box/box.css +0 -0
  108. package/{styles → src/lib/styles}/box/box.min.css +0 -0
  109. package/{styles → src/lib/styles}/box/box.responsive.css +0 -0
  110. package/{styles → src/lib/styles}/box/box.responsive.min.css +0 -0
  111. package/{styles → src/lib/styles}/color/color.css +0 -0
  112. package/{styles → src/lib/styles}/color/color.min.css +0 -0
  113. package/{styles → src/lib/styles}/color/color.responsive.css +0 -0
  114. package/{styles → src/lib/styles}/color/color.responsive.min.css +0 -0
  115. package/src/lib/styles/cssfabric.css +129144 -0
  116. package/src/lib/styles/cssfabric.min.css +350 -0
  117. package/src/lib/styles/cssfabric.responsive.css +418463 -0
  118. package/src/lib/styles/cssfabric.responsive.min.css +225 -0
  119. package/{styles → src/lib/styles}/flex/flex.css +0 -0
  120. package/{styles → src/lib/styles}/flex/flex.min.css +0 -0
  121. package/{styles → src/lib/styles}/flex/flex.responsive.css +0 -0
  122. package/{styles → src/lib/styles}/flex/flex.responsive.min.css +0 -0
  123. package/{styles → src/lib/styles}/grid/grid.css +0 -0
  124. package/{styles → src/lib/styles}/grid/grid.min.css +0 -0
  125. package/{styles → src/lib/styles}/grid/grid.responsive.css +0 -0
  126. package/{styles → src/lib/styles}/grid/grid.responsive.min.css +0 -0
  127. package/{styles → src/lib/styles}/menu/menu.css +0 -0
  128. package/{styles → src/lib/styles}/menu/menu.min.css +0 -0
  129. package/{styles → src/lib/styles}/menu/menu.responsive.css +0 -0
  130. package/{styles → src/lib/styles}/menu/menu.responsive.min.css +0 -0
  131. package/{styles → src/lib/styles}/overflow/overflow.css +0 -0
  132. package/{styles → src/lib/styles}/overflow/overflow.min.css +0 -0
  133. package/{styles → src/lib/styles}/overflow/overflow.responsive.css +0 -0
  134. package/{styles → src/lib/styles}/overflow/overflow.responsive.min.css +0 -0
  135. package/{styles → src/lib/styles}/scale/scale.css +0 -0
  136. package/{styles → src/lib/styles}/scale/scale.min.css +0 -0
  137. package/{styles → src/lib/styles}/scale/scale.responsive.css +0 -0
  138. package/{styles → src/lib/styles}/scale/scale.responsive.min.css +0 -0
  139. package/{styles → src/lib/styles}/table/table.css +0 -0
  140. package/{styles → src/lib/styles}/table/table.min.css +0 -0
  141. package/{styles → src/lib/styles}/table/table.responsive.css +0 -0
  142. package/{styles → src/lib/styles}/table/table.responsive.min.css +0 -0
  143. package/{styles → src/lib/styles}/text/text.css +0 -0
  144. package/{styles → src/lib/styles}/text/text.min.css +0 -0
  145. package/{styles → src/lib/styles}/text/text.responsive.css +0 -0
  146. package/{styles → src/lib/styles}/text/text.responsive.min.css +0 -0
  147. package/{styles → src/lib/styles}/theme/theme.css +48 -0
  148. package/{styles → src/lib/styles}/theme/theme.min.css +1 -1
  149. package/{styles → src/lib/styles}/vars.css +1 -1
  150. package/{styles → src/lib/styles}/vars.min.css +0 -0
  151. package/{styles → src/lib/styles}/zindex/zindex.css +0 -0
  152. package/{styles → src/lib/styles}/zindex/zindex.min.css +0 -0
  153. package/src/routes/__layout.svelte +91 -0
  154. package/src/routes/cssfabric-modules/[module]/__layout.svelte +75 -0
  155. package/src/routes/cssfabric-modules/[module]/classnames/index.svelte +24 -0
  156. package/src/routes/cssfabric-modules/[module]/demo/index.svelte +24 -0
  157. package/src/routes/cssfabric-modules/[module]/docs/index.svelte +30 -0
  158. package/src/routes/cssfabric-modules/[module]/index.svelte +3 -0
  159. package/src/routes/cssfabric-modules/__layout.svelte +26 -0
  160. package/src/routes/cssfabric-modules/index.svelte +0 -0
  161. package/src/routes/index.svelte +62 -0
  162. package/src/routes/installation/__layout.svelte +1 -0
  163. package/src/routes/installation/index.svelte +28 -0
  164. package/src/scripts/utils.ts +26 -0
  165. package/src/utils.ts +71 -0
  166. package/src/vendor/index.d.ts +3 -0
  167. package/src/vendor/normalize/normalize.min.css +2 -0
  168. package/src/vendor/sass-json-export/CHANGELOG.md +26 -0
  169. package/src/vendor/sass-json-export/Gruntfile.js +60 -0
  170. package/src/vendor/sass-json-export/LICENSE +20 -0
  171. package/src/vendor/sass-json-export/README.md +90 -0
  172. package/src/vendor/sass-json-export/package.json +60 -0
  173. package/src/vendor/sass-json-export/stylesheets/encode/api/_json.scss +26 -0
  174. package/src/vendor/sass-json-export/stylesheets/encode/encode.scss +17 -0
  175. package/src/vendor/sass-json-export/stylesheets/encode/helpers/_quote.scss +9 -0
  176. package/src/vendor/sass-json-export/stylesheets/encode/mixins/_json.scss +42 -0
  177. package/src/vendor/sass-json-export/stylesheets/encode/types/_bool.scss +7 -0
  178. package/src/vendor/sass-json-export/stylesheets/encode/types/_color.scss +8 -0
  179. package/src/vendor/sass-json-export/stylesheets/encode/types/_list.scss +14 -0
  180. package/src/vendor/sass-json-export/stylesheets/encode/types/_map.scss +15 -0
  181. package/src/vendor/sass-json-export/stylesheets/encode/types/_null.scss +7 -0
  182. package/src/vendor/sass-json-export/stylesheets/encode/types/_number.scss +8 -0
  183. package/src/vendor/sass-json-export/stylesheets/encode/types/_string.scss +8 -0
  184. package/src/vendor/sass-json-export/stylesheets/sass-json-export.scss +2 -0
  185. package/src/vendor/sass-json-export/test/encode/_index.scss +14 -0
  186. package/src/vendor/sass-json-export/test/encode/api/_json.scss +29 -0
  187. package/src/vendor/sass-json-export/test/encode/helpers/_quote.scss +6 -0
  188. package/src/vendor/sass-json-export/test/encode/types/_bool.scss +6 -0
  189. package/src/vendor/sass-json-export/test/encode/types/_color.scss +7 -0
  190. package/src/vendor/sass-json-export/test/encode/types/_list.scss +25 -0
  191. package/src/vendor/sass-json-export/test/encode/types/_map.scss +17 -0
  192. package/src/vendor/sass-json-export/test/encode/types/_null.scss +8 -0
  193. package/src/vendor/sass-json-export/test/encode/types/_number.scss +68 -0
  194. package/src/vendor/sass-json-export/test/encode/types/_string.scss +9 -0
  195. package/src/vendor/sass-json-export/test/test.scss +9 -0
  196. package/static/favicon.png +0 -0
  197. package/static/robots.txt +3 -0
  198. package/svelte.config.js +25 -0
  199. package/tsconfig.json +3 -0
  200. package/webpack.config.js +55 -0
  201. package/init/importCssVars.d.ts +0 -1
  202. package/scripts/cssfabric.d.ts +0 -24
  203. package/scripts/cssfabric.js +0 -43
  204. package/scripts/cssfabricClassNames.d.ts +0 -14
  205. package/scripts/index.js +0 -4
  206. package/scripts/utils.d.ts +0 -5
  207. package/scripts/utils.js +0 -38
  208. package/styles/cssfabric.css +0 -61792
  209. package/styles/cssfabric.min.css +0 -168
  210. package/styles/cssfabric.responsive.css +0 -200596
  211. package/styles/cssfabric.responsive.min.css +0 -108
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,17 @@
1
+ $animation-metadata: (
2
+ title: "animation",
3
+ description: "cssfabric simplest animation module"
4
+ );
5
+ $animation-config: (
6
+ attention_props: (),
7
+ in_out_props: (
8
+ back: () /* bounce: (),
9
+ slide: (),
10
+ fade: (),
11
+ zoom: () */
12
+ )
13
+ );
14
+ $animation-docs: (
15
+ attention_props: "",
16
+ in_out_props: ""
17
+ );
@@ -0,0 +1,3 @@
1
+ // @use 'animation-build' as build;
2
+
3
+ // @include build.buildAnimation();
@@ -0,0 +1,19 @@
1
+
2
+ @use '../../_utils';
3
+
4
+ $base-metadata: (
5
+ title: "base",
6
+ tag: "base",
7
+ description: "cssfabric base config variables"
8
+ );
9
+
10
+ $base-config: (
11
+ cfg-has-dimension-strict: true,
12
+ CFG_HAS_DIMENSION_MIN: true,
13
+ CFG_HAS_DIMENSION_MAX: true,
14
+ size_step: 0.5rem,
15
+ sizes: utils.get_fabric_conf(sizes)
16
+ );
17
+
18
+ $base-docs: (
19
+ );
@@ -0,0 +1,75 @@
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
+
@@ -0,0 +1,304 @@
1
+ @use "sass:map";
2
+ @use "sass:math";
3
+ @use '../../_utils';
4
+ @use "../cssfabric-config";
5
+ @use "box-vars" as box;
6
+
7
+ $fabric-config: cssfabric-config.$cssfabric-config;
8
+ $box-config: box.$box-config;
9
+ $box-docs: box.$box-docs;
10
+
11
+ $box-border-shorthands: box.$box-border-shorthands;
12
+ $box-position-props: box.$box-position-shorthands;
13
+ $box-display-props: box.$box-display-shorthands;
14
+
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;
21
+
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;
25
+
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;
29
+
30
+ $box-gap-shorthand: cssfabric-config.$box-gap-shorthand !default;
31
+
32
+ $box-shadows-steps: box.$box-shadows-steps !default;
33
+ $box-shadows-step-multiplier: box.$box-shadows-step-multiplier !default;
34
+
35
+ $box-radius: cssfabric-config.$box-radius;
36
+ $box-unit-presets: cssfabric-config.$box-unit-presets;
37
+
38
+ $densities-ratios : cssfabric-config.$densities-ratios;
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
+ // support ratios
50
+ // for paddings margins positions
51
+ @mixin pmbCssVars() {
52
+ $iterator: $box-sizes-config;
53
+ @for $grid_size_value from 0 through $iterator {
54
+ $css_size_value: ($grid_size_value * $box-unit-size-config) + $box-unit-config;
55
+ --box-density-#{$grid_size_value} : #{$css_size_value};
56
+ }
57
+
58
+ // presets
59
+ @each $preset, $preset-value in $box-unit-presets{
60
+ $value: ($preset-value * $box-unit-size-config) + $box-unit-config;
61
+ --box-density-preset-#{$preset}: #{$value};
62
+ }
63
+
64
+ // radius
65
+ @each $radius, $value in $box-radius{
66
+ --radius-#{$radius}: #{$value};
67
+ }
68
+
69
+ // $ratios: tiny small medium large full
70
+ @each $ratio, $val in $densities-ratios {
71
+ [density=#{$ratio}] {
72
+ @for $grid_size_value from 0 through $iterator {
73
+ $css_size_value: (($grid_size_value * $box-unit-size-config)*$val) + $box-unit-config;
74
+ --box-density-#{$grid_size_value} : #{$css_size_value};
75
+ }
76
+ // presets
77
+ @each $preset, $preset-value in $box-unit-presets{
78
+ $value: (($preset-value * $box-unit-size-config)*$val) + $box-unit-config;
79
+ --box-density-preset-#{$preset}: #{$value};
80
+ }
81
+ }
82
+ }
83
+ }
84
+
85
+ // border
86
+ @mixin fabric-pmb($fabric_box_position_prop, $fabric_box_position_prop_short) {
87
+ @each $fabric_box_pmb_side_shorthand, $rule in $box-border-shorthands {
88
+
89
+ // remove _ if present
90
+ $shorthand: if($fabric_box_pmb_side_shorthand== "_", "", -#{$fabric_box_pmb_side_shorthand});
91
+
92
+ .#{$fabric_box_position_prop_short}#{$shorthand} {
93
+
94
+ @for $grid_size_value from 1 through $box-border-sizes-px-config {
95
+ $css_size_value: ($grid_size_value * $box-unit-border-size-config) + $box-border-unit-config;
96
+ // css property name is aggregated with size value $i
97
+
98
+ $computed_value: $css_size_value + " solid var(--theme-color-border)";
99
+
100
+ #{raw_size_tag_rule($grid_size_value)} &-#{$grid_size_value} {
101
+ @if length($rule) == 4 {
102
+ #{$fabric_box_position_prop}: #{$computed_value};
103
+ } @else {
104
+
105
+ @each $rule_value in $rule {
106
+ #{$fabric_box_position_prop}-#{$rule_value}: #{$computed_value};
107
+ }
108
+ }
109
+ }
110
+ }
111
+ }
112
+ }
113
+ }
114
+
115
+ // prop : ... margin | padding
116
+ @mixin fabric-pm($fabric_box_position_prop, $fabric_box_position_prop_short) {
117
+ @each $fabric_box_pmb_side_shorthand, $rule in $box-border-shorthands {
118
+
119
+ $shorthand: if($fabric_box_pmb_side_shorthand== "_", "", -#{$fabric_box_pmb_side_shorthand});
120
+
121
+ .#{$fabric_box_position_prop_short}#{$shorthand} {
122
+
123
+ // presets
124
+ @each $preset, $preset-value in $box-unit-presets{
125
+ .#{$fabric_box_position_prop_short}#{$shorthand}-#{$preset}{
126
+ #{$fabric_box_position_prop}: var(--box-density-preset-#{$preset});
127
+ }
128
+ }
129
+
130
+ @for $grid_size_value from 1 through $box-sizes-config {
131
+ $css_size_value: ($grid_size_value * $box-unit-size-config) + $box-unit-config;
132
+ // css property name is aggregated with size value $i
133
+
134
+ $computed_value: var(--box-density-#{$grid_size_value});
135
+
136
+ #{raw_size_tag_rule($grid_size_value)} &-#{$grid_size_value} {
137
+ @if length($rule) == 4 {
138
+ #{$fabric_box_position_prop}: #{$computed_value};
139
+ } @else {
140
+ @each $rule_value in $rule {
141
+ #{$fabric_box_position_prop}-#{$rule_value}: #{$computed_value};
142
+ }
143
+ }
144
+ }
145
+ }
146
+ }
147
+ }
148
+ }
149
+
150
+ @mixin box-gap($mq_key) {
151
+ $shorthand: if($mq_key, #{$box-gap-shorthand}-#{$mq_key}, #{$box-gap-shorthand});
152
+ // presets
153
+ @each $preset, $preset-value in $box-unit-presets{
154
+ .#{$shorthand}-#{$preset}{
155
+ #{$shorthand}: var(--box-density-preset-#{$preset});
156
+ }
157
+ }
158
+ }
159
+ // pmb as padding margin border property
160
+ // padding-tiny padding-small padding
161
+ @mixin padding-margin-border($mq_key) {
162
+
163
+ $shorthand: if($mq_key, #{$box-margin-shorthand-config}-#{$mq_key}, #{$box-margin-shorthand-config});
164
+ @include fabric-pm(margin, $shorthand);
165
+
166
+ $shorthand: if($mq_key, #{$box-padding-shorthand-config}-#{$mq_key}, #{$box-padding-shorthand-config});
167
+ @include fabric-pm(padding, $shorthand);
168
+
169
+ $shorthand: if($mq_key, #{$box-border-shorthand-config}-#{$mq_key}, #{$box-border-shorthand-config});
170
+ @include fabric-pmb(border, $shorthand);
171
+
172
+ }
173
+
174
+ // radius
175
+ @mixin radius($mq_key) {
176
+ $shorthand: if($mq_key, radius-#{$mq_key}, radius);
177
+
178
+ /*radius*/
179
+ @each $radius, $value in $box-radius {
180
+ .#{$shorthand}-#{$radius} {
181
+ border-radius: #{$value};
182
+
183
+ &-t {
184
+ border-top-left-radius: #{$value};
185
+ border-top-right-radius: #{$value}
186
+ }
187
+
188
+ &-b {
189
+ border-bottom-left-radius: #{$value};
190
+ border-bottom-right-radius: #{$value}
191
+ }
192
+
193
+ &-l {
194
+ border-top-left-radius: #{$value};
195
+ border-bottom-left-radius: #{$value}
196
+ }
197
+
198
+ &-r {
199
+ border-top-right-radius: #{$value};
200
+ border-bottom-right-radius: #{$value}
201
+ }
202
+ }
203
+ }
204
+ }
205
+
206
+ // placement property -- top-0/8
207
+ @mixin placement($mq_key) {
208
+ $shorthand: if($mq_key, #{$mq_key}-, '');
209
+ $places: (top, right, bottom, left);
210
+
211
+ /*placement*/
212
+ @each $place in $places {
213
+ @for $size from 0 through 8 {
214
+ .#{$place}-#{$shorthand}#{$size} {
215
+ #{$place}: var(--box-density-#{$size});
216
+ }
217
+ }
218
+ }
219
+ }
220
+
221
+ // display property
222
+ @mixin display($mq_key) {
223
+
224
+ $shorthand: if($mq_key, #{$box-display-shorthand-config}-#{$mq_key}, #{$box-display-shorthand-config});
225
+
226
+ @each $css-shorthand, $css-value in $box-display-props {
227
+ // css property
228
+ $prop_re: #{$shorthand}-#{$css-shorthand};
229
+
230
+ .#{$prop_re} {
231
+ display: $css-value;
232
+ }
233
+ }
234
+ }
235
+
236
+ // position property
237
+ @mixin position($mq_key) {
238
+ $shorthand: if($mq_key, #{$box-position-shorthand-config}-#{$mq_key}, #{$box-position-shorthand-config});
239
+
240
+ @each $css-shorthand, $css-value in $box-position-props {
241
+ // css property
242
+ $prop_re: #{$shorthand}-#{$css-shorthand};
243
+
244
+ .#{$prop_re} {
245
+ position: $css-value;
246
+ // if sticky
247
+ @if sticky == $css-value {
248
+ top: 0;
249
+ margin-top: 0;
250
+ }
251
+ }
252
+ }
253
+ }
254
+
255
+ @function buildShadowsValues($shadows_step:0,$shadow-color: null) {
256
+ $v_fact: 2.4;
257
+ $h_fact: 1.16;
258
+
259
+ $v_fact_2: 13.1;
260
+ $h_fact_2: 4.3;
261
+
262
+ $acc: 1;
263
+
264
+ $acc: $acc * $shadows_step * 2;
265
+ $v: $shadows_step * 2;
266
+
267
+ $v_val: math.div($acc, $v_fact);
268
+ $h_val: math.div($acc, $h_fact);
269
+
270
+ $v_val_2: math.div($acc, $v_fact_2);
271
+ $h_val_2: math.div($acc, $h_fact_2);
272
+
273
+ @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%);
274
+ }
275
+
276
+ @mixin shadows($mq_key) {
277
+ $shorthand: if($mq_key, #{$box-shadow-shorthand-config}-#{$mq_key}, #{$box-shadow-shorthand-config});
278
+
279
+ @for $shadows_step from 1 through $box-shadows-steps {
280
+
281
+ .#{$shorthand}-#{$shadows_step} {
282
+ box-shadow: var(--box-#{$shorthand}-#{$shadows_step});
283
+ }
284
+ }
285
+ }
286
+
287
+ // css vars rendered in :root
288
+ @mixin shadowsCssVars($mq_key:null) {
289
+ $shorthand: if($mq_key, #{$box-shadow-shorthand-config}-#{$mq_key}, #{$box-shadow-shorthand-config});
290
+
291
+ @for $shadows_step from 1 through $box-shadows-steps {
292
+ --box-#{$shorthand}-#{$shadows_step}: #{buildShadowsValues($shadows_step)};
293
+ }
294
+ }
295
+
296
+ @mixin buildBox($mq_key: null) {
297
+ @include padding-margin-border($mq_key);
298
+ @include display($mq_key);
299
+ @include position($mq_key);
300
+ @include placement($mq_key);
301
+ @include radius($mq_key);
302
+ @include shadows($mq_key);
303
+ @include box-gap($mq_key);
304
+ }
@@ -0,0 +1,121 @@
1
+ @use '../../utils';
2
+ @use "../cssfabric-config";
3
+
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;
8
+
9
+ $box-sizes-config: 12;
10
+ $box-sizes-border-config: 3;
11
+
12
+ $box-shadows-steps: 5;
13
+ $box-shadows-step-multiplier: 2;
14
+
15
+ $_shadows-v_fact: 2.4;
16
+ $_shadows-h_fact: 1.16;
17
+
18
+ $_shadows-v_fact_2: 13.1;
19
+ $_shadows-h_fact_2: 4.3;
20
+
21
+ $shadow-factors: (
22
+ v_fact:$_shadows-v_fact,
23
+ h_fact:$_shadows-h_fact,
24
+ v_fact_2:$_shadows-v_fact_2,
25
+ h_fact_2:$_shadows-h_fact_2,
26
+ )!default;
27
+
28
+ $box-border-shorthands: (
29
+ _: top bottom left right,
30
+ t: top,
31
+ b: bottom,
32
+ l: left,
33
+ r: right,
34
+ all: top bottom left right,
35
+ u: bottom left right,
36
+ ii: left right,
37
+ tb: top bottom
38
+ )!default;
39
+
40
+ $box-position-shorthands: (
41
+ abs: absolute,
42
+ rel: relative,
43
+ stat: static,
44
+ fix: fixed,
45
+ sticky: sticky
46
+ )!default;
47
+
48
+ $box-display-shorthands: (
49
+ block: block,
50
+ none: none,
51
+ inline: inline,
52
+ block-inline: inline-block,
53
+ flex-inline: inline-flex,
54
+ tbl: table,
55
+ tbl-row: table-row,
56
+ tbl-cell: table-cell,
57
+ tbl-column: table-column
58
+ );
59
+
60
+ $box-metadata: (
61
+ title: "box",
62
+ tag: "box",
63
+ description: "cssfabric box module to set heights, paddings, margins and shadows on all html elements"
64
+ );
65
+
66
+ $box-config: (
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,
75
+ //
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
+
83
+ cssProps:(
84
+ borderShorthands: $box-border-shorthands,
85
+ positionProps: $box-position-shorthands,
86
+ displayProps: $box-display-shorthands
87
+ )
88
+ );
89
+
90
+ $box-docs: (
91
+ attributes:(
92
+ padding: (
93
+ tag: cssfabric-config.$box-padding-shorthand,
94
+ keys: utils.getObjectKeys($box-border-shorthands),
95
+ values: utils.getBoxIterator($box-sizes-config, $box-unit-config, $box-unit-size-config),
96
+ levels: ("_":utils.getObjectKeys(utils.getBoxIterator($box-sizes-config, $box-unit-config, $box-unit-size-config))),
97
+ about: "padding properties for html elements"
98
+ ),
99
+ margin: (
100
+ tag: cssfabric-config.$box-margin-shorthand,
101
+ keys: utils.getObjectKeys($box-border-shorthands),
102
+ values: utils.getBoxIterator($box-sizes-config, $box-unit-config, $box-unit-size-config),
103
+ levels: ("_":utils.getObjectKeys(utils.getBoxIterator($box-sizes-config, $box-unit-config, $box-unit-size-config))),
104
+ about: "margin properties for html elements"
105
+ ),
106
+ border: (
107
+ tag: cssfabric-config.$box-border-shorthand,
108
+ keys: utils.getObjectKeys($box-border-shorthands),
109
+ values: utils.getBoxIterator($box-sizes-border-config, $box-border-unit-config, $box-unit-border-size-config),
110
+ levels: ("_":utils.getObjectKeys(utils.getBoxIterator($box-sizes-border-config, $box-border-unit-config, $box-unit-border-size-config))),
111
+ about: "border properties for html elements"
112
+ ),
113
+ radius : (tag: radiusGuy),
114
+ shadow: (
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))
118
+ ),
119
+ about: "applying shadows give depth and levels to your design"
120
+ )
121
+ ));
@@ -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
+ // responsive builder here
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();