@ui-doc/html-renderer 0.3.0 → 1.0.0

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 (102) hide show
  1. package/README.md +586 -151
  2. package/dist/HtmlCurlyBraceLexer.d.ts +4 -1
  3. package/dist/HtmlRenderer.d.ts +5 -5
  4. package/dist/InlineReader.d.ts +3 -2
  5. package/dist/{types/lexer.d.ts → Lexer.types.d.ts} +8 -5
  6. package/dist/NodeParser.d.ts +3 -2
  7. package/dist/{types/parser.d.ts → Parser.types.d.ts} +8 -8
  8. package/dist/{types/base.d.ts → Primitive.types.d.ts} +1 -1
  9. package/dist/{types/reader.d.ts → Reader.types.d.ts} +9 -7
  10. package/dist/Renderer.types.d.ts +14 -0
  11. package/dist/TemplateLoader.d.ts +3 -2
  12. package/dist/{types/token.d.ts → Token.types.d.ts} +1 -1
  13. package/dist/assets/services/expand.d.ts +19 -0
  14. package/dist/assets/ui-doc.cjs +283 -9
  15. package/dist/assets/ui-doc.cjs.map +1 -1
  16. package/dist/assets/ui-doc.css +1169 -250
  17. package/dist/assets/ui-doc.css.map +1 -1
  18. package/dist/assets/ui-doc.min.css +9 -1
  19. package/dist/assets/ui-doc.min.js +1 -1
  20. package/dist/assets/ui-doc.mjs +283 -9
  21. package/dist/assets/ui-doc.mjs.map +1 -1
  22. package/dist/assets/utils/delay.d.ts +1 -0
  23. package/dist/assets/utils/dom.d.ts +31 -0
  24. package/dist/assets/utils/select.d.ts +12 -0
  25. package/dist/index.cjs +161 -126
  26. package/dist/index.cjs.map +1 -1
  27. package/dist/index.d.ts +6 -1
  28. package/dist/index.mjs +160 -126
  29. package/dist/index.mjs.map +1 -1
  30. package/dist/nodes/CommentNode.d.ts +2 -1
  31. package/dist/nodes/Node.d.ts +1 -1
  32. package/dist/nodes/TemplateNode.d.ts +2 -1
  33. package/dist/nodes/index.d.ts +4 -2
  34. package/dist/nodes/tags/debug.d.ts +2 -1
  35. package/dist/nodes/tags/for.d.ts +4 -3
  36. package/dist/nodes/tags/if.d.ts +5 -4
  37. package/dist/nodes/tags/index.d.ts +1 -1
  38. package/dist/nodes/tags/page.d.ts +2 -1
  39. package/dist/nodes/tags/partial.d.ts +2 -1
  40. package/dist/nodes/tags/var.d.ts +2 -1
  41. package/dist/utils/index.d.ts +1 -1
  42. package/package.json +32 -29
  43. package/scripts/app.ts +5 -3
  44. package/scripts/{src → services}/example.ts +3 -3
  45. package/scripts/services/expand.ts +214 -0
  46. package/scripts/{src → services}/sidebar.ts +4 -3
  47. package/scripts/utils/delay.ts +12 -0
  48. package/scripts/utils/dom.ts +77 -0
  49. package/scripts/utils/select.ts +46 -0
  50. package/styles/01_resets/initial.css +8 -3
  51. package/styles/01_resets/root/color.css +19 -0
  52. package/styles/01_resets/root/font.css +28 -0
  53. package/styles/01_resets/root/space.css +30 -0
  54. package/styles/01_resets/root/witdh.css +12 -0
  55. package/styles/01_resets/root.css +61 -23
  56. package/styles/01_resets/typography.css +105 -8
  57. package/styles/02_utils/background.css +14 -0
  58. package/styles/02_utils/control.css +41 -0
  59. package/styles/02_utils/margin.css +150 -0
  60. package/styles/02_utils/padding.css +134 -0
  61. package/styles/02_utils/width.css +39 -0
  62. package/styles/03_components/button.css +42 -0
  63. package/styles/03_components/colors.css +7 -19
  64. package/styles/03_components/container.css +16 -0
  65. package/styles/03_components/example-markup.css +1 -6
  66. package/styles/03_components/grid-auto.css +49 -0
  67. package/styles/03_components/icons.css +7 -19
  68. package/styles/03_components/navigation/burger-control.css +75 -0
  69. package/styles/03_components/{nav → navigation}/list.css +9 -11
  70. package/styles/03_components/navigation/main.css +102 -0
  71. package/styles/03_components/spaces.css +8 -7
  72. package/styles/04_layout/body.css +22 -0
  73. package/styles/04_layout/inline-code.css +6 -0
  74. package/styles/04_layout/page.css +73 -0
  75. package/styles/index.css +58 -17
  76. package/templates/layouts/default.html +4 -6
  77. package/templates/layouts/example.html +1 -1
  78. package/templates/pages/default.html +13 -13
  79. package/templates/pages/index.html +9 -3
  80. package/templates/partials/code.html +1 -1
  81. package/templates/partials/colors.html +2 -2
  82. package/templates/partials/content.html +1 -1
  83. package/templates/partials/icons.html +3 -3
  84. package/templates/partials/nav-main.html +19 -8
  85. package/templates/partials/section.html +1 -1
  86. package/templates/partials/spaces.html +2 -2
  87. package/LICENSE.md +0 -9
  88. package/dist/assets/src/utils.d.ts +0 -2
  89. package/dist/types/index.d.ts +0 -6
  90. package/dist/types/renderer.d.ts +0 -14
  91. package/scripts/src/utils.ts +0 -20
  92. package/styles/02_objects/background.css +0 -7
  93. package/styles/02_objects/control.css +0 -25
  94. package/styles/02_objects/margin.css +0 -44
  95. package/styles/02_objects/padding.css +0 -44
  96. package/styles/02_objects/text.css +0 -3
  97. package/styles/02_objects/width.css +0 -16
  98. package/styles/03_components/nav/main.css +0 -39
  99. package/styles/03_components/text-flow.css +0 -5
  100. package/styles/04_layouts/page.css +0 -70
  101. /package/dist/assets/{src → services}/example.d.ts +0 -0
  102. /package/dist/assets/{src → services}/sidebar.d.ts +0 -0
