beercss 4.0.7 → 4.0.8

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.
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  <p align="center">
5
5
  <a href="https://github.com/beercss/beercss/blob/main/LICENSE"><img src="https://img.shields.io/github/license/beercss/beercss" alt="license"></a>
6
6
  <a href="https://github.com/beercss/beercss"><img src="https://img.shields.io/jsdelivr/npm/hy/beercss" alt="downloads"></a>
7
- <a><img src="https://img.shields.io/badge/brotli_size-14.4kb-green" alt="brotli size"></a>
7
+ <a><img src="https://img.shields.io/badge/brotli_size-14.5kb-green" alt="brotli size"></a>
8
8
  <a href="https://www.npmjs.com/package/beercss"><img src="https://img.shields.io/npm/v/beercss" alt="version"></a>
9
9
  <a href="https://github.com/beercss/beercss/pulls"><img src="https://img.shields.io/github/issues-pr/beercss/beercss" alt="pull Request"></a>
10
10
  <a href="https://github.com/beercss/beercss/issues"><img src="https://img.shields.io/github/issues/beercss/beercss" alt="issues"></a>
@@ -84,8 +84,8 @@ This project was guided by the **"Germany Beer Purity Law"** or **"Reinheitsgebo
84
84
  ### DEFAULT VERSION
85
85
 
86
86
  ```html
87
- <link href="https://cdn.jsdelivr.net/npm/beercss@4.0.7/dist/cdn/beer.min.css" rel="stylesheet" />
88
- <script type="module" src="https://cdn.jsdelivr.net/npm/beercss@4.0.7/dist/cdn/beer.min.js"></script>
87
+ <link href="https://cdn.jsdelivr.net/npm/beercss@4.0.8/dist/cdn/beer.min.css" rel="stylesheet" />
88
+ <script type="module" src="https://cdn.jsdelivr.net/npm/beercss@4.0.8/dist/cdn/beer.min.js"></script>
89
89
  <script type="module" src="https://cdn.jsdelivr.net/npm/material-dynamic-colors@1.1.4/dist/cdn/material-dynamic-colors.min.js"></script>
90
90
  ```
91
91
 
@@ -103,8 +103,8 @@ import "material-dynamic-colors";
103
103
  Applied on child elements of `<* class="beer">...</*>`.
104
104
 
105
105
  ```html
106
- <link href="https://cdn.jsdelivr.net/npm/beercss@4.0.7/dist/cdn/beer.scoped.min.css" rel="stylesheet" />
107
- <script type="module" src="https://cdn.jsdelivr.net/npm/beercss@4.0.7/dist/cdn/beer.min.js"></script>
106
+ <link href="https://cdn.jsdelivr.net/npm/beercss@4.0.8/dist/cdn/beer.scoped.min.css" rel="stylesheet" />
107
+ <script type="module" src="https://cdn.jsdelivr.net/npm/beercss@4.0.8/dist/cdn/beer.min.js"></script>
108
108
  <script type="module" src="https://cdn.jsdelivr.net/npm/material-dynamic-colors@1.1.4/dist/cdn/material-dynamic-colors.min.js"></script>
109
109
  ```
110
110
 
@@ -122,7 +122,7 @@ import "material-dynamic-colors";
122
122
  Applied on child elements of `<beer-css>...</beer-css>`.
123
123
 
124
124
  ```html
125
- <script type="module" src="https://cdn.jsdelivr.net/npm/beercss@4.0.7/dist/cdn/beer.custom-element.min.js"></script>
125
+ <script type="module" src="https://cdn.jsdelivr.net/npm/beercss@4.0.8/dist/cdn/beer.custom-element.min.js"></script>
126
126
  <script type="module" src="https://cdn.jsdelivr.net/npm/material-dynamic-colors@1.1.4/dist/cdn/material-dynamic-colors.min.js"></script>
127
127
  ```
128
128
 
@@ -138,7 +138,7 @@ import "material-dynamic-colors";
138
138
 
139
139
  ### LOCAL CDN VERSION
140
140
 
141
- Download all files from CDN https://cdn.jsdelivr.net/npm/beercss@4.0.7/dist/cdn/ and https://cdn.jsdelivr.net/npm/material-dynamic-colors@1.1.4/dist/cdn/. Now put the files inside a new folder in your project (like `/beercss` for example):
141
+ Download all files from CDN https://cdn.jsdelivr.net/npm/beercss@4.0.8/dist/cdn/ and https://cdn.jsdelivr.net/npm/material-dynamic-colors@1.1.4/dist/cdn/. Now put the files inside a new folder in your project (like `/beercss` for example):
142
142
 
