beercss 3.11.32 → 3.12.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.
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 href="https://bundlephobia.com/package/beercss@3.11.32" target="_blank"><img src="https://img.shields.io/bundlephobia/minzip/beercss@3.11.32" alt="minzipped size"></a>
7
+ <a href="https://bundlephobia.com/package/beercss@3.12.0" target="_blank"><img src="https://img.shields.io/bundlephobia/minzip/beercss@3.12.0" alt="minzipped 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>
@@ -132,8 +132,8 @@ This project was guided by the **"Germany Beer Purity Law"** or **"Reinheitsgebo
132
132
  ### DEFAULT VERSION
133
133
 
134
134
  ```html
135
- <link href="https://cdn.jsdelivr.net/npm/beercss@3.11.32/dist/cdn/beer.min.css" rel="stylesheet" />
136
- <script type="module" src="https://cdn.jsdelivr.net/npm/beercss@3.11.32/dist/cdn/beer.min.js"></script>
135
+ <link href="https://cdn.jsdelivr.net/npm/beercss@3.12.0/dist/cdn/beer.min.css" rel="stylesheet" />
136
+ <script type="module" src="https://cdn.jsdelivr.net/npm/beercss@3.12.0/dist/cdn/beer.min.js"></script>
137
137
  <script type="module" src="https://cdn.jsdelivr.net/npm/material-dynamic-colors@1.1.2/dist/cdn/material-dynamic-colors.min.js"></script>
138
138
  ```
139
139
 
@@ -151,8 +151,8 @@ import "material-dynamic-colors";
151
151
  Applied on child elements of `<* class="beer">...</*>`.
152
152
 
153
153
  ```html
154
- <link href="https://cdn.jsdelivr.net/npm/beercss@3.11.32/dist/cdn/beer.scoped.min.css" rel="stylesheet" />
155
- <script type="module" src="https://cdn.jsdelivr.net/npm/beercss@3.11.32/dist/cdn/beer.min.js"></script>
154
+ <link href="https://cdn.jsdelivr.net/npm/beercss@3.12.0/dist/cdn/beer.scoped.min.css" rel="stylesheet" />
155
+ <script type="module" src="https://cdn.jsdelivr.net/npm/beercss@3.12.0/dist/cdn/beer.min.js"></script>
156
156
  <script type="module" src="https://cdn.jsdelivr.net/npm/material-dynamic-colors@1.1.2/dist/cdn/material-dynamic-colors.min.js"></script>
157
157
  ```
158
158
 
@@ -170,7 +170,7 @@ import "material-dynamic-colors";
170
170
  Applied on child elements of `<beer-css>...</beer-css>`.
171
171
 
172
172
  ```html
173
- <script type="module" src="https://cdn.jsdelivr.net/npm/beercss@3.11.32/dist/cdn/beer.custom-element.min.js"></script>
173
+ <script type="module" src="https://cdn.jsdelivr.net/npm/beercss@3.12.0/dist/cdn/beer.custom-element.min.js"></script>
174
174
  <script type="module" src="https://cdn.jsdelivr.net/npm/material-dynamic-colors@1.1.2/dist/cdn/material-dynamic-colors.min.js"></script>
175
175
  ```
176
176
 
@@ -186,7 +186,7 @@ import "material-dynamic-colors";
186
186
 
187
187
  ### LOCAL CDN VERSION
188
188
 
189
- Download all files from CDN https://cdn.jsdelivr.net/npm/beercss@3.11.32/dist/cdn/ and https://cdn.jsdelivr.net/npm/material-dynamic-colors@1.1.2/dist/cdn/. Now put the files inside a new folder in your project (like `/beercss` for example):
189
+ Download all files from CDN https://cdn.jsdelivr.net/npm/beercss@3.12.0/dist/cdn/ and https://cdn.jsdelivr.net/npm/material-dynamic-colors@1.1.2/dist/cdn/. Now put the files inside a new folder in your project (like `/beercss` for example):
190
190
 