@@ -0,0 +1,150 @@
1
+ /**
2
+ * Using `margin` to add margins top, right, bottom and left to your element.
3
+ * Possible variables are:
4
+ * - **--[space]** - set direclty a spacing unit
5
+ * - **--space-[space]** - set a predefined space
6
+ *
7
+ * Possible <spaces> are:
8
+ * - **mt** - margin-top
9
+ * - **mr** - margin-right
10
+ * - **mb** - margin-bottom
11
+ * - **ml** - margin-left
12
+ *
13
+ * @location utils.margin Margin
14
+ * @example
15
+ * <div class="bg bg-black" style="display: flow-root;">
16
+ * <div class="margin bg bg-white">text</div>
17
+ * </div>
18
+ */
19
+ .margin,
20
+ .mxy {
21
+ margin: var(--mt, calc(var(--space-unit) * var(--space-mt, var(--space-normal))))
22
+ var(--mr, calc(var(--space-unit) * var(--space-mr, var(--space-normal))))
23
+ var(--mb, calc(var(--space-unit) * var(--space-mb, var(--space-normal))))
24
+ var(--ml, calc(var(--space-unit) * var(--space-ml, var(--space-normal))));
25
+ }
26
+
27
+ /**
28
+ * Using `mt` to add margin top to your element.
29
+ * Possible variables are:
30
+ * - **--mt** - set direclty a spacing unit
31
+ * - **--space-mt** - set a predefined space
32
+ *
33
+ * @location utils.margin.top Margin top
34
+ * @example
35
+ * <div class="bg bg-black" style="display: flow-root;">
36
+ * <div class="mt bg bg-white">text</div>
37
+ * </div>
38
+ */
39
+ .mt,
40
+ .my {
41
+ margin-top: var(--mt, calc(var(--space-unit) * var(--space-mt, var(--space-normal))));
42
+ }
43
+
44
+ /**
45
+ * Using `mr` to add margin right to your element.
46
+ * Possible variables are:
47
+ * - **--mr** - set direclty a spacing unit
48
+ * - **--space-mr** - set a predefined space
49
+ *
50
+ * @location utils.margin.right Margin right
51
+ * @example
52
+ * <div class="bg bg-black" style="display: flow-root;">
53
+ * <div class="mr bg bg-white">text</div>
54
+ * </div>
55
+ */
56
+ .mr,
57
+ .mx {
58
+ margin-right: var(--mr, calc(var(--space-unit) * var(--space-mr, var(--space-normal))));
59
+ }
60
+
61
+ /**
62
+ * Using `mb` to add margin bottom to your element.
63
+ * Possible variables are:
64
+ * - **--mb** - set direclty a spacing unit
65
+ * - **--space-mb** - set a predefined space
66
+ *
67
+ * @location utils.margin.bottom Margin bottom
68
+ * @example
69
+ * <div class="bg bg-black" style="display: flow-root;">
70
+ * <div class="mb bg bg-white">text</div>
71
+ * </div>
72
+ */
73
+ .mb,
74
+ .my {
75
+ margin-bottom: var(--mb, calc(var(--space-unit) * var(--space-mb, var(--space-normal))));
76
+ }
77
+
78
+ /**
79
+ * Using `ml` to add margin left to your element.
80
+ * Possible variables are:
81
+ * - **--ml** - set direclty a spacing unit
82
+ * - **--space-ml** - set a predefined space
83
+ *
84
+ * @location utils.margin.left Margin left
85
+ * @example
86
+ * <div class="bg bg-black" style="display: flow-root;">
87
+ * <div class="ml bg bg-white">text</div>
88
+ * </div>
89
+ */
90
+ .ml,
91
+ .mx {
92
+ margin-left: var(--ml, calc(var(--space-unit) * var(--space-ml, var(--space-normal))));
93
+ }
94
+
95
+ /**
96
+ * Using `mxy` to add margin for the x and y axies to your element.
97
+ * Possible variables are:
98
+ * - **--[space]** - set direclty a spacing unit
99
+ * - **--space-[space]** - set a predefined space
100
+ *
101
+ * Possible <spaces> are:
102
+ * - **my** - margin-top and margin-bottom
103
+ * - **mx** - margin-left and margin-right
104
+
105
+ * @location utils.margin.xy Margin y-axis and x-axis
106
+ * @example
107
+ * <div class="bg bg-black" style="display: flow-root;">
108
+ * <div class="mxy bg bg-white">text</div>
109
+ * </div>
110
+ */
111
+ .mxy {
112
+ --mt: var(--my, calc(var(--space-unit) * var(--space-my, var(--space-normal))));
113
+ --mb: var(--my, calc(var(--space-unit) * var(--space-my, var(--space-normal))));
114
+ --ml: var(--mx, calc(var(--space-unit) * var(--space-mx, var(--space-normal))));
115
+ --mr: var(--mx, calc(var(--space-unit) * var(--space-mx, var(--space-normal))));
116
+ }
117
+
118
+ /**
119
+ * Using `my` to add margins tob and bottom with same size to your element.
120
+ * Possible variables are:
121
+ * - **--my** - set direclty a spacing unit
122
+ * - **--space-my** - set a predefined space
123
+ *
124
+ * @location utils.margin.y Margin y-axis
125
+ * @example
126
+ * <div class="bg bg-black" style="display: flow-root;">
127
+ * <div class="my bg bg-white">text</div>
128
+ * </div>
129
+ */
130
+ .my {
131
+ --mt: var(--my, calc(var(--space-unit) * var(--space-my, var(--space-normal))));
132
+ --mb: var(--my, calc(var(--space-unit) * var(--space-my, var(--space-normal))));
133
+ }
134
+
135
+ /**
136
+ * Using `mx` to add margins left and right with same size to your element.
137
+ * Possible variables are:
138
+ * - **--mx** - set direclty a spacing unit
139
+ * - **--space-mx** - set a predefined space
140
+ *
141
+ * @location utils.margin.x Margin x-axis
142
+ * @example
143
+ * <div class="bg bg-black" style="display: flow-root;">
144
+ * <div class="mx bg bg-white">text</div>
145
+ * </div>
146
+ */
147
+ .mx {
148
+ --ml: var(--mx, calc(var(--space-unit) * var(--space-mx, var(--space-normal))));
149
+ --mr: var(--mx, calc(var(--space-unit) * var(--space-mx, var(--space-normal))));
150
+ }
@@ -0,0 +1,134 @@
1
+ /**
2
+ * Using `padding` to add paddings top, right, bottom and left to your element.
3
+ * Possible variables are:
4
+ * - **--[space]** - set direclty a spacing unit
5
+ * - **--space-[space]** - set a predefined space
6
+ *
7
+ * Possible <spaces> are:
8
+ * - **pt** - padding-top
9
+ * - **pr** - padding-right
10
+ * - **pb** - padding-bottom
11
+ * - **pl** - padding-left
12
+ *
13
+ * @location utils.padding Padding
14
+ * @example
15
+ * <div class="padding bg bg-black"><div class="bg bg-white">text</div></div>
16
+ */
17
+ .padding,
18
+ .pxy {
19
+ padding: var(--pt, calc(var(--space-unit) * var(--space-pt, var(--space-normal))))
20
+ var(--pr, calc(var(--space-unit) * var(--space-pr, var(--space-normal))))
21
+ var(--pb, calc(var(--space-unit) * var(--space-pb, var(--space-normal))))
22
+ var(--pl, calc(var(--space-unit) * var(--space-pl, var(--space-normal))));
23
+ }
24
+
25
+ /**
26
+ * Using `pt` to add padding top to your element.
27
+ * Possible variables are:
28
+ * - **--pt** - set direclty a spacing unit
29
+ * - **--space-pt** - set a predefined space
30
+ *
31
+ * @location utils.padding.top Padding top
32
+ * @example
33
+ * <div class="pt bg bg-black"><div class="bg bg-white">text</div></div>
34
+ */
35
+ .pt,
36
+ .py {
37
+ padding-top: var(--pt, calc(var(--space-unit) * var(--space-pt, var(--space-normal))));
38
+ }
39
+
40
+ /**
41
+ * Using `pr` to add padding right to your element.
42
+ * Possible variables are:
43
+ * - **--pr** - set direclty a spacing unit
44
+ * - **--space-pr** - set a predefined space
45
+ *
46
+ * @location utils.padding.right Padding right
47
+ * @example
48
+ * <div class="pr bg bg-black"><div class="bg bg-white">text</div></div>
49
+ */
50
+ .pr,
51
+ .px {
52
+ padding-right: var(--pr, calc(var(--space-unit) * var(--space-pr, var(--space-normal))));
53
+ }
54
+
55
+ /**
56
+ * Using `pb` to add padding bottom to your element.
57
+ * Possible variables are:
58
+ * - **--pb** - set direclty a spacing unit
59
+ * - **--space-pb** - set a predefined space
60
+ *
61
+ * @location utils.padding.bottom Padding bottom
62
+ * @example
63
+ * <div class="pb bg bg-black"><div class="bg bg-white">text</div></div>
64
+ */
65
+ .pb,
66
+ .py {
67
+ padding-bottom: var(--pb, calc(var(--space-unit) * var(--space-pb, var(--space-normal))));
68
+ }
69
+
70
+ /**
71
+ * Using `pl` to add padding left to your element.
72
+ * Possible variables are:
73
+ * - **--pl** - set direclty a spacing unit
74
+ * - **--space-pl** - set a predefined space
75
+ *
76
+ * @location utils.padding.left Padding left
77
+ * @example
78
+ * <div class="pl bg bg-black"><div class="bg bg-white">text</div></div>
79
+ */
80
+ .pl,
81
+ .px {
82
+ padding-left: var(--pl, calc(var(--space-unit) * var(--space-pl, var(--space-normal))));
83
+ }
84
+
85
+ /**
86
+ * Using `pxy` to add padding for the x and y axies to your element.
87
+ * Possible variables are:
88
+ * - **--[space]** - set direclty a spacing unit
89
+ * - **--space-[space]** - set a predefined space
90
+ *
91
+ * Possible <spaces> are:
92
+ * - **my** - padding-top and padding-bottom
93
+ * - **mx** - padding-left and padding-right
94
+
95
+ * @location utils.padding.xy padding y-axis and x-axis
96
+ * @example
97
+ * <div class="pxy bg bg-black"><div class="bg bg-white">text</div></div>
98
+ */
99
+ .pxy {
100
+ --pt: var(--py, calc(var(--space-unit) * var(--space-py, var(--space-normal))));
101
+ --pb: var(--py, calc(var(--space-unit) * var(--space-py, var(--space-normal))));
102
+ --pl: var(--px, calc(var(--space-unit) * var(--space-px, var(--space-normal))));
103
+ --pr: var(--px, calc(var(--space-unit) * var(--space-px, var(--space-normal))));
104
+ }
105
+
106
+ /**
107
+ * Using `py` to add paddings tob and bottom with same size to your element.
108
+ * Possible variables are:
109
+ * - **--py** - set direclty a spacing unit
110
+ * - **--space-py** - set a predefined space
111
+ *
112
+ * @location utils.padding.y Padding y-axis
113
+ * @example
114
+ * <div class="py bg bg-black"><div class="bg bg-white">text</div></div>
115
+ */
116
+ .py {
117
+ --pt: var(--py, calc(var(--space-unit) * var(--space-py, var(--space-normal))));
118
+ --pb: var(--py, calc(var(--space-unit) * var(--space-py, var(--space-normal))));
119
+ }
120
+
121
+ /**
122
+ * Using `px` to add paddings left and right with same size to your element.
123
+ * Possible variables are:
124
+ * - **--px** - set direclty a spacing unit
125
+ * - **--space-px** - set a predefined space
126
+ *
127
+ * @location utils.padding.x Padding x-axis
128
+ * @example
129
+ * <div class="px bg bg-black"><div class="bg bg-white">text</div></div>
130
+ */
131
+ .px {
132
+ --pl: var(--px, calc(var(--space-unit) * var(--space-px, var(--space-normal))));
133
+ --pr: var(--px, calc(var(--space-unit) * var(--space-px, var(--space-normal))));
134
+ }
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Limit width of content. Use the `--width-content` variable to set the width and the `--width-min-offset-x` to
3
+ * set the minimum required space on the left and right side. If you want to offset the content a little bit but
4
+ * keep the same settings from `--width-content` and `--width-min-offset-x` you can use the `--width-content-offset`
5
+ * variable.
6
+ *
7
+ * @location utils.width Width (Content)
8
+ */
9
+ [class^="width-"],
10
+ [class*=" width-"] {
11
+ /* use padding to get content to a specific width https://css-tricks.com/using-max-for-an-inner-element-max-width/ */
12
+ --width-calc: max(
13
+ calc(var(--width-min-offset-x) - var(--width-content-offset, 0px)),
14
+ calc((100% - var(--width-content)) / 2 - var(--width-content-offset, 0px))
15
+ );
16
+
17
+ padding-inline: var(--width-calc);
18
+ }
19
+
20
+ /**
21
+ * @location utils.width.content Width base/default
22
+ * @example
23
+ * <div class="width-content">
24
+ * <div class="bg bg-black" style="min-height: 1em"></div>
25
+ * </div>
26
+ */
27
+
28
+ /* .width-content {} */
29
+
30
+ /**
31
+ * @location utils.width.small Width small
32
+ * @example
33
+ * <div class="width-sm">
34
+ * <div class="bg bg-black" style="min-height: 1em"></div>
35
+ * </div>
36
+ */
37
+ .width-sm {
38
+ --width-content: var(--width-sm);
39
+ }
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Buttons extend the `.control` class and can be used with different html attributes.
3
+ *
4
+ * @location components.button Button
5
+ * @example
6
+ * <button class="btn">Button</button>
7
+ * <button class="btn" disabled>Button disabled</button>
8
+ * <a href="#" class="btn">Link Button</a>
9
+ * <input type="submit" class="btn" value="Submit button" />
10
+ */
11
+ .btn {
12
+ --space-py: var(--btn-space-py, var(--space-xs));
13
+ --space-px: var(--btn-space-px, var(--space-sm));
14
+ --font-size: var(--btn-font-size, var(--font-size-normal));
15
+ --font-weight: var(--btn-font-weight, var(--font-weight-bold));
16
+
17
+ color: rgb(var(--btn-font-color, var(--font-color)));
18
+ background: rgb(var(--btn-bg-color, var(--bg-color)));
19
+ transition: all ease var(--btn-animation-time, var(--animation-time));
20
+ }
21
+
22
+ /**
23
+ * We are using the bg colors to modify the btn color. In combination with the accent color for hover effects.
24
+ *
25
+ * @location components.button.colors Colors
26
+ * @example
27
+ * <button class="btn bg-white">Button</button>
28
+ * <button class="btn bg-black">Button</button>
29
+ */
30
+ .btn[class*="bg-"]:hover:not([aria-disabled="true"], [disabled], .no-hover) {
31
+ --btn-bg-color: var(--accent-color);
32
+ }
33
+
34
+ /**
35
+ * The hover effect when using bg colors is disabled when using disabled attributes. Or you can manually disable it with `.no-hover`.
36
+ *
37
+ * @location components.button.colors.hover Hover effect
38
+ * @example
39
+ * <button class="btn bg-black" aria-disabled="true">Disabled by aria</button>
40
+ * <button class="btn bg-black" disabled>Disabled</button>
41
+ * <button class="btn bg-black no-hover">No hover</button>
42
+ */
@@ -1,32 +1,20 @@
1
1
  .colors {
2
- display: grid;
3
- grid-template-columns: repeat(var(--colors-columns, 1), 1fr);
4
- gap: var(--colors-gap, var(--size-normal));
5
-
6
- @container content (width > 300px) {
7
- --colors-columns: 2;
8
- }
9
-
10
- @container content (width > 620px) {
11
- --colors-columns: 3;
12
- }
13
-
14
- @container content (width > 940px) {
15
- --colors-columns: 4;
16
- }
2
+ --grid-columns: 4;
3
+ --grid-item-min-width: 200px;
17
4
  }
