@medyll/cssfabric 0.1.1 → 0.2.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 (162) hide show
  1. package/.github/workflows/main.yml +33 -0
  2. package/.idea/cssfabric.iml +4 -1
  3. package/README.md +38 -240
  4. package/bin/index.js +2 -1
  5. package/{cssfabric.json → cssfabric.sass.js} +3 -3
  6. package/gulpfile.js +77 -143
  7. package/package.json +69 -69
  8. package/src/app.css +107 -0
  9. package/src/app.d.ts +15 -0
  10. package/src/app.html +13 -0
  11. package/src/components/Header.svelte +17 -0
  12. package/src/components/HeaderSiteTitle.svelte +12 -0
  13. package/src/components/InnerMenu.svelte +27 -0
  14. package/src/components/SubHeader.svelte +10 -0
  15. package/src/components/SubHeaderH.svelte +3 -0
  16. package/src/components/SubSubHeader.svelte +22 -0
  17. package/src/components/demo/DemoElement.svelte +86 -0
  18. package/src/components/demo/elements/DemoElementBackgroundColor.svelte +7 -0
  19. package/src/components/demo/elements/DemoElementBorder.svelte +8 -0
  20. package/src/components/demo/elements/DemoElementBorderColor.svelte +8 -0
  21. package/src/components/demo/elements/DemoElementColor.svelte +8 -0
  22. package/src/components/demo/elements/DemoElementGrid.svelte +53 -0
  23. package/src/components/demo/elements/DemoElementMargin.svelte +8 -0
  24. package/src/components/demo/elements/DemoElementPadding.svelte +10 -0
  25. package/src/components/demo/elements/DemoElementScale.svelte +9 -0
  26. package/src/components/demo/elements/DemoElementTable.svelte +34 -0
  27. package/src/components/demo/elements/DemoElementText.svelte +10 -0
  28. package/src/components/demo/proxy/ProxyDsp.svelte +12 -0
  29. package/src/components/demo/proxy/ProxyDspArray.svelte +19 -0
  30. package/src/components/demo/proxy/ProxyDspObject.svelte +17 -0
  31. package/src/components/docs/Docs.svelte +97 -0
  32. package/src/components/docs/DocsClassNames.svelte +34 -0
  33. package/src/components/docs/DocsDemo.svelte +84 -0
  34. package/src/components/header/Header.svelte +105 -0
  35. package/src/components/header/svelte-logo.svg +1 -0
  36. package/src/cssfabric/modules/_cssfabric-config.scss +27 -17
  37. package/src/cssfabric/modules/base/base.scss +1 -6
  38. package/src/cssfabric/modules/box/_box-build.scss +22 -3
  39. package/src/cssfabric/modules/box/_box-vars.scss +1 -1
  40. package/src/cssfabric/modules/color/_color-build.scss +4 -0
  41. package/src/cssfabric/modules/css-fabric.scss +1 -1
  42. package/src/cssfabric/modules/menu/_menu-build.scss +9 -8
  43. package/src/cssfabric/modules/scale/_scale-vars.scss +12 -2
  44. package/src/cssfabric/modules/theme/_theme-build.scss +21 -24
  45. package/src/cssfabric/modules/theme/_theme-vars.scss +9 -18
  46. package/src/cssfabric/modules/vars.scss +7 -8
  47. package/src/hooks.ts +27 -0
  48. package/src/index.ts +1 -1
  49. package/src/lib/_generated/cssFabric.vars.json +13 -0
  50. package/src/{_generated → lib/_generated}/export.variables.md +0 -0
  51. package/src/{_generated → lib/_generated}/index.d.ts +0 -0
  52. package/src/{_generated → lib/_generated}/readme.md +0 -0
  53. package/src/lib/init/importCssVars.ts +3 -0
  54. package/src/{scripts → lib/scripts}/cssfabric.ts +1 -1
  55. package/src/{scripts → lib/scripts}/cssfabricClassNames.ts +0 -0
  56. package/src/{scripts → lib/scripts}/index.d.ts +0 -0
  57. package/src/{scripts → lib/scripts}/index.ts +0 -0
  58. package/src/lib/scripts/utils.ts +37 -0
  59. package/{lib/styles/core → src/lib/styles}/animation/animation.css +0 -0
  60. package/{lib/styles/core → src/lib/styles}/animation/animation.min.css +0 -0
  61. package/{lib/styles/core → src/lib/styles}/base/base.css +0 -7
  62. package/src/lib/styles/base/base.min.css +1 -0
  63. package/{lib/styles/core → src/lib/styles}/box/box.css +127 -111
  64. package/src/lib/styles/box/box.min.css +1 -0
  65. package/{lib/styles/core → src/lib/styles}/box/box.responsive.css +508 -444
  66. package/src/lib/styles/box/box.responsive.min.css +1 -0
  67. package/{lib/styles/core → src/lib/styles}/color/color.css +12 -12
  68. package/src/lib/styles/color/color.min.css +1 -0
  69. package/{lib/styles/core → src/lib/styles}/color/color.responsive.css +48 -48
  70. package/src/lib/styles/color/color.responsive.min.css +1 -0
  71. package/src/lib/styles/cssfabric.css +61792 -0
  72. package/src/lib/styles/cssfabric.min.css +168 -0
  73. package/src/lib/styles/cssfabric.responsive.css +200596 -0
  74. package/src/lib/styles/cssfabric.responsive.min.css +108 -0
  75. package/{lib/styles/core → src/lib/styles}/flex/flex.css +0 -0
  76. package/src/lib/styles/flex/flex.min.css +1 -0
  77. package/{lib/styles/core → src/lib/styles}/flex/flex.responsive.css +0 -0
  78. package/src/lib/styles/flex/flex.responsive.min.css +1 -0
  79. package/{lib/styles/core → src/lib/styles}/grid/grid.css +0 -0
  80. package/src/lib/styles/grid/grid.min.css +1 -0
  81. package/{lib/styles/core → src/lib/styles}/grid/grid.responsive.css +0 -0
  82. package/src/lib/styles/grid/grid.responsive.min.css +1 -0
  83. package/{lib/styles/core → src/lib/styles}/menu/menu.css +16 -12
  84. package/src/lib/styles/menu/menu.min.css +1 -0
  85. package/{lib/styles/core → src/lib/styles}/menu/menu.responsive.css +64 -48
  86. package/src/lib/styles/menu/menu.responsive.min.css +1 -0
  87. package/{lib/styles/core → src/lib/styles}/overflow/overflow.css +0 -0
  88. package/{lib/styles/core → src/lib/styles}/overflow/overflow.min.css +0 -0
  89. package/{lib/styles/core → src/lib/styles}/overflow/overflow.responsive.css +0 -0
  90. package/src/lib/styles/overflow/overflow.responsive.min.css +1 -0
  91. package/{lib/styles/core → src/lib/styles}/scale/scale.css +0 -0
  92. package/{lib/styles/core → src/lib/styles}/scale/scale.min.css +0 -0
  93. package/{lib/styles/core → src/lib/styles}/scale/scale.responsive.css +0 -0
  94. package/src/lib/styles/scale/scale.responsive.min.css +1 -0
  95. package/{lib/styles/core → src/lib/styles}/table/table.css +0 -0
  96. package/src/lib/styles/table/table.min.css +1 -0
  97. package/{lib/styles/core → src/lib/styles}/table/table.responsive.css +0 -0
  98. package/src/lib/styles/table/table.responsive.min.css +1 -0
  99. package/{lib/styles/core → src/lib/styles}/text/text.css +0 -0
  100. package/src/lib/styles/text/text.min.css +1 -0
  101. package/{lib/styles/core → src/lib/styles}/text/text.responsive.css +0 -0
  102. package/src/lib/styles/text/text.responsive.min.css +1 -0
  103. package/{lib/styles/core → src/lib/styles}/theme/theme.css +0 -0
  104. package/{lib/styles/core → src/lib/styles}/theme/theme.min.css +0 -0
  105. package/{lib/styles/core → src/lib/styles}/vars.css +19 -15
  106. package/src/lib/styles/vars.min.css +1 -0
  107. package/{lib/styles/core → src/lib/styles}/zindex/zindex.css +0 -0
  108. package/{lib/styles/core → src/lib/styles}/zindex/zindex.min.css +0 -0
  109. package/src/routes/__layout.svelte +91 -0
  110. package/src/routes/cssfabric-modules/[module]/__layout.svelte +75 -0
  111. package/src/routes/cssfabric-modules/[module]/classnames/index.svelte +24 -0
  112. package/src/routes/cssfabric-modules/[module]/demo/index.svelte +24 -0
  113. package/src/routes/cssfabric-modules/[module]/docs/index.svelte +30 -0
  114. package/src/routes/cssfabric-modules/[module]/index.svelte +3 -0
  115. package/src/routes/cssfabric-modules/__layout.svelte +26 -0
  116. package/src/routes/cssfabric-modules/index.svelte +0 -0
  117. package/src/routes/index.svelte +62 -0
  118. package/src/routes/installation/__layout.svelte +1 -0
  119. package/src/routes/installation/index.svelte +28 -0
  120. package/src/scripts/utils.ts +26 -37
  121. package/src/utils.ts +71 -0
  122. package/static/favicon.png +0 -0
  123. package/static/robots.txt +3 -0
  124. package/svelte.config.js +25 -0
  125. package/tsconfig.json +3 -46
  126. package/webpack.config.js +2 -0
  127. package/cssfabric.config.js +0 -3
  128. package/lib/_generated/export.variables.json +0 -583
  129. package/lib/index.d.ts +0 -2
  130. package/lib/index.js +0 -7
  131. package/lib/scripts/cssfabric.d.ts +0 -24
  132. package/lib/scripts/cssfabric.js +0 -48
  133. package/lib/scripts/cssfabricClassNames.d.ts +0 -14
  134. package/lib/scripts/cssfabricClassNames.js +0 -150
  135. package/lib/scripts/index.d.ts +0 -2
  136. package/lib/scripts/index.js +0 -6
  137. package/lib/scripts/utils.d.ts +0 -5
  138. package/lib/scripts/utils.js +0 -40
  139. package/lib/styles/core/base/base.min.css +0 -1
  140. package/lib/styles/core/box/box.min.css +0 -1
  141. package/lib/styles/core/box/box.responsive.min.css +0 -1
  142. package/lib/styles/core/color/color.min.css +0 -1
  143. package/lib/styles/core/color/color.responsive.min.css +0 -1
  144. package/lib/styles/core/flex/flex.min.css +0 -1
  145. package/lib/styles/core/flex/flex.responsive.min.css +0 -1
  146. package/lib/styles/core/grid/grid.min.css +0 -1
  147. package/lib/styles/core/grid/grid.responsive.min.css +0 -1
  148. package/lib/styles/core/main.min.css +0 -1
  149. package/lib/styles/core/menu/menu.min.css +0 -1
  150. package/lib/styles/core/menu/menu.responsive.min.css +0 -1
  151. package/lib/styles/core/overflow/overflow.responsive.min.css +0 -1
  152. package/lib/styles/core/scale/scale.responsive.min.css +0 -1
  153. package/lib/styles/core/table/table.min.css +0 -1
  154. package/lib/styles/core/table/table.responsive.min.css +0 -1
  155. package/lib/styles/core/text/text.min.css +0 -1
  156. package/lib/styles/core/text/text.responsive.min.css +0 -1
  157. package/lib/styles/core/vars.min.css +0 -1
  158. package/lib/styles/cssfabric.css +0 -5143
  159. package/lib/styles/cssfabric.min.css +0 -15
  160. package/lib/styles/cssfabric.responsive.css +0 -16679
  161. package/lib/styles/cssfabric.responsive.min.css +0 -9
  162. package/src/_generated/export.variables.json +0 -759