143
143
  ```html
144
144
  <link href="/beercss/beer.min.css" rel="stylesheet" />
@@ -159,8 +159,8 @@ You can use this html to setup your project. See on [Codepen](https://codepen.io
159
159
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
160
160
  <meta name="google" content="notranslate">
161
161
  <title>Hello world</title>
162
- <link href="https://cdn.jsdelivr.net/npm/beercss@4.0.7/dist/cdn/beer.min.css" rel="stylesheet">
163
- <script type="module" src="https://cdn.jsdelivr.net/npm/beercss@4.0.7/dist/cdn/beer.min.js"></script>
162
+ <link href="https://cdn.jsdelivr.net/npm/beercss@4.0.8/dist/cdn/beer.min.css" rel="stylesheet">
163
+ <script type="module" src="https://cdn.jsdelivr.net/npm/beercss@4.0.8/dist/cdn/beer.min.js"></script>
164
164
  <script type="module" src="https://cdn.jsdelivr.net/npm/material-dynamic-colors@1.1.4/dist/cdn/material-dynamic-colors.min.js"></script>
165
165
  </head>
166
166
  <body class="dark">
package/dist/cdn/beer.css CHANGED
@@ -140,7 +140,7 @@ body.dark {
140
140
  font-style: normal;
141
141
  font-weight: 400;
142
142
  font-display: swap;
143
- src: url(material-symbols-outlined.woff2) format("woff2"), url(https://cdn.jsdelivr.net/npm/beercss@4.0.7/dist/cdn/material-symbols-outlined.woff2) format("woff2");
143
+ src: url(material-symbols-outlined.woff2) format("woff2"), url(https://cdn.jsdelivr.net/npm/beercss@4.0.8/dist/cdn/material-symbols-outlined.woff2) format("woff2");
144
144
  }
145
145
 
146
146
  /* rounded icons */
@@ -150,7 +150,7 @@ body.dark {
150
150
  font-style: normal;
151
151
  font-weight: 400;
152
152
  font-display: swap;
153
- src: url(material-symbols-rounded.woff2) format("woff2"), url(https://cdn.jsdelivr.net/npm/beercss@4.0.7/dist/cdn/material-symbols-rounded.woff2) format("woff2");
153
+ src: url(material-symbols-rounded.woff2) format("woff2"), url(https://cdn.jsdelivr.net/npm/beercss@4.0.8/dist/cdn/material-symbols-rounded.woff2) format("woff2");
154
154
  }
155
155
 
156
156
  /* sharp icons */
@@ -160,7 +160,7 @@ body.dark {
160
160
  font-style: normal;
161
161
  font-weight: 400;
162
162
  font-display: swap;
163
- src: url(material-symbols-sharp.woff2) format("woff2"), url(https://cdn.jsdelivr.net/npm/beercss@4.0.7/dist/cdn/material-symbols-sharp.woff2) format("woff2");
163
+ src: url(material-symbols-sharp.woff2) format("woff2"), url(https://cdn.jsdelivr.net/npm/beercss@4.0.8/dist/cdn/material-symbols-sharp.woff2) format("woff2");
164
164
  }
165
165
 
166
166
  /* subset of only required icons */
@@ -170,7 +170,7 @@ body.dark {
170
170
  font-style: normal;
171
171
  font-weight: 400;
172
172
  font-display: swap;
173
- src: url(material-symbols-subset.woff2) format("woff2"), url(https://cdn.jsdelivr.net/npm/beercss@4.0.7/dist/cdn/material-symbols-subset.woff2) format("woff2");
173
+ src: url(material-symbols-subset.woff2) format("woff2"), url(https://cdn.jsdelivr.net/npm/beercss@4.0.8/dist/cdn/material-symbols-subset.woff2) format("woff2");
174
174
  }
175
175
 
176
176
  /* begin scoped */
@@ -1627,19 +1627,19 @@ li > details > summary + .list {
1627
1627
  border-radius: 0.25rem;
1628
1628
  }
1629
1629
 
1630
- .field.round.small {
1630
+ .field[class*=round].small {
1631
1631
  border-radius: 1.25rem;
1632
1632
  }
1633
1633
 
1634
- .field.round {
1634
+ .field[class*=round] {
1635
1635
  border-radius: 1.5rem;
1636
1636
  }
1637
1637
 
1638
- .field.round.large {
1638
+ .field[class*=round].large {
1639
1639
  border-radius: 1.75rem;
1640
1640
  }
1641
1641
 
1642
- .field.round.extra {
1642
+ .field[class*=round].extra {
1643
1643
  border-radius: 2rem;
1644
1644
  }
1645
1645
 
@@ -1726,8 +1726,7 @@ input::-webkit-date-and-time-value {
1726
1726
 
1727
1727
  input[type=file],
1728
1728
  input[type=color],
1729
- :not(.field) > input[type^=date],
1730
- :not(.field) > input[type^=time],
1729
+ :not(.field) > input:is([type^=date], [type^=time], [type=month], [type=week]),
1731
1730
  input::-webkit-calendar-picker-indicator {
1732
1731
  opacity: 0;
1733
1732
  position: absolute;
@@ -1741,6 +1740,12 @@ input::-webkit-calendar-picker-indicator {
1741
1740
  z-index: 2 !important;
1742
1741
  }
1743
1742
 
1743
+ @media (pointer: fine) {
1744
+ .field > input::-webkit-calendar-picker-indicator {
1745
+ z-index: -1 !important;
1746
+ }
1747
+ }
1748
+
1744
1749
  input::-webkit-search-decoration,
1745
1750
  input::-webkit-search-cancel-button,
1746
1751
  input::-webkit-search-results-button,
@@ -1762,11 +1767,11 @@ input[type=number] {
1762
1767
  border-color: var(--primary);
1763
1768
  }
1764
1769
 
1765
- .field.round > :is(input, textarea, select) {
1770
+ .field[class*=round] > :is(input, textarea, select) {
1766
1771
  padding-inline: 1.4376rem;
1767
1772
  }
1768
1773
 
1769
- .field.round > :is(input, textarea, select):focus {
1774
+ .field[class*=round] > :is(input, textarea, select):focus {
1770
1775
  padding-inline: 1.375rem;
1771
1776
  }
1772
1777
 
@@ -1794,25 +1799,25 @@ input[type=number] {
1794
1799
  padding-inline-end: 2.875rem;
1795
1800
  }
1796
1801
 
1797
- .field:not(.border, .round) > :is(input, textarea, select) {
1802
+ .field:not(.border, [class*=round]) > :is(input, textarea, select) {
1798
1803
  border-block-end-color: var(--outline);
1799
1804
  }
1800
1805
 
1801
- .field:not(.border, .round) > :is(input, textarea, select):focus {
1806
+ .field:not(.border, [class*=round]) > :is(input, textarea, select):focus {
1802
1807
  border-block-end-color: var(--primary);
1803
1808
  }
1804
1809
 
1805
- .field.round:not(.border, .fill) > :is(input, textarea, select),
1806
- .field.round:not(.border) > :is(input, textarea, select):focus {
1810
+ .field[class*=round]:not(.border, .fill) > :is(input, textarea, select),
1811
+ .field[class*=round]:not(.border) > :is(input, textarea, select):focus {
1807
1812
  box-shadow: var(--elevate1);
1808
1813
  }
1809
1814
 
1810
- .field.round:not(.border, .fill) > :is(input, textarea, select):focus {
1815
+ .field[class*=round]:not(.border, .fill) > :is(input, textarea, select):focus {
1811
1816
  box-shadow: var(--elevate2);
1812
1817
  }
1813
1818
 
1814
- .field.invalid:not(.border, .round) > :is(input, textarea, select),
1815
- .field.invalid:not(.border, .round) > :is(input, textarea, select):focus {
1819
+ .field.invalid:not(.border, [class*=round]) > :is(input, textarea, select),
1820
+ .field.invalid:not(.border, [class*=round]) > :is(input, textarea, select):focus {
1816
1821
  border-block-end-color: var(--error);
1817
1822
  }
1818
1823
 
@@ -1899,11 +1904,11 @@ input[type=number] {
1899
1904
  inset: -0.5rem var(--_start) 0 1rem;
1900
1905
  }
1901
1906
 
1902
- .field.label.round > label {
1907
+ .field.label[class*=round] > label {
1903
1908
  inset: -0.5rem 1.75rem 0 var(--_start);
1904
1909
  }
1905
1910
 
1906
- [dir=rtl] .field.label.round > label {
1911
+ [dir=rtl] .field.labell[class*=round] > label {
1907
1912
  inset: -0.5rem 1.75rem 0 var(--_start);
1908
1913
  }
1909
1914
 
@@ -1911,8 +1916,8 @@ input[type=number] {
1911
1916
  --_start: 1rem;
1912
1917
  }
1913
1918
 
1914
- .field.label.round > label,
1915
- .field.label.border.prefix.round:not(.fill) > :is(label.active, :focus + label, [placeholder]:not(:placeholder-shown) + label, select + label) {
1919
+ .field.label[class*=round] > label,
1920
+ .field.label.border.prefix[class*=round]:not(.fill) > :is(label.active, :focus + label, [placeholder]:not(:placeholder-shown) + label, select + label) {
1916
1921
  --_start: 1.5rem;
1917
1922
  }
1918
1923
 
@@ -1955,13 +1960,13 @@ input[type=number] {
1955
1960
  clip-path: polygon(-2% -2%, 1rem -2%, 1rem 0.5rem, calc(100% - 0.75rem) 0.5rem, calc(100% - 0.75rem) -2%, 102% -2%, 102% 102%, -2% 102%);
1956
1961
  }
1957
1962
 
1958
- .field.label.border.round:not(.fill) > :is(input, textarea):is(:focus, [placeholder]:not(:placeholder-shown), .active),
1959
- .field.label.border.round:not(.fill) > select {
1963
+ .field.label.border[class*=round]:not(.fill) > :is(input, textarea):is(:focus, [placeholder]:not(:placeholder-shown), .active),
1964
+ .field.label.border[class*=round]:not(.fill) > select {
1960
1965
  clip-path: polygon(-2% -2%, 1.25rem -2%, 1.25rem 0.5rem, calc(100% - 1.75rem) 0.5rem, calc(100% - 1.75rem) -2%, 102% -2%, 102% 102%, -2% 102%);
1961
1966
  }
1962
1967
 
1963
- [dir=rtl] .field.label.border.round:not(.fill) > :is(input, textarea):is(:focus, [placeholder]:not(:placeholder-shown), .active),
1964
- [dir=rtl] .field.label.border.round:not(.fill) > select {
1968
+ [dir=rtl] .field.label.border[class*=round]:not(.fill) > :is(input, textarea):is(:focus, [placeholder]:not(:placeholder-shown), .active),
1969
+ [dir=rtl] .field.label.border[class*=round]:not(.fill) > select {
1965
1970
  clip-path: polygon(-2% -2%, 1.75rem -2%, 1.75rem 0.5rem, calc(100% - 1.25rem) 0.5rem, calc(100% - 1.25rem) -2%, 102% -2%, 102% 102%, -2% 102%);
1966
1971
  }
1967
1972
 
@@ -2003,7 +2008,7 @@ input[type=number] {
2003
2008
  color: var(--error) !important;
2004
2009
  }
2005
2010
 
2006
- .field.round > output {
2011
+ .field[class*=round] > output {
2007
2012
  padding: 0.25rem 1.5rem;
2008
2013
  }
2009
2014
 
@@ -2675,7 +2680,7 @@ menu > li.active {
2675
2680
  }
2676
2681
 
2677
2682
  menu > li:is(.active, :active) {
2678
- border-radius: inherit;
2683
+ border-radius: 0.75rem;
2679
2684
  }
2680
2685
 
2681
2686
  menu > li > :is(.max, .field),
@@ -2793,6 +2798,20 @@ menu.transparent > li {
2793
2798
  padding: 0;
2794
2799
  }
2795
2800
 
2801
+ menu.transparent > li > menu {
2802
+ opacity: 1;
2803
+ visibility: visible;
2804
+ position: relative;
2805
+ inset: 0;
2806
+ transform: none;
2807
+ max-block-size: none;
2808
+ border-radius: 1rem 1rem 0.5rem 0.5rem;
2809
+ }
2810
+
2811
+ menu.transparent > li:last-child > menu {
2812
+ border-radius: 0.5rem 0.5rem 1rem 1rem;
2813
+ }
2814
+
2796
2815
  menu > li:nth-last-child(2) {
2797
2816
  --_child: 2;
2798
2817
  }
@@ -12,7 +12,7 @@ class BeerCssCustomElement extends HTMLElement {
12
12
  BeerCssCustomElement.isJsLoaded = true;
13
13
 
14
14
  if (window.ui) return;
15
- return await import("https://cdn.jsdelivr.net/npm/beercss@4.0.7/dist/cdn/beer.min.js");
15
+ return await import("https://cdn.jsdelivr.net/npm/beercss@4.0.8/dist/cdn/beer.min.js");
16
16
  }
17
17
 
18
18
  async addCss() {
@@ -23,7 +23,7 @@ class BeerCssCustomElement extends HTMLElement {
23
23
 
24
24
  const head = document.querySelector("head");
25
25
  const element = document.createElement("link");
26
- element.setAttribute("href", "https://cdn.jsdelivr.net/npm/beercss@4.0.7/dist/cdn/beer.scoped.min.css");
26
+ element.setAttribute("href", "https://cdn.jsdelivr.net/npm/beercss@4.0.8/dist/cdn/beer.scoped.min.css");
27
27
  element.setAttribute("rel", "stylesheet");
28
28
  head.appendChild(element);
29
29
  }
@@ -1 +1 @@
1
- class BeerCssCustomElement extends HTMLElement {static isCssLoaded = false;static isJsLoaded = false;constructor() {super();this.run();}async addJs() {if (BeerCssCustomElement.isJsLoaded) return;BeerCssCustomElement.isJsLoaded = true;if (window.ui) return;return await import("https://cdn.jsdelivr.net/npm/beercss@4.0.7/dist/cdn/beer.min.js");}async addCss() {if (BeerCssCustomElement.isCssLoaded) return;BeerCssCustomElement.isCssLoaded = true;const isScoped = !!getComputedStyle(document.documentElement).getPropertyValue("--scoped");if (isScoped) return;const head = document.querySelector("head");const element = document.createElement("link");element.setAttribute("href", "https://cdn.jsdelivr.net/npm/beercss@4.0.7/dist/cdn/beer.scoped.min.css");element.setAttribute("rel", "stylesheet");head.appendChild(element);}async run() {await Promise.all([this.addJs(), this.addCss()]);ui();}}customElements.define("beer-css", BeerCssCustomElement);export default BeerCssCustomElement;
1
+ class BeerCssCustomElement extends HTMLElement {static isCssLoaded = false;static isJsLoaded = false;constructor() {super();this.run();}async addJs() {if (BeerCssCustomElement.isJsLoaded) return;BeerCssCustomElement.isJsLoaded = true;if (window.ui) return;return await import("https://cdn.jsdelivr.net/npm/beercss@4.0.8/dist/cdn/beer.min.js");}async addCss() {if (BeerCssCustomElement.isCssLoaded) return;BeerCssCustomElement.isCssLoaded = true;const isScoped = !!getComputedStyle(document.documentElement).getPropertyValue("--scoped");if (isScoped) return;const head = document.querySelector("head");const element = document.createElement("link");element.setAttribute("href", "https://cdn.jsdelivr.net/npm/beercss@4.0.8/dist/cdn/beer.scoped.min.css");element.setAttribute("rel", "stylesheet");head.appendChild(element);}async run() {await Promise.all([this.addJs(), this.addCss()]);ui();}}customElements.define("beer-css", BeerCssCustomElement);export default BeerCssCustomElement;
package/dist/cdn/beer.js CHANGED
@@ -151,7 +151,15 @@ function onPasswordIconClick(e) {
151
151
  var _a;
152
152
  const icon = e.currentTarget;
153
153
  const input = query("input", parent(icon));
154
- if (input && ((_a = icon.textContent) == null ? void 0 : _a.includes("visibility"))) input.type = input.type === "password" ? "text" : "password";
154
+ if (input && ((_a = icon.textContent) == null ? void 0 : _a.includes("visibility"))) {
155
+ if (input.type === "password") {
156
+ input.type = "text";
157
+ icon.textContent = "visibility_off";
158
+ } else {
159
+ input.type = "password";
160
+ icon.textContent = "visibility";
161
+ }
162
+ }
155
163
  }
156
164
  function onInputTextarea(e) {
157
165
  const textarea = e.currentTarget;
@@ -203,7 +211,7 @@ function updateAllTextareas() {
203
211
  }
204
212
  }
205
213
  function updateAllPasswordIcons() {
206
- const icons = queryAll("input[type=password] ~ :is(i, a)");
214
+ const icons = queryAll(".field:has(> input[type=password]) > i, a");
207
215
  for (let i = 0; i < icons.length; i++) onWeak(icons[i], "click", onPasswordIconClick);
208
216
  }
209
217
  function updateInput(input) {