@splendidlabz/styles 4.0.0-alpha.1 → 4.0.0-beta.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 (62) hide show
  1. package/package.json +4 -8
  2. package/src/components/astro/fancylist.css +28 -0
  3. package/src/components/astro/index.css +2 -0
  4. package/src/{primitives → components/css}/card.css +8 -3
  5. package/src/{primitives → components/css}/indent-list.css +6 -6
  6. package/src/{primitives → components/css}/prose.css +17 -9
  7. package/src/{effects/stroke.css → components/css/simple-svg.css} +10 -0
  8. package/src/{primitives → components/css}/table.css +12 -3
  9. package/src/components/css/writing-mode.css +41 -0
  10. package/src/components/index.css +3 -6
  11. package/src/components/svelte/breadcrumbs.css +31 -0
  12. package/src/components/{browserframe.css → svelte/browserframe.css} +6 -6
  13. package/src/components/svelte/callout.css +33 -0
  14. package/src/components/svelte/index.css +10 -0
  15. package/src/components/svelte/resizer.css +44 -0
  16. package/src/components/svelte/status.css +37 -0
  17. package/src/components/{tabs.css → svelte/tabs.css} +2 -2
  18. package/src/effects/gradients.css +10 -6
  19. package/src/effects/index.css +1 -1
  20. package/src/{addons → effects}/scrollbars.css +25 -5
  21. package/src/effects/shadows.css +116 -0
  22. package/src/effects/text.css +37 -5
  23. package/src/form/checkbox-and-radio.css +1 -1
  24. package/src/form/input.css +2 -2
  25. package/src/form/textarea.css +1 -0
  26. package/src/generic/anchors-and-buttons.css +3 -2
  27. package/src/generic/form.css +2 -2
  28. package/src/layouts/macro/{flex-grid.css → grid-flex.css} +8 -7
  29. package/src/layouts/macro/grid.css +5 -12
  30. package/src/layouts/macro/index.css +1 -1
  31. package/src/layouts/macro/subgrid.css +3 -4
  32. package/src/layouts/macro/wrap.css +1 -1
  33. package/src/layouts/micro/breakout.css +14 -7
  34. package/src/layouts/micro/divider.css +3 -12
  35. package/src/layouts/micro/micro.css +0 -6
  36. package/src/layouts/micro/scrollable.css +2 -14
  37. package/src/layouts/micro/stack.css +1 -0
  38. package/src/layouts/position/edge.css +264 -25
  39. package/src/layouts/position/fixed.css +57 -30
  40. package/src/layouts/position/nudge.css +47 -28
  41. package/src/layouts/position/pos.css +51 -69
  42. package/src/layouts/position/sticky.css +6 -2
  43. package/src/layouts/shell/shell-grid.css +1 -1
  44. package/src/styles.css +1 -1
  45. package/src/tools/border.css +53 -3
  46. package/src/tools/outlines.css +13 -25
  47. package/src/tools/pigment.css +2 -2
  48. package/src/variables/variables.css +3 -3
  49. package/src/addons/index.css +0 -1
  50. package/src/astro/index.css +0 -1
  51. package/src/primitives/simple-svg.css +0 -7
  52. package/src/primitives/writing-mode.css +0 -51
  53. /package/src/{astro → components/astro}/textwall.css +0 -0
  54. /package/src/{primitives → components/css}/break-word.css +0 -0
  55. /package/src/{primitives → components/css}/hero-heading.css +0 -0
  56. /package/src/{primitives → components/css}/index.css +0 -0
  57. /package/src/{primitives → components/css}/shapes.css +0 -0
  58. /package/src/{primitives → components/css}/text.css +0 -0
  59. /package/src/components/{accordion.css → svelte/accordion.css} +0 -0
  60. /package/src/components/{drawer.css → svelte/drawer.css} +0 -0
  61. /package/src/components/{modal.css → svelte/modal.css} +0 -0
  62. /package/src/components/{popover.css → svelte/popover.css} +0 -0
@@ -1,74 +1,93 @@
1
- @theme {
2
- --nudge: 0;
3
- }
4
-
5
1
  /*********************
6
2
  * nudge utilities *
7
3
  *********************/