@@ -0,0 +1,105 @@
1
+ <script lang="ts">
2
+ import logo from './svelte-logo.svg';
3
+ </script>
4
+
5
+ <header>
6
+ <div class="corner">
7
+ <a href="https://kit.svelte.dev">
8
+ <img src={logo} alt="SvelteKit" />
9
+ </a>
10
+ </div>
11
+
12
+ <nav>
13
+ </nav>
14
+
15
+ </header>
16
+
17
+ <style>
18
+ header {
19
+ display: flex;
20
+ justify-content: space-between;
21
+ }
22
+
23
+ .corner {
24
+ width: 3em;
25
+ height: 3em;
26
+ }
27
+
28
+ .corner a {
29
+ display: flex;
30
+ align-items: center;
31
+ justify-content: center;
32
+ width: 100%;
33
+ height: 100%;
34
+ }
35
+
36
+ .corner img {
37
+ width: 2em;
38
+ height: 2em;
39
+ object-fit: contain;
40
+ }
41
+
42
+ nav {
43
+ display: flex;
44
+ justify-content: center;
45
+ --background: rgba(255, 255, 255, 0.7);
46
+ }
47
+
48
+ svg {
49
+ width: 2em;
50
+ height: 3em;
51
+ display: block;
52
+ }
53
+
54
+ path {
55
+ fill: var(--background);
56
+ }
57
+
58
+ ul {
59
+ position: relative;
60
+ padding: 0;
61
+ margin: 0;
62
+ height: 3em;
63
+ display: flex;
64
+ justify-content: center;
65
+ align-items: center;
66
+ list-style: none;
67
+ background: var(--background);
68
+ background-size: contain;
69
+ }
70
+
71
+ li {
72
+ position: relative;
73
+ height: 100%;
74
+ }
75
+
76
+ li.active::before {
77
+ --size: 6px;
78
+ content: '';
79
+ width: 0;
80
+ height: 0;
81
+ position: absolute;
82
+ top: 0;
83
+ left: calc(50% - var(--size));
84
+ border: var(--size) solid transparent;
85
+ border-top: var(--size) solid var(--accent-color);
86
+ }
87
+
88
+ nav a {
89
+ display: flex;
90
+ height: 100%;
91
+ align-items: center;
92
+ padding: 0 1em;
93
+ color: var(--heading-color);
94
+ font-weight: 700;
95
+ font-size: 0.8rem;
96
+ text-transform: uppercase;
97
+ letter-spacing: 0.1em;
98
+ text-decoration: none;
99
+ transition: color 0.2s linear;
100
+ }
101
+
102
+ a:hover {
103
+ color: var(--accent-color);
104
+ }
105
+ </style>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="107" height="128" viewBox="0 0 107 128"><title>svelte-logo</title><path d="M94.1566,22.8189c-10.4-14.8851-30.94-19.2971-45.7914-9.8348L22.2825,29.6078A29.9234,29.9234,0,0,0,8.7639,49.6506a31.5136,31.5136,0,0,0,3.1076,20.2318A30.0061,30.0061,0,0,0,7.3953,81.0653a31.8886,31.8886,0,0,0,5.4473,24.1157c10.4022,14.8865,30.9423,19.2966,45.7914,9.8348L84.7167,98.3921A29.9177,29.9177,0,0,0,98.2353,78.3493,31.5263,31.5263,0,0,0,95.13,58.117a30,30,0,0,0,4.4743-11.1824,31.88,31.88,0,0,0-5.4473-24.1157" style="fill:#ff3e00"/><path d="M45.8171,106.5815A20.7182,20.7182,0,0,1,23.58,98.3389a19.1739,19.1739,0,0,1-3.2766-14.5025,18.1886,18.1886,0,0,1,.6233-2.4357l.4912-1.4978,1.3363.9815a33.6443,33.6443,0,0,0,10.203,5.0978l.9694.2941-.0893.9675a5.8474,5.8474,0,0,0,1.052,3.8781,6.2389,6.2389,0,0,0,6.6952,2.485,5.7449,5.7449,0,0,0,1.6021-.7041L69.27,76.281a5.4306,5.4306,0,0,0,2.4506-3.631,5.7948,5.7948,0,0,0-.9875-4.3712,6.2436,6.2436,0,0,0-6.6978-2.4864,5.7427,5.7427,0,0,0-1.6.7036l-9.9532,6.3449a19.0329,19.0329,0,0,1-5.2965,2.3259,20.7181,20.7181,0,0,1-22.2368-8.2427,19.1725,19.1725,0,0,1-3.2766-14.5024,17.9885,17.9885,0,0,1,8.13-12.0513L55.8833,23.7472a19.0038,19.0038,0,0,1,5.3-2.3287A20.7182,20.7182,0,0,1,83.42,29.6611a19.1739,19.1739,0,0,1,3.2766,14.5025,18.4,18.4,0,0,1-.6233,2.4357l-.4912,1.4978-1.3356-.98a33.6175,33.6175,0,0,0-10.2037-5.1l-.9694-.2942.0893-.9675a5.8588,5.8588,0,0,0-1.052-3.878,6.2389,6.2389,0,0,0-6.6952-2.485,5.7449,5.7449,0,0,0-1.6021.7041L37.73,51.719a5.4218,5.4218,0,0,0-2.4487,3.63,5.7862,5.7862,0,0,0,.9856,4.3717,6.2437,6.2437,0,0,0,6.6978,2.4864,5.7652,5.7652,0,0,0,1.602-.7041l9.9519-6.3425a18.978,18.978,0,0,1,5.2959-2.3278,20.7181,20.7181,0,0,1,22.2368,8.2427,19.1725,19.1725,0,0,1,3.2766,14.5024,17.9977,17.9977,0,0,1-8.13,12.0532L51.1167,104.2528a19.0038,19.0038,0,0,1-5.3,2.3287" style="fill:#fff"/></svg>
@@ -1,6 +1,7 @@
1
1
  @use "sass:map";
