beercss 3.7.14 → 3.9.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.
@@ -0,0 +1,31 @@
1
+ import { queryAll, on } from "../utils";
2
+
3
+ function onPointerDownRipple(e: PointerEvent) {
4
+ updateRipple(e);
5
+ }
6
+
7
+ function updateRipple(e: PointerEvent) {
8
+ const element = e.currentTarget as HTMLElement;
9
+ const rect = element.getBoundingClientRect();
10
+ const diameter = Math.max(rect.width, rect.height);
11
+ const radius = diameter / 2;
12
+ const x = e.clientX - rect.left - radius;
13
+ const y = e.clientY - rect.top - radius;
14
+
15
+ const rippleContainer = document.createElement("div");
16
+ rippleContainer.className = "ripple-js";
17
+
18
+ const ripple = document.createElement("div");
19
+ ripple.style.inlineSize = ripple.style.blockSize = `${diameter}px`;
20
+ ripple.style.left = `${x}px`;
21
+ ripple.style.top = `${y}px`;
22
+ ripple.addEventListener("animationend", () => { rippleContainer.remove(); });
23
+
24
+ rippleContainer.appendChild(ripple);
25
+ element.appendChild(rippleContainer);
26
+ }
27
+
28
+ export function updateAllRipples() {
29
+ const ripples = queryAll(".slow-ripple, .ripple, .fast-ripple");
30
+ for(let i=0; i<ripples.length; i++) on(ripples[i], "pointerdown", onPointerDownRipple);
31
+ }
@@ -1,15 +1,15 @@
1
- .tiny-space:not(nav, ol, ul, .row, .grid, table, .tooltip) {
1
+ .tiny-space:not(nav, ol, ul, .row, .grid, table, .tooltip, .list) {
2
2
  block-size: 0.5rem;
3
3
  }
4
4
 
5
- :is(.space, .small-space):not(nav, ol, ul, .row, .grid, table, .tooltip) {
5
+ :is(.space, .small-space):not(nav, ol, ul, .row, .grid, table, .tooltip, .list) {
6
6
  block-size: 1rem;
7
7
  }
8
8
 
9
- .medium-space:not(nav, ol, ul, .row, .grid, table, .tooltip) {
9
+ .medium-space:not(nav, ol, ul, .row, .grid, table, .tooltip, .list) {
10
10
  block-size: 2rem;
11
11
  }
12
12
 
13
- .large-space:not(nav, ol, ul, .row, .grid, table, .tooltip) {
13
+ .large-space:not(nav, ol, ul, .row, .grid, table, .tooltip, .list) {
14
14
  block-size: 3rem;
15
15
  }
@@ -1,7 +1,4 @@
1
- .wave::after,
2
- .chip::after,
3
- :is(.button, button)::after,
4
- :is(nav.tabbed, .tabs) > a::after {
1
+ :is(.wave, .chip, .button, button, nav.tabbed > a, .tabs > a):not(.slow-ripple, .ripple, .fast-ripple)::after {
5
2
  content: "";
6
3
  position: absolute;
7
4
  inset: 0;
@@ -15,13 +12,13 @@
15
12
  transition: none;
16
13
  }
17
14
 
18
- :is(.wave, .chip, .button, button, nav.tabbed > a, .tabs > a):is(:focus-visible, :hover)::after {
15
+ :is(.wave, .chip, .button, button, nav.tabbed > a, .tabs > a):not(.slow-ripple, .ripple, .fast-ripple):is(:focus-visible, :hover)::after {
19
16
  background-size: 15000%;
20
17
  opacity: 0.1;
21
18
  transition: background-size var(--speed2) linear;
22
19
  }
23
20
 
24
- :is(.wave, .chip, .button, button, nav.tabbed > a, .tabs > a):active::after {
21
+ :is(.wave, .chip, .button, button, nav.tabbed > a, .tabs > a):not(.slow-ripple, .ripple, .fast-ripple):active::after {
25
22
  background-size: 5000%;
26
23
  opacity: 0;
27
24
  transition: none;
@@ -6,7 +6,7 @@
6
6
  font-display: block;
7
7
  src:
8
8
  url("../material-symbols-outlined.woff2") format("woff2"),
9
- url("https://cdn.jsdelivr.net/npm/beercss@3.7.14/dist/cdn/material-symbols-outlined.woff2") format("woff2");
9
+ url("https://cdn.jsdelivr.net/npm/beercss@3.9.0/dist/cdn/material-symbols-outlined.woff2") format("woff2");
10
10
  }
11
11
 
12
12
  /* rounded icons */
@@ -17,7 +17,7 @@
17
17
  font-display: block;
18
18
  src:
19
19
  url("../material-symbols-rounded.woff2") format("woff2"),
20
- url("https://cdn.jsdelivr.net/npm/beercss@3.7.14/dist/cdn/material-symbols-rounded.woff2") format("woff2");
20
+ url("https://cdn.jsdelivr.net/npm/beercss@3.9.0/dist/cdn/material-symbols-rounded.woff2") format("woff2");
21
21
  }
22
22
 
23
23
  /* sharp icons */
@@ -28,5 +28,5 @@
28
28
  font-display: block;
29
29
  src:
30
30
  url("../material-symbols-sharp.woff2") format("woff2"),
31
- url("https://cdn.jsdelivr.net/npm/beercss@3.7.14/dist/cdn/material-symbols-sharp.woff2") format("woff2");
31
+ url("https://cdn.jsdelivr.net/npm/beercss@3.9.0/dist/cdn/material-symbols-sharp.woff2") format("woff2");
32
32
  }
@@ -1,5 +1,5 @@
1
1
  :root {
2
- --size: 16px;
2
+ --size: 1rem;
3
3
  --font: Inter, Roboto, "Helvetica Neue", "Arial Nova", "Nimbus Sans", Noto Sans, Arial, sans-serif;
4
4
  --font-icon: "Material Symbols Outlined";
5
5
  --speed1: 0.1s;