4
+
8
5
  @utility nudge {
9
- position: relative;
6
+ margin-block: var(--nudge-y, var(--nudge, 0));
7
+ margin-inline: var(--nudge-x, var(--nudge, 0));
10
8
  }
11
9
 
12
10
  @utility nudge-top {
13
- @apply nudge;
14
- top: var(--nudge-y, var(--nudge, 0));
11
+ margin-block-start: calc(var(--nudge-y, var(--nudge)));
15
12
  }
16
13
 
17
14
  @utility nudge-topleft {
18
15
  @apply nudge-top;
19
- left: var(--nudge-x, var(--nudge, 0));
16
+ margin-block-start: calc(var(--nudge-y, var(--nudge)));
17
+ margin-inline-start: calc(var(--nudge-x, var(--nudge)));
20
18
  }
21
19
 
22
20
  @utility nudge-topright {
23
21
  @apply nudge-top;
24
- right: var(--nudge-x, var(--nudge, 0));
22
+ margin-inline-end: calc(var(--nudge-x, var(--nudge)));
25
23
  }
26
24
 
27
25
  @utility nudge-topfull {
28
- @apply nudge-top;
29
- left: var(--nudge-x, var(--nudge, 0));
30
- right: var(--nudge-x, var(--nudge, 0));
26
+ margin-block-start: calc(var(--nudge-y, var(--nudge)));
27
+ margin-inline: calc(var(--nudge-x, var(--nudge)));
31
28
  }
32
29
 
33
30
  @utility nudge-bottom {
34
- @apply nudge;
35
- bottom: var(--nudge-y, var(--nudge, 0));
31
+ margin-block-end: calc(var(--nudge-y, var(--nudge)));
36
32
  }
37
33
 
38
34
  @utility nudge-bottomleft {
39
35
  @apply nudge-bottom;
40
- left: var(--nudge-x, var(--nudge, 0));
36
+ margin-inline-start: calc(var(--nudge-x, var(--nudge)));
41
37
  }
42
38
 
43
39
  @utility nudge-bottomright {
44
40
  @apply nudge-bottom;
45
- right: var(--nudge-x, var(--nudge, 0));
41
+ margin-inline-end: calc(var(--nudge-x, var(--nudge)));
46
42
  }
47
43
 
48
44
  @utility nudge-bottomfull {
49
45
  @apply nudge-bottom;
50
- left: var(--nudge-x, var(--nudge, 0));
51
- right: var(--nudge-x, var(--nudge, 0));
46
+ margin-inline: calc(var(--nudge-x, var(--nudge)));
52
47
  }
53
48
 
54
49
  @utility nudge-left {
55
- @apply nudge;
56
- left: var(--nudge-x, var(--nudge, 0));
50
+ position: relative;
51
+ margin-inline-start: var(--nudge-x, var(--nudge, 0));
57
52
  }
58
53
 
59
54
  @utility nudge-leftfull {
60
- @apply nudge-left;
61
- top: var(--nudge-y, var(--nudge, 0));
62
- bottom: var(--nudge-y, var(--nudge, 0));
55
+ margin-block: var(--nudge-y, var(--nudge, 0));
56
+ margin-inline-start: var(--nudge-x, var(--nudge, 0));
63
57
  }
64
58
 
65
59
  @utility nudge-right {
66
- @apply nudge;
67
- right: var(--nudge-x, var(--nudge, 0));
60
+ margin-inline-end: var(--nudge-x, var(--nudge, 0));
68
61
  }
69
62
 