2
2
  @use "sass:math";
3
3
 
4
+
4
5
  // prefix ?
5
6
  // scoped ?
6
7
 
@@ -35,18 +36,23 @@ $has-color-bg-themed: true;
35
36
  $has-color-border: true;
36
37
 
37
38
 
38
- $theme-color-primary: rgb(67, 23, 0) !default;
39
+ $theme-color-primary: rgb(32, 23, 0) !default;
39
40
  $theme-color-secondary: #D14B02 !default;
40
41
  $theme-color-tertiary: #88D102 !default;
41
-
42
+ //light theme
42
43
  $theme-color-foreground: #282230 !default;
43
44
  $theme-color-background: #ffffff !default;
44
45
  $theme-color-paper: #f1f1f1 !default;
45
46
 
47
+ $theme-color-shadow: green !default;
48
+ // dark theme
46
49
  $theme-dark-color-foreground: #f1f1f1 !default;
47
50
  $theme-dark-color-background: #27323a !default;
48
51
  $theme-dark-color-paper: #3a3b3b !default;
49
52
 
53
+ $theme-dark-color-shadow: black !default;
54
+
55
+ // grays
50
56
  $gray-start: #f4f4f4 !default;
51
57
  $gray-end: #999 !default;
52
58
  $gray-steps: 5 !default;
