@splendidlabz/styles 4.8.2 → 4.10.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.
@@ -3,40 +3,36 @@
3
3
  } */
4
4
 
5
5
  @utility frosted-glass {
6
- & {
7
- @apply transition-scaffold-extended;
8
- position: relative;
9
- backdrop-filter: blur(var(--blur, 16px));
10
- }
6
+ @apply transition-scaffold-extended;
7
+ position: relative;
8
+ backdrop-filter: blur(var(--blur, 16px));
11
9
  }
12
10
 
13
11
  /* Use this as a sibling element in stack */
14
12
  @utility frosted-glass-advanced {
15
- & {
16
- pointer-events: none;
17
- margin: calc(var(--refraction) * -1);
18
- padding: var(--refraction);
13
+ pointer-events: none;
14
+ margin: calc(var(--refraction) * -1);
15
+ padding: var(--refraction);
19
16
 
20
- /* Using position absolute is another way */
21
- /* position: absolute; */
22
- /* inset: calc(var(--refraction) * -1); */ /* z-index: -1; */
23
- /* width: calc(100% + var(--refraction) * 2); */
24
- /* height: calc(100% + var(--refraction) * 2); */
25
- border-radius: inherit;
26
- backdrop-filter: blur(16px);
27
- mask-image:
28
- linear-gradient(
29
- to bottom,
30
- transparent 0% var(--refraction),
31
- black var(--refraction) calc(100% - var(--refraction)),
32
- transparent calc(100% - var(--refraction)) 100%
33
- ),
34
- linear-gradient(
35
- to right,
36
- transparent 0% var(--refraction),
37
- black var(--refraction) calc(100% - var(--refraction)),
38
- transparent calc(100% - var(--refraction)) 100%
39
- );
40
- mask-composite: intersect;
41
- }
17
+ /* Using position absolute is another way */
18
+ /* position: absolute; */
19
+ /* inset: calc(var(--refraction) * -1); */ /* z-index: -1; */
20
+ /* width: calc(100% + var(--refraction) * 2); */
21
+ /* height: calc(100% + var(--refraction) * 2); */
22
+ border-radius: inherit;
23
+ backdrop-filter: blur(16px);
24
+ mask-image:
25
+ linear-gradient(
26
+ to bottom,
27
+ transparent 0% var(--refraction),
28
+ black var(--refraction) calc(100% - var(--refraction)),
29
+ transparent calc(100% - var(--refraction)) 100%
30
+ ),
31
+ linear-gradient(
32
+ to right,
33
+ transparent 0% var(--refraction),
34
+ black var(--refraction) calc(100% - var(--refraction)),
35
+ transparent calc(100% - var(--refraction)) 100%
36
+ );
37
+ mask-composite: intersect;
42
38
  }
@@ -1,24 +1,66 @@
1
+ /* For linear/conic gradient */
1
2
  @property --gradient-angle {
2
- syntax: '*';
3
- initial-value: to bottom;
4
- inherits: false;
3
+ syntax: '<angle> | <custom-ident>+';
4
+ initial-value: 180deg;
5
+ inherits: true;
6
+ }
7
+
8
+ /* For radial gradient. */
9
+ @property --gradient-shape {
10
+ syntax: 'circle | ellipse';
11
+ initial-value: ellipse;
12
+ inherits: true;
13
+ }
14
+
15
+ /* For radial/conic gradient */
16
+ @property --gradient-position {
17
+ syntax: '<length-percentage>+ | <custom-ident>+';
18
+ initial-value: 50% 50%;
19
+ inherits: true;
20
+ }
21
+
22
+ /* For radial-gradient */
23
+ @property --gradient-size {
24
+ syntax: '<length-percentage>+ | closest-side | closest-corner | farthest-side | farthest-corner';
25
+ initial-value: farthest-corner;
26
+ inherits: true;
27
+ }
28
+
29
+ /*********************
30
+ * Custom functions - Useful when @functions have baseline support *
31
+ *********************/
32
+ @function --linear-gradient(--gradient) {
33
+ result: linear-gradient(
34
+ var(--gradient-angle) in var(--color-space) var(--hue-interpolation),
35
+ var(--gradient, var(--tw-gradient))
36
+ );
37
+ }
38
+
39
+ @function --radial-gradient(--gradient) {
40
+ result: radial-gradient(
41
+ var(--gradient-shape) var(--gradient-size) at var(--gradient-position) in
42
+ var(--color-space) var(--hue-interpolation),
43
+ var(--gradient, var(--tw-gradient))
44
+ );
45
+ }
46
+
47
+ @function --conic-gradient(--gradient) {
48
+ result: conic-gradient(
49
+ from var(--gradient-angle) at var(--gradient-position) in var(--color-space)
50
+ var(--hue-interpolation),
51
+ var(--gradient, var(--tw-gradient))
52
+ );
5
53
  }