70
63
  @utility nudge-rightfull {
71
- @apply nudge-right;
72
- top: var(--nudge-y, var(--nudge, 0));
73
- bottom: var(--nudge-y, var(--nudge, 0));
64
+ margin-block: var(--nudge-y, var(--nudge, 0));
65
+ margin-inline-end: var(--nudge-x, var(--nudge, 0));
66
+ }
67
+
68
+ @utility nudge-overlay {
69
+ margin-block: var(--nudge-y, var(--nudge, 0));
70
+ margin-inline: var(--nudge-x, var(--nudge, 0));
71
+ }
72
+
73
+ /*********************
74
+ * Functional Utilities *
75
+ *********************/
76
+ @utility nudge-* {
77
+ --nudge: --value([length]);
78
+ --nudge: calc(var(--spacing) * --value(integer));
79
+ }
80
+
81
+ @utility nudge-x-* {
82
+ --nudge-x: --value([length]);
83
+ --nudge-x: calc(var(--spacing) * --value(integer));
84
+ }
85
+
86
+ @utility nudge-y-* {
87
+ --nudge-y: --value([length]);
88
+ --nudge-y: calc(var(--spacing) * --value(integer));
89
+ }
90
+
91
+ @utility inner-radius {
92
+ border-radius: calc(var(--radius) - var(--nudge));
74
93
  }
@@ -29,138 +29,123 @@
29
29
  /* prettier-ignore */
30
30
  @utility stack-pos-left { place-self: center start; }
31
31
 
32
- /* prettier-ignore */
33
- @utility stack-pos-lefttop { place-self: start start; }
34
-
35
- /* prettier-ignore */
36
- @utility stack-pos-leftbottom { place-self: end start; }
37
-
38
32
  /* prettier-ignore */
39
33
  @utility stack-pos-leftfull { place-self: stretch start; }
40
34
 
41
35
  /* prettier-ignore */
42
36
  @utility stack-pos-right { place-self: center end; }
43
37
 
44
- /* prettier-ignore */
45
- @utility stack-pos-righttop { place-self: start end; }
46
-
47
- /* prettier-ignore */
48
- @utility stack-pos-rightbottom { place-self: end end; }
49
-
50
38
  /* prettier-ignore */
51
39
  @utility stack-pos-rightfull { place-self: stretch end; }
52
40
 
53
41
  /* prettier-ignore */
54
42
  @utility stack-pos-center { place-self: center center; }
55
43
 
44
+ @utility stack-pos-overlay {
45
+ display: grid;
46
+
47
+ > * {
48
+ grid-column: 1 / span 1;
49
+ grid-row: 1 / span 1;
50
+ }
51
+ }
52
+
56
53
  /*********************
57
54
  * Relative pos utilities *
58
55
  *********************/
59
- @utility relative-pos {
60
- position: absolute;
61
- }
62
-
63
56
  @utility relative-pos-top {
64
- @apply relative-pos;
57
+ position: absolute;
65
58
  inset-block-start: 0;
59
+ inset-inline: 0;
60
+ width: fit-content;
61
+ margin-inline: auto;
66
62
  }
67
63
 
68
64
  @utility relative-pos-topleft {
69
- @apply relative-pos;
70
- @apply relative-pos-top;
65
+ position: absolute;
66
+ inset-block-start: 0;
71
67
  inset-inline-start: 0;
72
68
  }
73
69
 
74
70
  @utility relative-pos-topright {
75
- @apply relative-pos;
76
- @apply relative-pos-top;
71
+ position: absolute;
72
+ inset-block-start: 0;
77
73
  inset-inline-end: 0;
78
74
  }
79
75
 
80
76
  @utility relative-pos-topfull {
81
- @apply relative-pos;
82
- @apply relative-pos-top;
77
+ position: absolute;
78
+ inset-block-start: 0;
83
79
  inset-inline: 0;
84
80
  }
85
81
 
86
82
  @utility relative-pos-bottom {
87
- @apply relative-pos;
83
+ position: absolute;
88
84
  inset-block-end: 0;
85
+ inset-inline: 0;
86
+ width: fit-content;
87
+ margin-inline: auto;
89
88
  }
90
89
 
91
90
  @utility relative-pos-bottomleft {
92
- @apply relative-pos;
93
- @apply relative-pos-bottom;
91
+ position: absolute;
92
+ inset-block-end: 0;
94
93
  inset-inline-start: 0;
95
94
  }
96
95
 
97
96
  @utility relative-pos-bottomright {
98
- @apply relative-pos;
99
- @apply relative-pos-bottom;
97
+ position: absolute;
98
+ inset-block-end: 0;
100
99
  inset-inline-end: 0;
101
100
  }
102
101
 