@@ -59,12 +65,13 @@ $box-shadow-shorthand: shad !default;
59
65
  $box-border-shorthand: border !default;
60
66
  $box-padding-shorthand: pad !default;
61
67
  $box-margin-shorthand: marg !default;
68
+ $box-gap-shorthand: gap !default;
62
69
 
63
70
  $box-unit-presets: (tiny:0.5, small:1, medium:3, large:4) !default;
64
71
  $box-radius: (tiny:4px, small:8px, medium:16px) !default;
65
72
 
66
- $scale-tag-width-shorthand: w!default;
67
- $scale-tag-height-shorthand: h!default;;
73
+ $scale-tag-width-shorthand: w !default;
74
+ $scale-tag-height-shorthand: h !default;
68
75
 
69
76
  $cssfabric-metadata: (
70
77
  title: "cssfabric",
@@ -73,8 +80,11 @@ $cssfabric-metadata: (
73
80
  );
74
81
 
75
82
  // vars
76
- $vars-box-density: --box-density!default;
77
- $vars-box-density-preset: --box-density-preset!default;
83
+ $vars-box-density: --box-density !default;
84
+ $vars-box-density-preset: --box-density-preset !default;
85
+
86
+ $vars-theme-color-shadow: --theme-color-shadow !default;
87
+ $vars-theme-dark-color-shadow: --theme-dark-color-shadow !default;
78
88
 
79
89
  $cssfabric-config: (
80
90
  cfg-has-dimension-strict: true,
@@ -115,25 +125,26 @@ $cssfabric-config: (
115
125
  tertiary: $theme-color-tertiary,
116
126
  foreground: $theme-color-foreground,
117
127
  background: $theme-color-background,
128
+ paper: $theme-color-paper,
118
129
  ),
119
130
  scheme: (
120
131
  discrete: #ccc,
121
132
  success: green,
122
- info: hsl(48, 100%, 67%),
133
+ info: #FFDD57FF,
123
134
  warning: hsl(48, 96%, 46%),
124
135
  alert: hsl(27, 100%, 50%),
125
136
  error: red
126
137
  ),
127
138
  palette: (
128
- yellow: #ffb900,
129
- orange: #d83b01,
130
- red: #d13438,
131
- magenta: #b4009e,
132
- purple: #5c2d91,
133
- green: #107c10,
134
- teal: #008272,
135
- blue: #0078d4,
136
- dark: #323232,
139
+ 'yellow': #ffb900,
140
+ 'orange': #d83b01,
141
+ 'red': #d13438,
142
+ 'magenta': #b4009e,
143
+ 'purple': #5c2d91,
144
+ 'green': #107c10,
145
+ 'teal': #008272,
146
+ 'blue': #0078d4,
147
+ 'dark': #323232,
137
148
  ),
138
149
  border-radius:(
139
150
  tiny:4px, small:8px, medium:16px
@@ -155,7 +166,6 @@ $cssfabric-config: (
155
166
 
156
167
  $gray-schemes: map.set($gray-schemes, #{($i+1) * 100}, $color);
157
168
  }
158
- @debug $gray-schemes;
159
169
 
160
170
  @return $gray-schemes;
161
171
  }
@@ -72,9 +72,4 @@ label, .label {
72
72
  }
73
73
  }
74
74
 
75
- code {
76
- padding: 0.25em;
77
- border: 1px solid #cccccc;
78
- background-color: #ededed;
79
- border-radius: 5px;
80
- }
75
+
@@ -27,6 +27,8 @@ $box-border-shorthand-config: cssfabric-config.$box-border-shorthand !default;
27
27
  $box-padding-shorthand-config: cssfabric-config.$box-padding-shorthand !default;
28
28
  $box-margin-shorthand-config: cssfabric-config.$box-margin-shorthand !default;
29
29
 
30
+ $box-gap-shorthand: cssfabric-config.$box-gap-shorthand !default;
31
+
30
32
  $box-shadows-steps: box.$box-shadows-steps !default;
31
33
  $box-shadows-step-multiplier: box.$box-shadows-step-multiplier !default;
32
34
 
@@ -59,6 +61,12 @@ $densities-ratios : cssfabric-config.$densities-ratios;
59
61
  --box-density-preset-#{$preset}: #{$value};
60
62
  }
61
63
 
64
+ // radius
65
+ @each $radius, $value in $box-radius{
66
+ @debug #{$value};
67
+ --radius-#{$radius}: #{$value};
68
+ }
69
+
62
70
  // $ratios: tiny small medium large full
63
71
  @each $ratio, $val in $densities-ratios {
64
72
  [density=#{$ratio}] {
@@ -88,7 +96,7 @@ $densities-ratios : cssfabric-config.$densities-ratios;
88
96
  $css_size_value: ($grid_size_value * $box-unit-border-size-config) + $box-border-unit-config;
89
97
  // css property name is aggregated with size value $i
90
98
 
91
- $computed_value: $css_size_value + " solid #ededed";
99
+ $computed_value: $css_size_value + " solid var(--theme-color-border)";
92
100
 
93
101
  #{raw_size_tag_rule($grid_size_value)} &-#{$grid_size_value} {
94
102
  @if length($rule) == 4 {
@@ -116,7 +124,7 @@ $densities-ratios : cssfabric-config.$densities-ratios;
116
124
  // presets
117
125
  @each $preset, $preset-value in $box-unit-presets{
118
126
  .#{$fabric_box_position_prop_short}#{$shorthand}-#{$preset}{
119
- #{$fabric_box_position_prop}: --box-density-preset-#{$preset};
127
+ #{$fabric_box_position_prop}: var(--box-density-preset-#{$preset});
120
128
  }
121
129
  }
122
130
 
@@ -140,6 +148,16 @@ $densities-ratios : cssfabric-config.$densities-ratios;
140
148
  }
141
149
  }
142
150
 
151
+ @mixin box-gap($mq_key) {
152
+ $shorthand: if($mq_key, #{$box-gap-shorthand}-#{$mq_key}, #{$box-gap-shorthand});
153
+ // presets
154
+ @each $preset, $preset-value in $box-unit-presets{
155
+ @debug #{$shorthand}-#{$preset};
156
+ .#{$shorthand}-#{$preset}{
157
+ #{$shorthand}: var(--box-density-preset-#{$preset});
158
+ }
159
+ }
160
+ }
143
161
  // pmb as padding margin border property
144
162
  // padding-tiny padding-small padding
145
163
  @mixin padding-margin-border($mq_key) {
@@ -236,7 +254,7 @@ $densities-ratios : cssfabric-config.$densities-ratios;
236
254
  }
237
255
  }