18
5
 
19
6
  .colors > .item {
7
+ --space-px: var(--space-md);
8
+ --space-py: var(--space-xl);
9
+
20
10
  display: flex;
21
11
  flex-direction: column;
22
- gap: var(--size-xs);
12
+ gap: calc(var(--space-xs) * var(--space-unit));
23
13
  justify-content: center;
24
14
 
25
- padding: var(--size-xl) var(--size-md);
26
-
27
15
  text-align: center;
28
16
 
29
- border: 1px solid rgb(var(--border-color, currentColor));
17
+ border: 1px solid rgb(var(--border-color, var(--font-color)));
30
18
 
31
19
  > .text {
32
20
  font-size: var(--font-size-md);
@@ -0,0 +1,16 @@
1
+ /**
2
+ * You can use the container class to wrap your content in a container.
3
+ *
4
+ * @location components.container Container
5
+ * @code
6
+ * <div class="container"></div>
7
+ */
8
+ .container {
9
+ > *:first-child {
10
+ margin-top: 0;
11
+ }
12
+
13
+ > *:last-child {
14
+ margin-bottom: 0;
15
+ }
16
+ }
@@ -1,11 +1,6 @@
1
1
  .example,
2
2
  .markup {
3
- border: 1px solid rgb(var(--code-border-color, var(--border-color)));
4
- }
5
-
6
- .example,
7
- .markup > .code > .hljs {
8
- padding: 1em;
3
+ border: 1px solid rgb(var(--code-border-color, var(--border-color, var(--font-color))));
9
4
  }
10
5
 
11
6
  .example {
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Use the auto grid class to define your custom grid layouts. Please note, all columns will have the same width.
3
+ * We are using css variables to define the grid:
4
+ * - `--grid-columns` (required): define how many columns your grid should have
5
+ * - `--grid-item-min-width` (required): define the min width of the containing items, when you use a count of 4 and a item
6
+ * width of 200px but there are only 650px availabe only three columns will be used. All items won't get smaller as
7
+ * this number.
8
+ *
9
+ * Modify the gap of your grid:
10
+ * - `--gap-x` (optional): column (x-axis) gap - space between items - eg. 3rem
11
+ * - `--gap-y` (optional): row (y-axis) gap - space between items - eg. 3rem
12
+ * - `--gap` (optional): Define column (x-axis) and row (y-axis) gap - eg. 3rem
13
+ * - `--gap-space-x` (optional): Define column (x-axis) gap - use existing space variables - eg. var(--space-xs)
14
+ * - `--gap-space-y` (optional): Define row (y-axis) gap - use existing space variables - eg. var(--space-xs)
15
+ * - `--gap-space` (optional): Define column (x-axis) and row (y-axis) gap - use existing space variables - eg. var(--space-xs)
16
+ *
17
+ * If you need to redefine the gap in a inner auto grid you can use `unset` or `inital` as vairable value inn the inner grid to fallback to default.
18
+ *
19
+ * @location components.grid-auto Auto Grid
20
+ * @example
21
+ * <div class="grid-auto" style="--grid-columns: 3; --grid-item-min-width: 300px;">
22
+ * <div class="bg bg-black pxy"></div>
23
+ * <div class="bg bg-black pxy"></div>
24
+ * <div class="bg bg-black pxy"></div>
25
+ * <div class="bg bg-black pxy"></div>
26
+ * <div class="bg bg-black pxy"></div>
27
+ * </div>
28
+ */
29
+ .grid-auto {
30
+ /* https://css-tricks.com/an-auto-filling-css-grid-with-max-columns/ */
31
+ --grid-gap-x: var(
32
+ --gap-x,
33
+ var(--gap, calc(var(--space-unit) * var(--gap-space-x, var(--gap-space, var(--space-normal)))))
34
+ );
35
+ --grid-gap-y: var(
36
+ --gap-y,
37
+ var(--gap, calc(var(--space-unit) * var(--gap-space-y, var(--gap-space, var(--space-normal)))))
38
+ );
39
+ --grid-gap-count: calc(var(--grid-columns) - 1);
40
+ --grid-total-gap-width: calc(var(--grid-gap-count) * var(--grid-gap-x));
41
+ --grid-item-max-width: calc((100% - var(--grid-total-gap-width)) / var(--grid-columns));
42
+
43
+ display: grid;
44
+ grid-gap: var(--grid-gap-y) var(--grid-gap-x);
45
+ grid-template-columns: repeat(
46
+ auto-fill,
47
+ minmax(max(var(--grid-item-min-width), var(--grid-item-max-width)), 1fr)
48
+ );
49
+ }
@@ -1,32 +1,20 @@
1
1
  .icons {
2
- display: grid;
3
- grid-template-columns: repeat(var(--icons-columns, 1), 1fr);
4
- gap: var(--icons-gap, var(--size-normal));
5
-
6
- @container content (width > 300px) {
7
- --icons-columns: 2;
8
- }
9
-
10
- @container content (width > 620px) {
11
- --icons-columns: 3;
12
- }
13
-
14
- @container content (width > 940px) {
15
- --icons-columns: 4;
16
- }
2
+ --grid-columns: 4;
3
+ --grid-item-min-width: 200px;
17
4
  }
18
5
 
19
6
  .icons > .item {
7
+ --space-px: var(--space-md);
8
+ --space-py: var(--space-xl);
9
+
20
10
  display: flex;
21
11
  flex-direction: column;
22
- gap: var(--size-xs);
12
+ gap: calc(var(--space-xs) * var(--space-unit));
23
13
  justify-content: center;
24
14
 
25
- padding: var(--size-xl) var(--size-md);
26
-
27
15
  text-align: center;
28
16
 
29
- border: 1px solid rgb(var(--border-color));
17
+ border: 1px solid rgb(var(--border-color, var(--font-color)));
30
18
 
31
19
  > .show,
32
20
  > .show::before,
@@ -0,0 +1,75 @@
1
+ /**
2
+ * @location components.navigation.burger-control Navigation Burger Control
3
+ * @example
4
+ * <nav class="nav">
5
+ * <button class="control burger" aria-label="Toggle Navigation" aria-expanded="false" aria-controls="target" style="--nav-burger-control-size: 3em; --space-px: .4; --space-py: .6">
6
+ * <span class="line"></span>
7
+ * <span class="line"></span>
8
+ * <span class="line"></span>
9
+ * </button>
10
+ * <div id="target" hidden>Controlled Area</div>
11
+ * </nav>
12
+ */
13
+
14
+ .nav-main .burger.control {
15
+ /* prettier-ignore */
16
+ --nav-burger-control-line-height-calc: var(--nav-burger-control-line-height, calc(
17
+ (
18
+ var(--nav-burger-control-size) -
19
+ (var(--py, calc(var(--space-unit) * var(--space-py))) * 2) -
20
+ (var(--nav-burger-control-line-space, var(--space-unit) / 2) * 2)
21
+ ) / 3
22
+ ));
23
+
24
+ position: relative;
25
+ width: calc(var(--nav-burger-control-size) * var(--nav-burger-control-width-multiplier, 1.4));
26
+ height: var(--nav-burger-control-size);
27
+ }
28
+
29
+ .nav-main .burger.control > .line {
30
+ position: absolute;
31
+ top: 50%;
32
+ left: 50%;
33
+ transform: translate(-50%, -50%);
34
+
35
+ display: block;
36
+
37
+ width: calc(100% - var(--px, calc(var(--space-unit) * var(--space-px))) * 2);
38
+ height: var(--nav-burger-control-line-height-calc);
39
+
40
+ background: rgb(var(--font-color));
41
+
42
+ transition: all var(--nav-burger-animation-time, 0.3s) ease;
43
+
44
+ &:first-child {
45
+ transform: translate(
46
+ -50%,
47
+ calc(
48
+ -50% - var(--nav-burger-control-line-space, var(--space-unit) / 2) - var(--nav-burger-control-line-height-calc)
49
+ )
50
+ );
51
+ }
52
+
53
+ &:last-child {
54
+ transform: translate(
55
+ -50%,
56
+ calc(
57
+ -50% + var(--nav-burger-control-line-space, var(--space-unit) / 2) + var(--nav-burger-control-line-height-calc)
58
+ )
59
+ );
60
+ }
61
+ }
62
+
63
+ .nav-main .burger.control[aria-expanded="true"] > .line {
64
+ &:first-child {
65
+ transform: translate(-50%, -50%) rotate(45deg);
66
+ }
67
+
68
+ &:nth-child(2) {
69
+ display: none;
70
+ }
71
+
72
+ &:last-child {
73
+ transform: translate(-50%, -50%) rotate(-45deg);
74
+ }
75
+ }
@@ -1,7 +1,7 @@
1
1
  .nav-list {
2
- --nav-list-item-px: var(--size-sm);
3
- --nav-list-item-py: var(--size-xs);
4
- --nav-list-item-border-color: var(--border-color);
2
+ --nav-list-item-space-px: var(--space-sm);
3
+ --nav-list-item-space-py: var(--space-xs);
4
+ --nav-list-item-border-color: var(--border-color, var(--font-color));
5
5
 
6
6
  text-align: left;
7
7
 
@@ -15,23 +15,21 @@
15
15
  margin-top: var(--nav-list-root-item-space, var(--size-sm));
16
16
  }
17
17
 
18
- .control {
19
- &.active {
20
- --font-color: var(--accent-color);
21
- }
18
+ .control.active {
19
+ --font-color: var(--accent-color);
22
20
  }
23
21
  }
24
22
 
25
23
  .nav-list > ul > li > .control {
26
- --py: var(--nav-list-item-py);
27
- --pr: var(--nav-list-item-px);
24
+ --space-py: var(--nav-list-item-space-py);
25
+ --space-pr: var(--nav-list-item-space-px);
28
26
  --font-weight: var(--font-weight-bold);
29
27
  --font-size: var(--font-size-md);
30
28
  }
31
29
 
32
30
  .nav-list > ul > li > ul > li > .control {
33
- --py: var(--nav-list-item-py);
34
- --px: var(--nav-list-item-px);
31
+ --space-py: var(--nav-list-item-space-py);
32
+ --space-px: var(--nav-list-item-space-px);
35
33
 
36
34
  text-align: left;
37
35
  border-left: 1px solid rgba(var(--nav-list-item-border-color) / var(--border-opacity, 0.1));