6
54
 
7
55
  /* Gradient Defaults */
8
56
  @layer base {
9
57
  :root {
10
58
  /* --gradient: ; */
11
- --gradient-alpha: 1;
12
- --gradient-angle: to bottom;
13
- --gradient-position: center; /* For radial and conic gradients */
14
- --gradient-shape: ; /* For radial and conic gradients */
15
- --gradient-size: ; /* For radial gradient */
16
59
  --color-space: oklch;
17
60
  --hue-interpolation: ;
18
61
  }
19
62
  }
20
63
 
21
- /* These don't work in Tailwind 4 and we need to adjust them */
22
64
  @utility tw-gradient {
23
65
  --tw-gradient:
24
66
  var(--tw-gradient-from) var(--tw-gradient-from-position),
@@ -26,19 +68,10 @@
26
68
  }
27
69
 
28
70
  @utility gradient {
29
- & {
30
- @apply tw-gradient;
31
- background-image: linear-gradient(
32
- var(--gradient-angle) in var(--color-space) var(--hue-interpolation),
33
- var(--gradient, var(--tw-gradient))
34
- );
35
- }
36
- }
37
-
38
- @function --linear-gradient(--gradient) {
39
- result: linear-gradient(
71
+ @apply tw-gradient;
72
+ background-image: linear-gradient(
40
73
  var(--gradient-angle) in var(--color-space) var(--hue-interpolation),
41
- var(--gradient)
74
+ var(--gradient, var(--tw-gradient))
42
75
  );
43
76
  }
44
77
 
@@ -47,35 +80,41 @@
47
80
  }
48
81
 
49
82
  @utility radial-gradient {
50
- & {
51
- @apply tw-gradient;
52
- background-image: radial-gradient(
53
- var(--gradient-shape) var(--gradient-size) at var(--gradient-position),
54
- var(--tw-gradient-stops, var(--gradient))
55
- );
56
- }
83
+ @apply tw-gradient;
84
+ background-image: radial-gradient(
85
+ var(--gradient-shape) var(--gradient-size) at var(--gradient-position) in
86
+ var(--color-space) var(--hue-interpolation),
87
+ var(--gradient, var(--tw-gradient))
88
+ );
57
89
  }
58
90
 
59
91
  @utility conic-gradient {
60
- & {
61
- @apply tw-gradient;
62
- background-image: conic-gradient(
63
- from var(--gradient-angle) at var(--gradient-position),
64
- var(--tw-gradient-stops, var(--gradient))
65
- );
66
- }
92
+ @apply tw-gradient;
93
+ background-image: conic-gradient(
94
+ from var(--gradient-angle) at var(--gradient-position) in var(--color-space)
95
+ var(--hue-interpolation),
96
+ var(--gradient, var(--tw-gradient))
97
+ );
67
98
  }
68
99
 
69
100
  @utility text-gradient {
70
- & {
71
- @apply gradient;
72
- display: inline-flex;
73
- -webkit-text-fill-color: transparent;
74
- background-clip: text;
101
+ @apply gradient;
102
+ display: inline-flex;
103
+ -webkit-text-fill-color: transparent;
104
+ background-clip: text;
75
105
 
76
- /* Allows multiline gradients in Safari */
77
- box-decoration-break: clone;
78
- }
106
+ /* Allows multiline gradients in Safari */
107
+ box-decoration-break: clone;
108
+ }
109
+
110
+ @utility gradient-text {
111
+ @apply gradient;
112
+ display: inline-flex;
113
+ -webkit-text-fill-color: transparent;
114
+ background-clip: text;
115
+
116
+ /* Allows multiline gradients in Safari */
117
+ box-decoration-break: clone;
79
118
  }