103
102
  @utility relative-pos-bottomfull {
104
- @apply relative-pos;
103
+ position: absolute;
105
104
  inset-block-end: 0;
106
105
  inset-inline: 0;
107
106
  }
108
107
 
109
108
  @utility relative-pos-left {
110
- @apply relative-pos;
111
- inset-inline-start: 0;
112
- }
113
-
114
- @utility relative-pos-lefttop {
115
- @apply relative-pos;
116
- @apply relative-pos-left;
117
- inset-block-start: 0;
118
- }
119
-
120
- @utility relative-pos-leftbottom {
121
- @apply relative-pos;
122
- @apply relative-pos-left;
123
- inset-block-end: 0;
109
+ & {
110
+ position: absolute;
111
+ inset-block: 0;
112
+ inset-inline-start: 0;
113
+ height: fit-content;
114
+ margin-block: auto;
115
+ }
124
116
  }
125
117
 
126
118
  @utility relative-pos-leftfull {
127
- @apply relative-pos;
128
- @apply relative-pos-left;
119
+ position: absolute;
129
120
  inset-block: 0;
121
+ inset-inline-start: 0;
130
122
  }
131
123
 
132
124
  @utility relative-pos-right {
133
- @apply relative-pos;
134
- inset-inline-end: 0;
135
- }
136
-
137
- @utility relative-pos-righttop {
138
- @apply relative-pos;
139
- @apply relative-pos-right;
140
- inset-block-start: 0;
141
- }
142
-
143
- @utility relative-pos-rightbottom {
144
- @apply relative-pos;
145
- @apply relative-pos-right;
146
- inset-block-end: 0;
125
+ & {
126
+ position: absolute;
127
+ inset-block: 0;
128
+ inset-inline-end: 0;
129
+ height: fit-content;
130
+ margin-block: auto;
131
+ }
147
132
  }
148
133
 
149
134
  @utility relative-pos-rightfull {
150
- @apply relative-pos;
151
- @apply relative-pos-right;
135
+ position: absolute;
152
136
  inset-block: 0;
137
+ inset-inline-end: 0;
153
138
  }
154
139
 
155
140
  @utility relative-pos-center {
156
- @apply relative-pos;
141
+ position: absolute;
157
142
  top: 50%;
158
143
  left: 50%;
159
144
  transform: translate(-50%, -50%);
160
145
  }
161
146
 
162
147
  @utility relative-pos-overlay {
163
- @apply relative-pos;
148
+ position: absolute;
164
149
  inset: 0;
165
150
  }
166
151
 
@@ -322,13 +307,10 @@
322
307
  }
323
308
 