238
256
 
239
- @function buildShadowsValues($shadows_step:0) {
257
+ @function buildShadowsValues($shadows_step:0,$shadow-color: null) {
240
258
  $v_fact: 2.4;
241
259
  $h_fact: 1.16;
242
260
 
@@ -284,4 +302,5 @@ $densities-ratios : cssfabric-config.$densities-ratios;
284
302
  @include placement($mq_key);
285
303
  @include radius($mq_key);
286
304
  @include shadows($mq_key);
305
+ @include box-gap($mq_key);
287
306
  }
@@ -87,7 +87,6 @@ $box-config: (
87
87
  )
88
88
  );
89
89
 
90
-
91
90
  $box-docs: (
92
91
  attributes:(
93
92
  padding: (
@@ -111,6 +110,7 @@ $box-docs: (
111
110
  levels: ("_":utils.getObjectKeys(utils.getBoxIterator($box-sizes-border-config, $box-border-unit-config, $box-unit-border-size-config))),
112
111
  about: "border properties for html elements"
113
112
  ),
113
+ radius : (tag: radiusGuy),
114
114
  shadow: (
115
115
  tag: cssfabric-config.$box-shadow-shorthand,
116
116
  values: utils.getShadowIterator($shadow-factors, $box-shadows-steps),
@@ -23,6 +23,10 @@ $color-gray-end: cssfabric-config.$gray-end !default;
23
23
  $color-gray-steps: cssfabric-config.$gray-steps !default;
24
24
  $gray-schemes: utils.getGraySteps($color-gray-steps, $color-gray-start, $color-gray-end);
25
25
 
26
+
27
+
28
+
29
+
26
30
  @function text-contrast($n) {
27
31
  $color-brightness: round((red($n) * 299) + (green($n) * 587) + math.div(blue(#ffffff) * 114, 1000));
28
32
  $light-color: round((red(#ffffff) * 299) + (green(#ffffff) * 587) + math.div(blue(#ffffff) * 114, 1000));
@@ -1,2 +1,2 @@
1
1
  @use '../../../src/vendor/normalize/normalize.min.css';
2
-
2
+ // old name css-fabric.scss
@@ -32,25 +32,26 @@ $menu_dropdown_close: map-get($menu-config, menu_dropdown_close);
32
32
  &-#{$orientation_key} {
33
33
  padding: 0;
34
34
  margin: 0;
35
- line-height: 1rem;
35
+ line-height: var(--box-density-2);
36
36
 
37
37
  & li.#{$menu_item_class_name},
38
38
  li {
39
39
  display: block;
40
- margin: 0 1rem;
40
+ margin: 0;
41
41
  width: auto;
42
42
  transition-property: all;
43
- transition-duration: 0.5s;
44
- padding: 1rem;
43
+ transition-duration: 0.15s;
44
+ padding: var(--box-density-1);
45
+ border-left: 1px solid var( --theme-color-border );
45
46
 
46
47
  &:hover {
47
- border-radius: 4px;
48
+ border-radius: var(--radius-small);
48
49
  background-color: #ededed;
49
- // text-align: center;
50
+ border-left: 1px solid var(--theme-color-primary);
50
51
  }
51
52
 
52
53
  &.active {
53
- border-radius: 4px;
54
+ border-radius: var(--radius-small);
54
55
  background-color: #ededed;
55
56
  font-weight: bold;
56
57
  }
@@ -76,6 +77,7 @@ $menu_dropdown_close: map-get($menu-config, menu_dropdown_close);
76
77
 
77
78
  }
78
79
  }
80
+
79
81
  &-h {
80
82
  max-width: 100%;
81
83
  display: inline-flex;
@@ -98,7 +100,6 @@ $menu_dropdown_close: map-get($menu-config, menu_dropdown_close);
98
100
  $menu-border-color: red;
99
101
 
100
102
 
101
-
102
103
  /* & li.#{$menu_item_class_name}{
103
104
  dsp: none;
104
105
  }
@@ -52,11 +52,21 @@ $scale-metadata: (
52
52
  );
53
53
 
54
54
  $scale-font-weight-config: 1em;
55
- $scale-grid-ratios-config: $scale-grid-ratios-config;
56
55
  $scale-defined-step-size: 2;
57
56
  $scale-defined-step-unit: rem;
58
- $scale-grid-ratios-config: $scale-grid-ratios-config;
59
57
 
58
+ $scale-config: (
59
+ weight-config: $scale-font-weight-config,
60
+ unit-tag-config: (
61
+ width: w,
62
+ height: h
63
+ ),
64
+ grid-ratios-config: $scale-grid-ratios-config,
65
+ defined-step-size: $scale-defined-step-size,
66
+ defined-step-unit: $scale-defined-step-unit,
67
+ defined-steps: $scale-defined-steps,
68
+ cssProps:$_cssProps
69
+ );
60
70
 
61
71
  $scale-docs: (
62
72
  attributes:(
@@ -1,10 +1,9 @@
1
- @use "theme-vars";
2
- @use "../cssfabric-config";
3
1
  @use "../../_utils";
4
2
  @use "sass:color";
3
+ @use "theme-vars";
5
4
 
6
- $config: cssfabric-config.$cssfabric-config;
7
- $theme-config: theme-vars.$theme-config;
5
+ @import "theme-vars";
6
+ @import "../cssfabric-config";
8
7
 
9
8
  // COLOR THEME
10
9
  $moduleNameShort: map-get($theme-config, moduleNameShort);
@@ -13,13 +12,10 @@ $color-themes: map-get($theme-config, color-default-config);
13
12
  $theme-levels: map-get($theme-config, theme-level-config);
14
13
  $theme-properties-apply-config: map-get($theme-config, theme-properties-apply-config);
15
14
 
16
- $color-primary: map-get($color-themes, primary);
17
- $color-secondary: map-get($color-themes, secondary);
18
- $color-tertiary: map-get($color-themes, tertiary);
19
15
 
20
16
  $declinations-config: map-get($theme-config, declinations-config);
21
17
 
22
- $themes: map-get($config, themes) !default;
18
+ $themes: map-get($cssfabric-config, themes) !default;
23
19
  $theme-light: map-get($themes, light) !default;
24
20
  $theme-dark: map-get($themes, dark) !default;
25
21
 
@@ -57,34 +53,35 @@ $theme-dark: map-get($themes, dark) !default;
57
53
  }
58
54
 
59
55
 
60
- @mixin themeCssVars() {
56
+ @mixin themeCssVars($theme-color-primary,$theme-color-secondary,$theme-color-tertiary) {
57
+
61
58
  /* theme primary colors*/
62
- --theme-color-primary: #{$color-primary};
59
+ --theme-color-primary: #{$theme-color-primary};
63
60
  @each $theme-level in $theme-levels {
64
- --theme-color-primary-#{$theme-level}: #{utils.applyColorEffect($theme-level,$color-primary)};
61
+ --theme-color-primary-#{$theme-level}: #{utils.applyColorEffect($theme-level,$theme-color-primary)};
65
62
  }
66
63
 
67
- --theme-color-primary-alpha-low: #{color.change($color-primary,$alpha:0.8)};
68
- --theme-color-primary-alpha: #{color.change($color-primary,$alpha:0.3)};
69
- --theme-color-primary-alpha-high: #{color.change($color-primary,$alpha:0.1)};
64
+ --theme-color-primary-alpha-low: #{color.change($theme-color-primary,$alpha:0.8)};
65
+ --theme-color-primary-alpha: #{color.change($theme-color-primary,$alpha:0.3)};
66
+ --theme-color-primary-alpha-high: #{color.change($theme-color-primary,$alpha:0.1)};
70
67
 
71
68
  /* theme secondary colors*/
72
- --theme-color-secondary: #{$color-secondary};
69
+ --theme-color-secondary: #{$theme-color-secondary};
73
70
  @each $theme-level in $theme-levels {
74
- --theme-color-secondary-#{$theme-level}: #{utils.applyColorEffect($theme-level,$color-secondary)};
71
+ --theme-color-secondary-#{$theme-level}: #{utils.applyColorEffect($theme-level,$theme-color-secondary)};
75
72
  }
76
- --theme-color-secondary-alpha-low: #{color.change($color-secondary,$alpha:0.8)};
77
- --theme-color-secondary-alpha: #{color.change($color-secondary,$alpha:0.3)};
78
- --theme-color-secondary-alpha-high: #{color.change($color-secondary,$alpha:0.1)};
73
+ --theme-color-secondary-alpha-low: #{color.change($theme-color-secondary,$alpha:0.8)};
74
+ --theme-color-secondary-alpha: #{color.change($theme-color-secondary,$alpha:0.3)};
75
+ --theme-color-secondary-alpha-high: #{color.change($theme-color-secondary,$alpha:0.1)};
79
76
 
80
77
  /* theme tertiary colors*/
81
- --theme-color-tertiary: #{$color-tertiary};
78
+ --theme-color-tertiary: #{$theme-color-tertiary};
82
79
  @each $theme-level in $theme-levels {
83
- --theme-color-tertiary-#{$theme-level}: #{utils.applyColorEffect($theme-level,$color-tertiary)};
80
+ --theme-color-tertiary-#{$theme-level}: #{utils.applyColorEffect($theme-level,$theme-color-tertiary)};
84
81
  }
85
- --theme-color-tertiary-alpha-low: #{color.change($color-tertiary,$alpha:0.8)};
86
- --theme-color-tertiary-alpha: #{color.change($color-tertiary,$alpha:0.3)};
87
- --theme-color-tertiary-alpha-high: #{color.change($color-tertiary,$alpha:0.1)};
82
+ --theme-color-tertiary-alpha-low: #{color.change($theme-color-tertiary,$alpha:0.8)};
83
+ --theme-color-tertiary-alpha: #{color.change($theme-color-tertiary,$alpha:0.3)};
84
+ --theme-color-tertiary-alpha-high: #{color.change($theme-color-tertiary,$alpha:0.1)};
88
85
  }
89
86
 
90
87
  @mixin buildTheme($mq_size_key: null) {
@@ -1,20 +1,10 @@
1
1
  @use '../../utils' as utils;
2
- @use "../cssfabric-config";
2
+ @import "../cssfabric-config";
3
3
 
4
4
 
5
- $config: cssfabric-config.$cssfabric-config;
6
-
7
- $theme: map-get($config, theme);
8
-
9
- $color-primary: map-get($theme, primary) !default;
10
- $color-secondary: map-get($theme, secondary) !default;
11
- $color-tertiary: map-get($theme, tertiary) !default;
12
-
13
- $_foreground: map-get($theme, foreground) !default;
14
- $_background: map-get($theme, background) !default;
15
5
 
16
6
  $_declinations-config: (primary, secondary, tertiary);
17
- $themeii: (primary: $color-primary, secondary:$color-secondary, tertiary:$color-tertiary);
7
+ $themeii : (primary: $theme-color-primary, secondary:$theme-color-secondary, tertiary:$theme-color-tertiary);
18
8
 
19
9
  $_theme-levels: (light lighter dark darker complement invert);
20
10
  $_theme-properties-apply: (text, bg, border);
@@ -33,17 +23,18 @@ $theme-config: (
33
23
  moduleName: theme,
34
24
  moduleNameShort: theme,
35
25
  color-default-config: (
36
- primary: $color-primary,
37
- secondary: $color-secondary,
38
- tertiary: $color-tertiary,
39
- foreground: $_foreground,
40
- background: $_background
26
+ primary: $theme-color-primary,
27
+ secondary: $theme-color-secondary,
28
+ tertiary: $theme-color-tertiary,
29
+ foreground: $theme-color-foreground,
30
+ background: $theme-color-background,
31
+ paper: $theme-color-paper,
41
32
  ),
42
33
  declinations-config:$_declinations-config,
43
34
  theme-level-config:$_theme-levels,
44
35
  theme-properties-apply-config:$_theme-properties-apply,
45
36
  // primary secondary tertiary
46
- color: utils.getThemeLevels($themeii, $color-primary)
37
+ color: utils.getThemeLevels($themeii, $theme-color-primary)
47
38
  );
48
39
 
49
40
  $theme-docs: (attributes:(
@@ -1,6 +1,5 @@
1
1
  @use "../_utils";
2
2
  @use "sass:color";
3
- @use 'cssfabric-config';
4
3
  @use '../../cssfabric/modules/color/color-vars';
5
4
  @use '../../cssfabric/modules/color/color-build' as colorBuild;
6
5
  @use "../../cssfabric/modules/box/box-vars" as box;
@@ -8,16 +7,15 @@
8
7
  @use "../../cssfabric/modules/theme/theme-build" as themeBuild;
9
8
  @use "../../cssfabric/modules/text/text-build" as textBuild;
10
9
 
10
+ @import 'cssfabric-config';
11
11
 
12
- $config: cssfabric-config.$cssfabric-config;
13
-
14
- $themes: map-get($config, themes) !default;
12
+ $themes: map-get($cssfabric-config, themes) !default;
15
13
  $theme-light: map-get($themes, light) !default;
16
14
  $theme-dark: map-get($themes, dark) !default;
17
15
 
18
- /* cssFabric vars */
16
+ /* cssFabric vars yes */
19
17
  :root {
20
- @include themeBuild.themeCssVars();
18
+ @include themeBuild.themeCssVars($theme-color-primary,$theme-color-secondary,$theme-color-tertiary);
21
19
  @include colorBuild.buildColorCssVars();
22
20
  /* boxes */
23
21
  @include boxBuild.pmbCssVars();
@@ -29,17 +27,18 @@ $theme-dark: map-get($themes, dark) !default;
29
27
  /* themes */
30
28
  @include themeBuild.themeBaseVars($theme-light);
31
29
 
30
+ --theme-color-border: #{color.change($theme-color-foreground,$alpha:0.2)};
32
31
  &,[data-theme="light"] {
33
32
  @include themeBuild.themeBaseVars($theme-light);
34
33
 
35
- --theme-color-border: #{color.change(map-get($theme-light, paper),$alpha:0.2)};
34
+ --theme-color-border: #{color.change($theme-color-foreground,$alpha:0.2)};
36
35
  --theme-color-overlay: rgba(208, 191, 151, 0.2);
37
36
  }
38
37
 
39
38
  [data-theme="dark"] {
40
39
  @include themeBuild.themeBaseVars($theme-dark);
41
40
 
42
- --theme-color-border: #{color.change(map-get($theme-dark, paper),$alpha:0.2)};
41
+ --theme-color-border: #{color.change($theme-dark-color-foreground,$alpha:0.3)};
43
42
  --theme-color-overlay: rgba(255, 255, 255, 0.1);
44
43
  }
45
44
  }
package/src/hooks.ts ADDED
@@ -0,0 +1,27 @@
1
+ import cookie from 'cookie';
2
+ import {v4 as uuid} from '@lukeed/uuid';
3
+ import type {Handle} from '@sveltejs/kit';
4
+
5
+ export const handle: Handle = async ({event, resolve}) => {
6
+ const cookies = cookie.parse(event.request.headers.get('cookie') || '');
7
+ event.locals.userid = cookies.userid || uuid();
8
+
9
+ const response = await resolve(event, {
10
+ ssr : false,
11
+ transformPage: ({html}) => html.replace('old', 'new')
12
+ });
13
+
14
+ if (!cookies.userid) {
15
+ // if this is the first time the user has visited this app,
16
+ // set a cookie so that we recognise them when they return
17
+ response.headers.set(
18
+ 'set-cookie',
19
+ cookie.serialize('userid', event.locals.userid, {
20
+ path : '/',
21
+ httpOnly: true
22
+ })
23
+ );
24
+ }
25
+
26
+ return response;
27
+ };
package/src/index.ts CHANGED
@@ -1,4 +1,4 @@
1
1
 
2
- import cssfabric from "./scripts/cssfabric"
2
+ import cssfabric from "./lib/scripts/cssfabric"
3
3
 
4
4
  export default cssfabric