beercss 4.0.16 → 4.0.17

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.
@@ -1,12 +1,10 @@
1
1
  progress {
2
- --_light: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR4AWJiYGAQBgAAAP//ZyYa+wAAAAZJREFUAwAAIgAWeX9MsQAAAABJRU5ErkJggg==);
3
- --_dark: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR4AWL6//+/FAAAAP//qSv5QwAAAAZJREFUAwAJIAMaJWjIvQAAAABJRU5ErkJggg==);
4
2
  --_size: 0.25rem;
5
3
  position: relative;
6
4
  inline-size: 100%;
7
5
  block-size: var(--_size);
8
6
  color: var(--primary);
9
- background: var(--_light);
7
+ background: var(--image);
10
8
  border-radius: 1rem;
11
9
  flex: none;
12
10
  border: none;
@@ -17,10 +15,6 @@ progress {
17
15
  appearance: none;
18
16
  }
19
17
 
20
- .dark progress {
21
- background: var(--_dark);
22
- }
23
-
24
18
  progress.small {
25
19
  --_size: 0.25rem;
26
20
  }
@@ -35,7 +29,7 @@ progress.large {
35
29
 
36
30
  progress.indeterminate {
37
31
  --_value: 100;
38
- animation: 3.2s to-indeterminate ease infinite;
32
+ animation: 3.2s to-indeterminate-progress ease infinite;
39
33
  }
40
34
 
41
35
  progress:not(.circle, [value])::after {
@@ -46,15 +40,15 @@ progress:not(.circle, [value])::after {
46
40
  block-size: 100%;
47
41
  clip-path: none;
48
42
  background: currentcolor;
49
- animation: 3.2s to-linear ease infinite;
43
+ animation: 3.2s to-linear-progress ease infinite;
50
44
  }
51
45
 
52
46
  progress:not(.circle, [value])::-moz-progress-bar {
53
- animation: 3.2s to-linear ease infinite;
47
+ animation: 3.2s to-linear-progress ease infinite;
54
48
  }
55
49
 
56
50
  progress:not(.circle, [value])::-webkit-progress-value {
57
- animation: 3.2s to-linear ease infinite;
51
+ animation: 3.2s to-linear-progress ease infinite;
58
52
  }
59
53
 
60
54
  progress::-webkit-progress-bar {
@@ -72,16 +66,12 @@ progress::-moz-progress-bar {
72
66
  progress.wavy {
73
67
  block-size: calc(var(--_size, 0) * 2);
74
68
  background: none;
75
- background-image: var(--_light);
69
+ background-image: var(--image);
76
70
  background-repeat: repeat-x;
77
71
  background-position: 0 50%;
78
72
  background-size: auto calc(var(--_size, 0) / 2);
79
73
  }
80
74
 
81
- .dark progress.wavy {
82
- background-image: var(--_dark);
83
- }
84
-
85
75
  progress.wavy::-webkit-progress-value,
86
76
  progress.wavy:not(.circle, [value])::after {
87
77
  mask-image: url(../shapes/wavy.svg);
@@ -168,41 +158,3 @@ progress.max + * {
168
158
  :is(.button, button, .chip) > progress.circle {
169
159
  color: inherit;
170
160
  }
171
-
172
- @keyframes to-linear {
173
- 0% {
174
- margin: 0 0 0 -100%;
175
- }
176
-
177
- 50% {
178
- margin: 0 0 0 0;
179
- }
180
-
181
- 100% {
182
- margin: 0 0 0 100%;
183
- }
184
- }
185
-
186
- @keyframes to-indeterminate {
187
- 0% {
188
- padding: 0 100% 0 0;
189
- }
190
-
191
- 50% {
192
- padding: 0 0 0 0;
193
- }
194
-
195
- 100% {
196
- padding: 0 0 0 100%;
197
- }
198
- }
199
-
200
- @keyframes to-rotate {
201
- from {
202
- transform: rotate(0deg);
203
- }
204
-
205
- to {
206
- transform: rotate(360deg);
207
- }
208
- }
@@ -78,27 +78,27 @@
78
78
  }
79
79
 
80
80
  .shape.rotate {
81
- animation: linear to-shape-rotate infinite 12s;
81
+ animation: linear to-rotate infinite 12s;
82
82
  }
83
83
 
84
84
  .shape.rotate > * {
85
- animation: linear to-shape-rotate infinite 12s reverse;
85
+ animation: linear to-rotate infinite 12s reverse;
86
86
  }
87
87
 
88
88
  .shape.fast-rotate {
89
- animation: linear to-shape-rotate infinite 6s;
89
+ animation: linear to-rotate infinite 6s;
90
90
  }
91
91
 
92
92
  .shape.fast-rotate > * {
93
- animation: linear to-shape-rotate infinite 6s reverse;
93
+ animation: linear to-rotate infinite 6s reverse;
94
94
  }
95
95
 
96
96
  .shape.slow-rotate {
97
- animation: linear to-shape-rotate infinite 24s;
97
+ animation: linear to-rotate infinite 24s;
98
98
  }
99
99
 
100
100
  .shape.slow-rotate > * {
101
- animation: linear to-shape-rotate infinite 24s reverse;
101
+ animation: linear to-rotate infinite 24s reverse;
102
102
  }
103
103
 
104
104
  :is(button, .button, .chip):has(> .shape) > .responsive {
@@ -247,13 +247,4 @@
247
247
 
248
248
  .shape.very-sunny {
249
249
  mask-image: url(../shapes/very-sunny.svg);
250
- }
251
-
252
- @keyframes to-shape-rotate {
253
- 0% {
254
- transform: rotate(0deg);
255
- }
256
- 100% {
257
- transform: rotate(360deg);
258
- }
259
250
  }
@@ -60,6 +60,7 @@
60
60
  padding: 0;
61
61
  margin: 0;
62
62
  transform: rotate(0deg);
63
+ touch-action: none;
63
64
  }
64
65
 
65
66
  .slider > input:only-of-type {
@@ -175,7 +176,7 @@
175
176
  position: absolute;
176
177
  block-size: auto;
177
178
  inset: 0 auto 0 0.5rem;
178
- color: currentColor;
179
+ color: var(--inverse-primary);
179
180
  z-index: 1;
180
181
  }
181
182
 
@@ -1,13 +1,9 @@
1
1
  .no-opacity {
2
- opacity: 1 !important;
3
- }
4
-
5
- .opacity {
6
2
  opacity: 0 !important;
7
3
  }
8
4
 
9
5
  .small-opacity {
10
- opacity: 0.75 !important;
6
+ opacity: 0.25 !important;
11
7
  }
12
8
 
13
9
  .medium-opacity {
@@ -15,5 +11,9 @@
15
11
  }
16
12
 
17
13
  .large-opacity {
18
- opacity: 0.25 !important;
14
+ opacity: 0.75 !important;
15
+ }
16
+
17
+ .opacity {
18
+ opacity: 1 !important;
19
19
  }
@@ -1,3 +1,12 @@
1
+ [class*=ripple]:is(:hover, :focus-visible)::after {
2
+ content: '';
3
+ position: absolute;
4
+ inset: 0;
5
+ background: currentColor;
6
+ opacity: 0.1;
7
+ border-radius: inherit;
8
+ }
9
+
1
10
  .ripple {
2
11
  --_duration: 600ms;
3
12
  }
@@ -24,11 +33,4 @@
24
33
  opacity: 0.3;
25
34
  transform: scale(0);
26
35
  animation: to-ripple var(--_duration) linear;
27
- }
28
-
29
- @keyframes to-ripple {
30
- to {
31
- transform: scale(4);
32
- opacity: 0;
33
- }
34
36
  }
@@ -1,17 +1,21 @@
1
1
  import { queryAll, onWeak } from "../utils";
2
2
 
3
- function onPointerDownRipple(e: PointerEvent) {
3
+ function onMousedownRipple(e: MouseEvent) {
4
4
  updateRipple(e);
5
5
  }
6
6
 
7
- function updateRipple(e: PointerEvent) {
7
+ function onKeydownRipple(e: KeyboardEvent) {
8
+ if (e?.key === " ") updateRipple(e);
9
+ }
10
+
11
+ function updateRipple(e: MouseEvent | KeyboardEvent) {
12
+ const isMouseEvent = e instanceof MouseEvent;
8
13
  const element = e.currentTarget as HTMLElement;
9
14
  const rect = element.getBoundingClientRect();
10
15
  const diameter = Math.max(rect.width, rect.height);
11
16
  const radius = diameter / 2;
12
- const x = e.clientX - rect.left - radius;
13
- const y = e.clientY - rect.top - radius;
14
-
17
+ const x = isMouseEvent ? e.clientX - rect.left - radius : (rect.width / 2) - radius;
18
+ const y = isMouseEvent ? e.clientY - rect.top - radius : (rect.height / 2) - radius;
15
19
  const rippleContainer = document.createElement("div");
16
20
  rippleContainer.className = "ripple-js";
17
21
 
@@ -27,5 +31,8 @@ function updateRipple(e: PointerEvent) {
27
31
 
28
32
  export function updateAllRipples() {
29
33
  const ripples = queryAll(".slow-ripple, .ripple, .fast-ripple");
30
- for(let i=0; i<ripples.length; i++) onWeak(ripples[i], "pointerdown", onPointerDownRipple);
31
- }
34
+ for(let i=0; i<ripples.length; i++) {
35
+ onWeak(ripples[i], "mousedown", onMousedownRipple);
36
+ onWeak(ripples[i], "keydown", onKeydownRipple);
37
+ }
38
+ }
@@ -1,4 +1,4 @@
1
- :is(.wave, .chip, .button, button, nav.tabbed > a, .tabs > a, nav.toolbar > a):not(.slow-ripple, .ripple, .fast-ripple)::after,
1
+ :is(.wave, .chip, .button, button, nav.tabbed > a, .tabs > a, nav.toolbar > a):not([class*=ripple])::after,
2
2
  nav:is(.left, .right, .bottom, .top).max > a::after,
3
3
  nav:is(.left, .right, .bottom, .top).max > :is(ol, ul) > li > a::after,
4
4
  nav:is(.left, .right, .bottom, .top):not(.max) > a > i::after,
@@ -17,7 +17,7 @@ nav:is(.left, .right, .bottom, .top):not(.max) > :is(ol, ul) > li > a > i::after
17
17
  pointer-events: none;
18
18
  }
19
19
 
20
- :is(.wave, .chip, .button, button, nav.tabbed > a, .tabs > a, nav.toolbar > a):not(.slow-ripple, .ripple, .fast-ripple):is(:focus-visible, :hover)::after,
20
+ :is(.wave, .chip, .button, button, nav.tabbed > a, .tabs > a, nav.toolbar > a):not([class*=ripple]):is(:focus-visible, :hover)::after,
21
21
  nav:is(.left, .right, .bottom, .top).max > a:not(.button, .chip):is(:focus-visible, :hover)::after,
22
22
  nav:is(.left, .right, .bottom, .top).max > :is(ol, ul) > li > a:not(.button, .chip):is(:focus-visible, :hover)::after,
23
23
  nav:is(.left, .right, .bottom, .top):not(.max) > a:not(.button, .chip):is(:focus-visible, :hover) > i::after,
@@ -27,7 +27,7 @@ nav:is(.left, .right, .bottom, .top):not(.max) > :is(ol, ul) > li > a:not(.butto
27
27
  transition: background-size var(--speed2) linear;
28
28
  }
29
29
 
30
- :is(.wave, .chip, .button, button, nav.tabbed > a, .tabs > a, nav.toolbar > a, nav.max > a):not(.slow-ripple, .ripple, .fast-ripple):active::after,
30
+ :is(.wave, .chip, .button, button, nav.tabbed > a, .tabs > a, nav.toolbar > a, nav.max > a):not([class*=ripple]):active::after,
31
31
  nav:is(.left, .right, .bottom, .top).max > a:active::after,
32
32
  nav:is(.left, .right, .bottom, .top).max > :is(ol, ul) > li > a:active::after,
33
33
  nav:is(.left, .right, .bottom, .top):not(.max) > a:active > i::after,
@@ -4,7 +4,7 @@
4
4
  font-style: normal;
5
5
  font-weight: 400;
6
6
  font-display: swap;
7
- src: url(../fonts/material-symbols-outlined.woff2) format("woff2"), url(https://cdn.jsdelivr.net/npm/beercss@4.0.16/dist/cdn/material-symbols-outlined.woff2) format("woff2");
7
+ src: url(../fonts/material-symbols-outlined.woff2) format("woff2"), url(https://cdn.jsdelivr.net/npm/beercss@4.0.17/dist/cdn/material-symbols-outlined.woff2) format("woff2");
8
8
  }
9
9
 
10
10
  /* rounded icons */
@@ -13,7 +13,7 @@
13
13
  font-style: normal;
14
14
  font-weight: 400;
15
15
  font-display: swap;
16
- src: url(../fonts/material-symbols-rounded.woff2) format("woff2"), url(https://cdn.jsdelivr.net/npm/beercss@4.0.16/dist/cdn/material-symbols-rounded.woff2) format("woff2");
16
+ src: url(../fonts/material-symbols-rounded.woff2) format("woff2"), url(https://cdn.jsdelivr.net/npm/beercss@4.0.17/dist/cdn/material-symbols-rounded.woff2) format("woff2");
17
17
  }
18
18
 
19
19
  /* sharp icons */
@@ -22,7 +22,7 @@
22
22
  font-style: normal;
23
23
  font-weight: 400;
24
24
  font-display: swap;
25
- src: url(../fonts/material-symbols-sharp.woff2) format("woff2"), url(https://cdn.jsdelivr.net/npm/beercss@4.0.16/dist/cdn/material-symbols-sharp.woff2) format("woff2");
25
+ src: url(../fonts/material-symbols-sharp.woff2) format("woff2"), url(https://cdn.jsdelivr.net/npm/beercss@4.0.17/dist/cdn/material-symbols-sharp.woff2) format("woff2");
26
26
  }
27
27
 
28
28
  /* subset of only required icons */
@@ -31,5 +31,5 @@
31
31
  font-style: normal;
32
32
  font-weight: 400;
33
33
  font-display: swap;
34
- src: url(../fonts/material-symbols-subset.woff2) format("woff2"), url(https://cdn.jsdelivr.net/npm/beercss@4.0.16/dist/cdn/material-symbols-subset.woff2) format("woff2");
34
+ src: url(../fonts/material-symbols-subset.woff2) format("woff2"), url(https://cdn.jsdelivr.net/npm/beercss@4.0.17/dist/cdn/material-symbols-subset.woff2) format("woff2");
35
35
  }
@@ -15,6 +15,11 @@
15
15
  --bottom: env(safe-area-inset-bottom);
16
16
  --left: env(safe-area-inset-left);
17
17
  --right: env(safe-area-inset-right);
18
+ --image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR4AWJiYGAQBgAAAP//ZyYa+wAAAAZJREFUAwAAIgAWeX9MsQAAAABJRU5ErkJggg==);
19
+ }
20
+
21
+ body.dark {
22
+ --image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR4AWL6//+/FAAAAP//qSv5QwAAAAZJREFUAwAJIAMaJWjIvQAAAABJRU5ErkJggg==);
18
23
  }
19
24
 
20
25
  html {
@@ -52,4 +57,61 @@ body {
52
57
  body:has(input[type=range]:focus) {
53
58
  overflow: hidden;
54
59
  }
60
+ }
61
+
62
+ @keyframes to-page {
63
+ from {
64
+ opacity: 0;
65
+ transform: var(--_transform);
66
+ }
67
+
68
+ to {
69
+ opacity: 1;
70
+ transform: translate(0, 0);
71
+ }
72
+ }
73
+
74
+ @keyframes to-linear-progress {
75
+ 0% {
76
+ margin: 0 0 0 -100%;
77
+ }
78
+
79
+ 50% {
80
+ margin: 0 0 0 0;
81
+ }
82
+
83
+ 100% {
84
+ margin: 0 0 0 100%;
85
+ }
86
+ }
87
+
88
+ @keyframes to-indeterminate-progress {
89
+ 0% {
90
+ padding: 0 100% 0 0;
91
+ }
92
+
93
+ 50% {
94
+ padding: 0 0 0 0;
95
+ }
96
+
97
+ 100% {
98
+ padding: 0 0 0 100%;
99
+ }
100
+ }
101
+
102
+ @keyframes to-rotate {
103
+ from {
104
+ transform: rotate(0deg);
105
+ }
106
+
107
+ to {
108
+ transform: rotate(360deg);
109
+ }
110
+ }
111
+
112
+ @keyframes to-ripple {
113
+ to {
114
+ transform: scale(4);
115
+ opacity: 0;
116
+ }
55
117
  }
@@ -40,11 +40,10 @@ export async function updateTheme(source?: IBeerCssTheme | any): Promise<IBeerCs
40
40
  const body = document.body;
41
41
  if (!source || !context.materialDynamicColors) return lastTheme();
42
42
 
43
- const mode = getMode();
44
43
  if (source.light && source.dark) {
45
44
  _lastTheme.light = source.light;
46
45
  _lastTheme.dark = source.dark;
47
- body.setAttribute("style", source[mode]);
46
+ body.setAttribute("style", source[getMode()]);
48
47
  return source;
49
48
  }
50
49
 
@@ -62,7 +61,7 @@ export async function updateTheme(source?: IBeerCssTheme | any): Promise<IBeerCs
62
61
 
63
62
  _lastTheme.light = toCss(theme.light);
64
63
  _lastTheme.dark = toCss(theme.dark);
65
- body.setAttribute("style", _lastTheme[mode]);
64
+ body.setAttribute("style", _lastTheme[getMode()]);
66
65
  return _lastTheme;
67
66
  });
68
67
  }