324
309
  @utility pos-overlay {
325
- :where([class*='stack']) > & {
326
- display: grid;
310
+ @apply nudge-overlay;
327
311
 
328
- > * {
329
- grid-column: 1 / span 1;
330
- grid-row: 1 / span 1;
331
- }
312
+ :where([class*='stack']) > & {
313
+ @apply stack-pos-overlay;
332
314
  }
333
315
 
334
316
  :where([class*='relative']) > & {
@@ -4,8 +4,12 @@
4
4
  z-index: var(--z-index, 15);
5
5
 
6
6
  :where([class*='grid'] > &) {
7
- align-self: start; /* Why not stretch? */
7
+ align-self: start;
8
8
  }
9
9
  }
10
10
 
11
- @custom-variant sticking (&.sticking);
11
+ @custom-variant sticking {
12
+ &.sticking {
13
+ @slot;
14
+ }
15
+ }
@@ -20,7 +20,7 @@
20
20
  minmax(0, var(--rsb-width, auto));
21
21
  }
22
22
 
23
- & > .is(header, .Full) {
23
+ & > :is(header, footer, .full) {
24
24
  grid-column: 1 / -1;
25
25
  }
26
26
 
package/src/styles.css CHANGED
@@ -4,7 +4,7 @@
4
4
  @import './tools/index.css';
5
5
  @import './generic/index.css';
6
6
  @import './form/index.css';
7
- @import './primitives/index.css';
7
+ @import './components/css/index.css';
8
8
  @import './layouts/index.css';
9
9
  @import './type/index.css';
10
10
  @import './effects/index.css';
@@ -1,9 +1,59 @@
1
- @utility border-scaffold {
2
- border: var(--border-width) var(--border-style) var(--border-color);
3
- border-radius: var(--radius);
1
+ @utility margin-scaffold {
2
+ margin-block: var(--margin-block, var(--margin, 0));
3
+ margin-inline: var(--margin-inline, var(--margin, 0));
4
4
  }
5
5
 
6
6
  @utility padding-scaffold {
7
7
  padding-block: var(--padding-block, var(--padding, 0));
8
8
  padding-inline: var(--padding-inline, var(--padding, 0));
9
9
  }
10
+
11
+ @utility border-scaffold {
12
+ border: var(--border-width) var(--border-style) var(--border-color);
13
+ border-radius: var(--radius);
14
+ }
15
+
16
+ @utility radius-* {
17
+ --radius: --value([length]);
18
+ --radius: calc(var(--spacing) * --value(integer));
19
+ }
20
+
21
+ @utility rounded-* {
22
+ border-radius: calc(var(--spacing) --value(integer));
23
+ }
24
+
25
+ @utility rounded-t-* {
26
+ border-top-left-radius: calc(var(--spacing) --value(integer));
27
+ border-top-right-radius: calc(var(--spacing) --value(integer));
28
+ }
29
+
30
+ @utility rounded-b-* {
31
+ border-bottom-left-radius: calc(var(--spacing) --value(integer));
32
+ border-bottom-right-radius: calc(var(--spacing) --value(integer));
33
+ }
34
+
35
+ @utility rounded-l-* {
36
+ border-top-left-radius: calc(var(--spacing) --value(integer));
37
+ border-bottom-left-radius: calc(var(--spacing) --value(integer));
38
+ }
39
+
40
+ @utility rounded-r-* {
41
+ border-top-right-radius: calc(var(--spacing) --value(integer));
42
+ border-bottom-right-radius: calc(var(--spacing) --value(integer));
43
+ }
44
+
45
+ @utility rounded-tl-* {
46
+ border-top-left-radius: calc(var(--spacing) --value(integer));
47
+ }
48
+
49
+ @utility rounded-tr-* {
50
+ border-top-right-radius: calc(var(--spacing) --value(integer));
51
+ }
52
+
53
+ @utility rounded-bl-* {
54
+ border-bottom-left-radius: calc(var(--spacing) --value(integer));
55
+ }
56
+
57
+ @utility rounded-br-* {
58
+ border-bottom-right-radius: calc(var(--spacing) --value(integer));
59
+ }
@@ -3,47 +3,35 @@
3
3
  * Useful for all outline transitions and animations
4
4
  *********************/
5
5
 
6
- /* Can improve this... */
7
- @layer base {
8
- * {
9
- outline: var(--outline-width) var(--outline-style) transparent;
10
- outline-offset: var(--outline-offset);
11
- }
12
- }
13
-
14
6
  @utility outline-scaffold {
15
7
  & {
16
- outline: var(--outline-width) var(--outline-style) transparent;
8
+ outline: var(--outline-width) var(--outline-style)
9
+ var(--outline-color, transparent);
17
10
  outline-offset: var(--outline-offset);
18
11
 
19
- &:focus {
20
- @apply outline-visible;
12
+ &:focus-visible {
13
+ outline-color: var(--outline-focus-color);
21
14
  }
22
15
  }
23
16
  }
24
17
 
25
- /* Utility to make outline visible. typically used in focus or focus-visible */
26
- @utility outline-visible {
27
- outline-color: var(--outline-color);
28
- }
29
-
30
- @utility focus-outline-visible {
31
- &:focus {
32
- @apply outline-visible;
33
- }
34
- }
35
-
36
18
  @utility focus-within {
37
19
  & {
38
20
  outline: var(--outline-width) var(--outline-style) transparent;
39
21
  outline-offset: var(--outline-offset);
40
- }
41
22
 
42
- &:focus-within {
43
- outline-color: var(--outline-color);
23
+ &:focus-within {
24
+ outline-color: var(--outline-focus-color);
25
+ }
26
+
27
+ > * {
28
+ --outline-color: transparent;
29
+ }
44
30
  }
45
31
  }
46
32
 
33
+ /* Maybe Blog about this.
34
+ These three properties used to preserve outlines, because overflow cuts off outlines. Content-box is necessary. If not, box will cut on the right side. (in Flex environments). */
47
35
  /* These preserve outlines on scrollable elements that use a flex display *
48
36
  * Notes:
49
37
  - content-box is necessary, if not present, box will be cut on the right side
@@ -143,7 +143,7 @@ Usage with the Fill System
143
143
  &.selected,
144
144
  &.checked,
145
145
  &[aria-current],
146
- &[aria-selected],
146
+ &[aria-selected='true'],
147
147
  &[aria-expanded='true'] {
148
148
  border-color: var(--border-selected-color, var(--border-color));
149
149
  color: var(--text-selected-color, var(--text-color));
@@ -155,7 +155,7 @@ Usage with the Fill System
155
155
  &.selected,
156
156
  &.checked,
157
157
  &[aria-current],
158
- &[aria-selected],
158
+ &[aria-selected='true'],
159
159
  &[aria-expanded='true'] {
160
160
  :where(svg path) {
161
161
  fill: var(--fill-selected-color, var(--fill-color, var(--text-color)));
@@ -3,10 +3,10 @@
3
3
  --bg-color: var(--color-cdarkblue-900);
4
4
  --text-color: var(--color-cneutral-100);
5
5
  --leading: 1.5;
6
- --gap: 1lh;
6
+ --gap: 1rlh;
7
7
 
8
8
  /* Padding */
9
- --padding: 1rem;
9
+ --padding: 1rlh;
10
10
 
11
11
  /* Borders */
12
12
  --border-width: 1px;
@@ -17,7 +17,7 @@
17
17
  /* Outline */
18
18
  --outline-width: 2px;
19
19
  --outline-style: solid;
20
- --outline-color: oklch(61.52% 0.178 257.59deg);
20
+ --outline-focus-color: oklch(61.52% 0.178 257.59deg);
21
21
  --outline-offset: 0px;
22
22
 
23
23
  /* Transition */
@@ -1 +0,0 @@
1
- @import './scrollbars.css';
@@ -1 +0,0 @@
1
- @import './textwall.css';
@@ -1,7 +0,0 @@
1
- @utility simple-svg {
2
- * {
3
- fill: var(--fill-color);
4
- stroke: var(--stroke-color); /* Fallback to text color */
5
- stroke-width: var(--stroke-width);
6
- }
7
- }
@@ -1,51 +0,0 @@
1
- @utility writing-scaffold {
2
- /* Prevents text from transitioning. Enable manually if you want transition */
3
- transition: none;
4
- }
5
-
6
- @utility writing-normal {
7
- @apply writing-scaffold;
8
- writing-mode: horizontal-tb;
9
- }
10
-
11
- @utility writing-rotated-left {
12
- & {
13
- @apply writing-scaffold;
14
- writing-mode: vertical-rl;
15
- text-orientation: sideways;
16
- transform: rotate(180deg);
17
-
18
- /* // transform: scale( -1, -1 ); // This is the alternative if we don't want to use rotate */
19
- }
20
- }
21
-
22
- @utility writing-rotated-right {
23
- & {
24
- @apply writing-scaffold;
25
- writing-mode: vertical-rl;
26
- text-orientation: sideways;
27
- }
28
- }
29
-
30
- @utility writing-downwards {
31
- & {
32
- @apply writing-scaffold;
33
- writing-mode: vertical-lr;
34
- text-orientation: upright;
35
- }
36
- }
37
-
38
- /* Alias for writing-downwards */
39
- @utility writing-downards-lr {
40
- & {
41
- @apply writing-downwards;
42
- }
43
- }
44
-
45
- @utility writing-downwards-rl {
46
- & {
47
- @apply writing-scaffold;
48
- writing-mode: vertical-rl;
49
- text-orientation: upright;
50
- }
51
- }
File without changes
File without changes
File without changes
File without changes
File without changes