80
119
 
81
120
  /*********************
@@ -119,7 +158,9 @@
119
158
  /*********************
120
159
  * Functional Utiliites for Gradients *
121
160
  *********************/
161
+ /* prettier-ignore */
122
162
  @utility gradient-angle-* {
163
+ --gradient-angle: --value(number)deg;
123
164
  --gradient-angle: --value([angle]);
124
165
  }
125
166
 
@@ -130,3 +171,7 @@
130
171
  @utility gradient-shape-* {
131
172
  --gradient-shape: --value([shape]);
132
173
  } */
174
+
175
+ @utility gradient-* {
176
+ --gradient-shape: --value('circle', 'ellipse');
177
+ }
@@ -1,13 +1,132 @@
1
- /* .highlight-underline {
2
- } */
3
-
4
- @utility highlight-bg {
5
- & {
6
- /* line-height: 1; */
7
- background-image: linear-gradient(
8
- transparent 0 var(--highlight-start, 0),
9
- var(--highlight-color) var(--highlight-start, 0) var(--highlight-end, 1lh),
10
- transparent var(--highlight-end, 1lh)
1
+ @theme {
2
+ --highlight-start: 0lh;
3
+ --highlight-end: 1lh;
4
+ --highlight-skew: 0em;
5
+ --highlight-padding: 0em;
6
+ --highlight-left-dir: to bottom right;
7
+ --highlight-right-dir: to top left;
8
+ }
9
+
10
+ @utility highlight {
11
+ --_highlight-height: calc(var(--highlight-end) - var(--highlight-start));
12
+ display: inline;
13
+ margin-inline: calc(var(--highlight-skew) * -1);
14
+ padding-inline: calc(var(--highlight-skew) + var(--highlight-padding));
15
+ background-image:
16
+ linear-gradient(
17
+ var(--highlight-left-dir),
18
+ transparent 50%,
19
+ var(--gradient-start, var(--highlight-color)) 50%
20
+ ),
21
+ linear-gradient(
22
+ var(--gradient-angle, 90deg),
23
+ var(--gradient-start, var(--highlight-color)),
24
+ var(--gradient-end, var(--highlight-color))
25
+ ),
26
+ linear-gradient(
27
+ var(--highlight-right-dir),
28
+ transparent 50%,
29
+ var(--gradient-end, var(--highlight-color)) 50%
11
30
  );
31
+ background-position:
32
+ left var(--highlight-start),
33
+ center var(--highlight-start),
34
+ right var(--highlight-start);
35
+ background-size:
36
+ var(--highlight-skew) var(--_highlight-height),
37
+ calc(100% - var(--highlight-skew) * 2 + 1px) var(--_highlight-height),
38
+ var(--highlight-skew) var(--_highlight-height);
39
+ background-repeat: no-repeat;
40
+ box-decoration-break: clone;
41
+ }
42
+
43
+ @utility highlight-* {
44
+ /* highlight-color */
45
+ --highlight-color: --value(--color-*, [color]);
46
+ --highlight-color: oklch(
47
+ from --value(--color-*, [color]) l c h / --modifier(integer) %
48
+ );
49
+ }
50
+
51
+ /* prettier-ignore */
52
+ @utility highlight-start-* {
53
+ --highlight-start: --value([length]);
54
+ --highlight-start: --value(number)lh;
55
+
56
+ }
57
+
58
+ /* prettier-ignore */
59
+ @utility highlight-end-* {
60
+ --highlight-end: --value([length]);
61
+ --highlight-end: --value(number)lh;
62
+ }
63
+
64
+ @utility highlight-before {
65
+ &::before {
66
+ content: '';
67
+ position: absolute;
68
+ inset: var(--highlight-start, 0.24lh)
69
+ calc(var(--highlight-padding, 0.25em) * -1)
70
+ calc(100% - var(--highlight-end, 0.62lh))
71
+ calc(var(--highlight-padding, 0.25em) * -1);
72
+ z-index: -1;
73
+ background: var(--highlight-color);
74
+ transform: rotate(var(--highlight-rotate));
12
75
  }
13
76
  }
77
+
78
+ /* PATTERNS */
79
+ /* Parallelogram leaning right: / / — classic marker skew */
80
+ @utility highlight-marker {
81
+ --highlight-skew: 0.25em;
82
+ --highlight-left-dir: to bottom right;
83
+ --highlight-right-dir: to top left;
84
+ }
85
+
86
+ /* Parallelogram leaning left: \ \ — mirror of marker */
87
+ @utility highlight-marker-alt {
88
+ --highlight-skew: 0.25em;
89
+ --highlight-left-dir: to top right;
90
+ --highlight-right-dir: to bottom left;
91
+ }
92
+
93
+ /* Trapezium wider at top: \___/ — sticker / index-tab feel */
94
+ @utility highlight-tab {
95
+ --highlight-skew: 0.25em;
96
+ --highlight-left-dir: to top left;
97
+ --highlight-right-dir: to top right;
98
+ }
99
+
100
+ /* Trapezium wider at bottom: /‾‾‾\ — badge / stamp feel */
101
+ @utility highlight-stamp {
102
+ --highlight-skew: 0.25em;
103
+ --highlight-left-dir: to bottom right;
104
+ --highlight-right-dir: to bottom left;
105
+ }
106
+
107
+ /* LEGACY */
108
+
109
+ .highlight-others {
110
+ --mark-color: #f8db75;
111
+ --mark-skew: 0.25em;
112
+ --mark-height: 1em;
113
+ --mark-overlap: 0.3em;
114
+ margin-inline: calc(var(--mark-overlap) * -1);
115
+ padding-inline: var(--mark-overlap);
116
+ color: inherit;
117
+ background-color: transparent;
118
+ background-image:
119
+ linear-gradient(to bottom right, transparent 50%, var(--mark-color) 50%),
120
+ linear-gradient(var(--mark-color), var(--mark-color)),
121
+ linear-gradient(to top left, transparent 50%, var(--mark-color) 50%);
122
+ background-position:
123
+ left center,
124
+ center,
125
+ right center;
126
+ background-size:
127
+ var(--mark-skew) var(--mark-height),
128
+ calc(100% - var(--mark-skew) * 2 + 1px) var(--mark-height),
129
+ var(--mark-skew) var(--mark-height);
130
+ background-repeat: no-repeat;
131
+ box-decoration-break: clone;
132
+ }
@@ -1,6 +1,8 @@
1
1
  @import './elevation.css';
2
2
  @import './gradients.css';
3
3
  @import './fancybox.css';
4
+ @import './bezel.css';
5
+ @import './testgb.css';
4
6
  @import './highlight.css';
5
7
  @import './shadows.css';
6
8
  @import './text.css';
@@ -1,18 +1,12 @@
1
1
  /* From https://css-tip.com/inner-border/ */
2
2
  /* Needs testing */
3
3
  @utility inner-border {
4
- & {
5
- --offset: 20px; /* offset of the border */
6
- --border-width: 5px; /* border thickness */
7
- mask:
8
- conic-gradient(#000 0 0) no-repeat 50% /
9
- calc(100% - 2 * (var(--offset) + var(--border-width)))
10
- calc(100% - 2 * (var(--offset) + var(--border-width))),
11
- conic-gradient(
12
- from 90deg at var(--offset) var(--offset),
13
- #0000 25%,
14
- #000 0
15
- )
16
- 0 0 / calc(100% - var(--offset)) calc(100% - var(--offset));
17
- }
4
+ --offset: 20px; /* offset of the border */
5
+ --border-width: 5px; /* border thickness */
6
+ mask:
7
+ conic-gradient(#000 0 0) no-repeat 50% /
8
+ calc(100% - 2 * (var(--offset) + var(--border-width)))
9
+ calc(100% - 2 * (var(--offset) + var(--border-width))),
10
+ conic-gradient(from 90deg at var(--offset) var(--offset), #0000 25%, #000 0)
11
+ 0 0 / calc(100% - var(--offset)) calc(100% - var(--offset));
18
12
  }