191
191
  ```html
192
192
  <link href="/beercss/beer.min.css" rel="stylesheet" />
@@ -206,8 +206,8 @@ You can use this html to setup your project. See on [Codepen](https://codepen.io
206
206
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
207
207
  <meta name="google" content="notranslate">
208
208
  <title>Hello world</title>
209
- <link href="https://cdn.jsdelivr.net/npm/beercss@3.11.32/dist/cdn/beer.min.css" rel="stylesheet">
210
- <script type="module" src="https://cdn.jsdelivr.net/npm/beercss@3.11.32/dist/cdn/beer.min.js"></script>
209
+ <link href="https://cdn.jsdelivr.net/npm/beercss@3.12.0/dist/cdn/beer.min.css" rel="stylesheet">
210
+ <script type="module" src="https://cdn.jsdelivr.net/npm/beercss@3.12.0/dist/cdn/beer.min.js"></script>
211
211
  <script type="module" src="https://cdn.jsdelivr.net/npm/material-dynamic-colors@1.1.2/dist/cdn/material-dynamic-colors.min.js"></script>
212
212
  </head>
213
213
  <body class="dark">
package/dist/cdn/beer.css CHANGED
@@ -99,7 +99,7 @@ body.dark {
99
99
  font-style: normal;
100
100
  font-weight: 400;
101
101
  font-display: block;
102
- src: url(material-symbols-outlined.woff2) format("woff2"), url(https://cdn.jsdelivr.net/npm/beercss@3.11.32/dist/cdn/material-symbols-outlined.woff2) format("woff2");
102
+ src: url(material-symbols-outlined.woff2) format("woff2"), url(https://cdn.jsdelivr.net/npm/beercss@3.12.0/dist/cdn/material-symbols-outlined.woff2) format("woff2");
103
103
  }
104
104
  /* rounded icons */
105
105
  @font-face {
@@ -107,7 +107,7 @@ body.dark {
107
107
  font-style: normal;
108
108
  font-weight: 400;
109
109
  font-display: block;
110
- src: url(material-symbols-rounded.woff2) format("woff2"), url(https://cdn.jsdelivr.net/npm/beercss@3.11.32/dist/cdn/material-symbols-rounded.woff2) format("woff2");
110
+ src: url(material-symbols-rounded.woff2) format("woff2"), url(https://cdn.jsdelivr.net/npm/beercss@3.12.0/dist/cdn/material-symbols-rounded.woff2) format("woff2");
111
111
  }
112
112
  /* sharp icons */
113
113
  @font-face {
@@ -115,7 +115,7 @@ body.dark {
115
115
  font-style: normal;
116
116
  font-weight: 400;
117
117
  font-display: block;
118
- src: url(material-symbols-sharp.woff2) format("woff2"), url(https://cdn.jsdelivr.net/npm/beercss@3.11.32/dist/cdn/material-symbols-sharp.woff2) format("woff2");
118
+ src: url(material-symbols-sharp.woff2) format("woff2"), url(https://cdn.jsdelivr.net/npm/beercss@3.12.0/dist/cdn/material-symbols-sharp.woff2) format("woff2");
119
119
  }
120
120
  /* subset of only required icons */
121
121
  @font-face {
@@ -123,7 +123,7 @@ body.dark {
123
123
  font-style: normal;
124
124
  font-weight: 400;
125
125
  font-display: block;
126
- src: url(material-symbols-subset.woff2) format("woff2"), url(https://cdn.jsdelivr.net/npm/beercss@3.11.32/dist/cdn/material-symbols-subset.woff2) format("woff2");
126
+ src: url(material-symbols-subset.woff2) format("woff2"), url(https://cdn.jsdelivr.net/npm/beercss@3.12.0/dist/cdn/material-symbols-subset.woff2) format("woff2");
127
127
  }
128
128
  * {
129
129
  -webkit-tap-highlight-color: transparent;
@@ -1340,8 +1340,7 @@ body :is(:hover,:focus)::-webkit-scrollbar-thumb {
1340
1340
  }
1341
1341
  .scroll {
1342
1342
  overflow: auto;
1343
- max-inline-size: calc(100vw - calc(var(--_padding, 0) * 2));
1344
- margin: auto;
1343
+ min-inline-size: 0;
1345
1344
  }
1346
1345
  .no-scroll {
1347
1346
  overflow: hidden;
@@ -1604,6 +1603,12 @@ pre:has(> code){
1604
1603
  direction: ltr;
1605
1604
  text-align: start;
1606
1605
  }
1606
+ sub {
1607
+ vertical-align: sub;
1608
+ }
1609
+ sup {
1610
+ vertical-align: super;
1611
+ }
1607
1612
  :is(.wave, .chip, .button, button, nav.tabbed > a, .tabs > a, nav.toolbar > a):not(.slow-ripple, .ripple, .fast-ripple)::after,
1608
1613
  nav:is(.left, .right, .bottom, .top).max > a::after,
1609
1614
  nav:is(.left, .right, .bottom, .top).max > :is(ol, ul) > li > a::after,
@@ -1778,11 +1783,21 @@ dialog > :is(header, footer).fixed {
1778
1783
  inset: 0;
1779
1784
  z-index: 12;
1780
1785
  }
1786
+ :has(> main) > header {
1787
+ padding-block-start: var(--top);
1788
+ }
1789
+ :has(> main) > footer {
1790
+ padding-block-end: var(--bottom);
1791
+ }
1792
+ nav.top ~ header,
1793
+ nav.bottom ~ footer {
1794
+ padding-block: 0;
1795
+ }
1781
1796
  nav.top ~ header.fixed {
1782
- inset-block-start: 4.5rem;
1797
+ inset-block: calc(var(--top) + 4.5rem) 0;
1783
1798
  }
1784
1799
  nav.bottom ~ footer.fixed {
1785
- inset-block-end: 4.5rem;
1800
+ inset-block: 0 calc(var(--bottom) + 4.5rem);
1786
1801
  }
1787
1802
  :is(nav, .row) > header {
1788
1803
  background-color: inherit;
@@ -1936,6 +1951,8 @@ article.border {
1936
1951
  }
1937
1952
  dialog {
1938
1953
  --_padding: 1.5rem;
1954
+ --_top: calc(var(--_padding) + var(--top));
1955
+ --_bottom: calc(var(--_padding) + var(--bottom));
1939
1956
  display: block;
1940
1957
  visibility: hidden;
1941
1958
  border: none;
@@ -1993,12 +2010,13 @@ dialog.top {
1993
2010
  inset: 0 auto auto 0;
1994
2011
  transform: translateY(-100%);
1995
2012
  border-radius: 0 0 1rem 1rem;
1996
- padding-block-end: var(--_padding);
2013
+ padding-block-start: var(--_top);
1997
2014
  }
1998
2015
  dialog.bottom {
1999
2016
  inset: auto auto 0 0;
2000
2017
  transform: translateY(100%);
2001
2018
  border-radius: 1rem 1rem 0 0;
2019
+ padding-block-end: var(--_bottom);
2002
2020
  }
2003
2021
  dialog:is(.left, .right) {
2004
2022
  opacity: 1;
@@ -2007,6 +2025,7 @@ dialog:is(.left, .right) {
2007
2025
  block-size: 100%;
2008
2026
  max-block-size: 100%;
2009
2027
  background-color: var(--surface);
2028
+ padding-block: var(--_top) var(--_bottom);
2010
2029
  }
2011
2030
  [dir=rtl] dialog.right,
2012
2031
  dialog.left {
@@ -2029,6 +2048,7 @@ dialog.max {
2029
2048
  transform: translateY(4rem);
2030
2049
  background-color: var(--surface);
2031
2050
  border-radius: 0;
2051
+ padding-block: var(--_top) var(--_bottom);
2032
2052
  }
2033
2053
  dialog:is(.active, [open]):is(.left, .right, .top, .bottom, .max) {
2034
2054
  transform: translate(0, 0);
@@ -2054,6 +2074,11 @@ dialog.medium:is(.top, .bottom) {
2054
2074
  dialog.large:is(.top, .bottom) {
2055
2075
  block-size: 32rem;
2056
2076
  }
2077
+ @media (pointer: coarse) {
2078
+ body:has(dialog[open], dialog.active) {
2079
+ overflow: hidden;
2080
+ }
2081
+ }
2057
2082
  hr,
2058
2083
  [class*=divider] {
2059
2084
  all: unset;
@@ -2220,7 +2245,7 @@ input::-webkit-date-and-time-value {
2220
2245
  padding: 0 0.875rem;
2221
2246
  }
2222
2247
  .field.min > textarea {
2223
- overflow: hidden;
2248
+ overflow: hidden auto;
2224
2249
  position: absolute;
2225
2250
  inset: 0;
2226
2251
  max-block-size: 12rem;
@@ -2820,28 +2845,22 @@ nav.right {
2820
2845
  }
2821
2846
  nav.top {
2822
2847
  grid-area: top;
2823
- position: sticky;
2824
- inset: 0;
2825
- block-size: 4rem;
2826
2848
  }
2827
2849
  nav.bottom {
2828
2850
  grid-area: bottom;
2829
- position: sticky;
2830
- inset: 0;
2831
- block-size: 4rem;
2832
2851
  }
2833
2852
  header {
2834
2853
  grid-area: header;
2835
2854
  }
2855
+ footer {
2856
+ grid-area: footer;
2857
+ }
2836
2858
  main {
2837
2859
  --_padding: 0.5rem;
2838
2860
  grid-area: main;
2839
2861
  padding: var(--_padding);
2840
2862
  overflow: hidden;
2841
2863
  }
2842
- footer {
2843
- grid-area: footer;
2844
- }
2845
2864
  aside {
2846
2865
  z-index: 1;
2847
2866
  }
@@ -2964,6 +2983,7 @@ menu {
2964
2983
  transform: scale(0.8) translateY(120%);
2965
2984
  transition: all var(--speed2), 0s background-color;
2966
2985
  justify-content: flex-start;
2986
+ padding: 0.5rem 0;
2967
2987
  }
2968
2988
  [dir=rtl] menu {
2969
2989
  inset: auto 0 0 auto;
@@ -3022,6 +3042,7 @@ menu.min {
3022
3042
  transform: none !important;
3023
3043
  background-color: var(--surface-variant) !important;
3024
3044
  color: var(--on-surface-variant) !important;
3045
+ padding: 0;
3025
3046
  }
3026
3047
  [dir=rtl] menu.min.right,
3027
3048
  menu.min.left,
@@ -3201,6 +3222,7 @@ a.row {
3201
3222
  white-space: nowrap;
3202
3223
  gap: 1rem;
3203
3224
  border-radius: 0;
3225
+ min-inline-size: 0;
3204
3226
  }
3205
3227
  a.row,
3206
3228
  nav.row {
@@ -3243,6 +3265,9 @@ nav > :is(ol, ul) > li > :only-child {
3243
3265
  min-block-size: inherit;
3244
3266
  }
3245
3267
  nav:is(.left, .right, .top, .bottom) {
3268
+ --_padding: 0.5rem;
3269
+ --_top: calc(var(--_padding) + var(--top));
3270
+ --_bottom: calc(var(--_padding) + var(--bottom));
3246
3271
  position: sticky;
3247
3272
  inset: 0;
3248
3273
  border: 0;
@@ -3250,7 +3275,7 @@ nav:is(.left, .right, .top, .bottom) {
3250
3275
  transform: none;
3251
3276
  z-index: 100;
3252
3277
  text-align: center;
3253
- padding: 0.5rem;
3278
+ padding: var(--_padding);
3254
3279
  margin: 0;
3255
3280
  }
3256
3281
  nav:is(.left, .right) {
@@ -3259,8 +3284,11 @@ nav:is(.left, .right) {
3259
3284
  background-color: var(--surface);
3260
3285
  block-size: 100dvh;
3261
3286
  min-inline-size: 6rem;
3287
+ padding-block: var(--_top) var(--_bottom);
3262
3288
  }
3263
3289
  nav:is(.top, .bottom) {
3290
+ position: sticky;
3291
+ inset: 0;
3264
3292
  padding: 0.5rem;
3265
3293
  justify-content: center;
3266
3294
  flex-direction: row;
@@ -3268,6 +3296,14 @@ nav:is(.top, .bottom) {
3268
3296
  block-size: auto;
3269
3297
  min-block-size: 4.5rem;
3270
3298
  }
3299
+ nav.top {
3300
+ block-size: calc(var(--top) + 4.5rem);
3301
+ padding-block-start: var(--_top);
3302
+ }
3303
+ nav.bottom {
3304
+ block-size: calc(var(--bottom) + 4.5rem);
3305
+ padding-block-end: var(--_bottom);
3306
+ }
3271
3307
  nav > header {
3272
3308
  min-block-size: auto;
3273
3309
  padding: 0;
@@ -3303,7 +3339,7 @@ nav.max:is(.left, .right, .top, .bottom) {
3303
3339
  inline-size: auto;
3304
3340
  align-items: flex-start;
3305
3341
  min-inline-size: 12.75rem;
3306
- padding: 0.5rem 1.25rem;
3342
+ padding: var(--_top) 1.25rem var(--_bottom) 1.25rem;
3307
3343
  }
3308
3344
  nav.max > :is(ol, ul) {
3309
3345
  padding: 0;
@@ -3697,12 +3733,16 @@ progress.max {
3697
3733
  position: absolute;
3698
3734
  inline-size: 100% !important;
3699
3735
  block-size: 100% !important;
3700
- color: var(--active);
3736
+ color: currentColor;
3701
3737
  background: none;
3702
3738
  inset: 0;
3703
3739
  border-radius: inherit;
3704
3740
  animation: none;
3705
3741
  writing-mode: horizontal-tb;
3742
+ opacity: 0.33;
3743
+ }
3744
+ progress.max[class*='-text'] {
3745
+ opacity: 1;
3706
3746
  }
3707
3747
  progress:is(.horizontal, .vertical, .max) {
3708
3748
  display: unset;
@@ -4347,18 +4387,33 @@ progress.max + * {
4347
4387
  inset: 0 auto auto calc(100% - var(--_end));
4348
4388
  border-radius: 2rem;
4349
4389
  transition: top var(--speed2) ease, opacity var(--speed2) ease;
4350
- transform: translate(-50%, -50%) !important;
4390
+ transform: translate(-50%, -25%) !important;
4351
4391
  padding: 0.75rem 1rem;
4352
4392
  }
4393
+ .slider > .tooltip.bottom {
4394
+ inset: auto auto 0 calc(100% - var(--_end));
4395
+ transition: bottom var(--speed2) ease, opacity var(--speed2) ease;
4396
+ transform: translate(-50%, 25%) !important;
4397
+ }
4353
4398
  [dir=rtl] .slider > .tooltip {
4354
- transform: translate(-50%, -50%) scaleX(-1) !important;
4399
+ transform: translate(-50%, -25%) scaleX(-1) !important;
4400
+ }
4401
+ [dir=rtl] .slider > .tooltip.bottom {
4402
+ transform: translate(-50%, 25%) scaleX(-1) !important;
4355
4403
  }
4356
4404
  .slider > .tooltip + .tooltip {
4357
4405
  inset: 0.25rem calc(100% - var(--_start)) auto auto;
4358
- transform: translate(50%, -50%) !important;
4406
+ transform: translate(50%, -25%) !important;
4407
+ }
4408
+ .slider > .tooltip + .tooltip.bottom {
4409
+ inset: auto calc(100% - var(--_start)) -0.25rem auto;
4410
+ transform: translate(50%, 25%) !important;
4359
4411
  }
4360
4412
  [dir=rtl] .slider > .tooltip + .tooltip {
4361
- transform: translate(50%, -50%) scaleX(-1) !important;
4413
+ transform: translate(50%, -25%) scaleX(-1) !important;
4414
+ }
4415
+ [dir=rtl] .slider > .tooltip + .tooltip.bottom {
4416
+ transform: translate(50%, 25%) scaleX(-1) !important;
4362
4417
  }
4363
4418
  .slider > .tooltip::before {
4364
4419
  content: var(--_value1);
@@ -4367,20 +4422,31 @@ progress.max + * {
4367
4422
  content: var(--_value2);
4368
4423
  }
4369
4424
  .slider > :focus ~ .tooltip {
4370
- inset-block-start: -1rem !important;
4425
+ inset-block: -1rem auto;
4371
4426
  opacity: 1 !important;
4372
4427
  visibility: visible !important;
4373
4428
  }
4429
+ .slider > :focus ~ .tooltip.bottom {
4430
+ inset-block: auto -1rem;
4431
+ }
4374
4432
  .slider.vertical > .tooltip {
4375
- inset-block-start: auto !important;
4376
- margin-block-start: calc(-1 * var(--_thumb)) !important;
4433
+ inset-block: auto;
4377
4434
  block-size: 2.5rem;
4378
4435
  inline-size: 2.5rem;
4436
+ margin-block: calc(-1 * var(--_thumb)) 0 !important;
4379
4437
  transform: rotate(90deg) translate(-75%, 50%) !important;
4380
4438
  }
4439
+ .slider.vertical > .tooltip.bottom {
4440
+ inset-block: auto;
4441
+ margin-block: 0 calc(-1 * var(--_thumb)) !important;
4442
+ transform: rotate(90deg) translate(75%, 50%) !important;
4443
+ }
4381
4444
  .slider.vertical > .tooltip + .tooltip {
4382
4445
  transform: rotate(90deg) translate(-75%, -50%) !important;
4383
4446
  }
4447
+ .slider.vertical > .tooltip + .tooltip.bottom {
4448
+ transform: rotate(90deg) translate(75%, -50%) !important;
4449
+ }
4384
4450
  :is(nav, .row, .field) > .slider:not(.circle, .small, .medium, .large) {
4385
4451
  flex: auto;
4386
4452
  }
@@ -4444,10 +4510,14 @@ progress.max + * {
4444
4510
  }
4445
4511
  @media (pointer: coarse) {
4446
4512
  .slider > :hover ~ .tooltip {
4447
- inset-block-start: -1rem !important;
4513
+ inset-block: -1rem auto !important;
4448
4514
  opacity: 1 !important;
4449
4515
  visibility: visible !important;
4450
4516
  }
4517
+
4518
+ .slider > :hover ~ .tooltip.bottom {
4519
+ inset-block: auto -1rem !important;
4520
+ }
4451
4521
  }
4452
4522
  .snackbar {
4453
4523
  position: fixed;
@@ -4612,6 +4682,10 @@ tfoot th.fixed {
4612
4682
  line-height: normal;
4613
4683
  transform: translate(-50%, -100%) scale(0.9);
4614
4684
  }
4685
+ .tooltip:not(.max):hover {
4686
+ visibility: hidden;
4687
+ opacity: 0;
4688
+ }
4615
4689
  .tooltip.left {
4616
4690
  inset: 50% auto auto 0;
4617
4691
  transform: translate(-100%, -50%) scale(0.9);
@@ -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@3.11.32/dist/cdn/beer.min.js");
15
+ return await import("https://cdn.jsdelivr.net/npm/beercss@3.12.0/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@3.11.32/dist/cdn/beer.scoped.min.css");
26
+ element.setAttribute("href", "https://cdn.jsdelivr.net/npm/beercss@3.12.0/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@3.11.32/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@3.11.32/dist/cdn/beer.scoped.min.css");element.setAttribute("rel", "stylesheet");head.appendChild(element);}async run() {this.classList.add("beer");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@3.12.0/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@3.12.0/dist/cdn/beer.scoped.min.css");element.setAttribute("rel", "stylesheet");head.appendChild(element);}async run() {this.classList.add("beer");await Promise.all([this.addJs(), this.addCss()]);ui();}}customElements.define("beer-css", BeerCssCustomElement);export default BeerCssCustomElement;
package/dist/cdn/beer.js CHANGED
@@ -394,7 +394,6 @@ function closeDialog(dialog, overlay) {
394
394
  _dialogs.pop();
395
395
  const previousDialog = _dialogs[_dialogs.length - 1];
396
396
  if (previousDialog) previousDialog.focus();
397
- else if (isTouchable()) document.body.classList.remove("no-scroll");
398
397
  }
399
398
  async function openDialog(dialog, overlay, isModal, from) {
400
399
  if (!hasTag(from, "button") && !hasClass(from, "button") && !hasClass(from, "chip")) addClass(from, "active");
@@ -405,7 +404,6 @@ async function openDialog(dialog, overlay, isModal, from) {
405
404
  await wait(90);
406
405
  if (!isModal) on(dialog, "keydown", onKeydownDialog, false);
407
406
  _dialogs.push(dialog);
408
- if (isTouchable()) document.body.classList.add("no-scroll");
409
407
  focusOnDialogOrElement(dialog);
410
408
  }
411
409
  function onClickOverlay(e) {