@stnd/styles 0.6.0 → 0.7.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @stnd/styles
2
2
 
3
+ ## 0.7.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Auto-bumped @stnd/styles due to modified code.
8
+
9
+ ## 0.7.0
10
+
11
+ ### Minor Changes
12
+
13
+ - Auto-bumped @stnd/styles due to modified code.
14
+
3
15
  ## 0.6.0
4
16
 
5
17
  ### Minor Changes
@@ -142,29 +142,31 @@ figcaption {
142
142
  /* They provide a simple "zoom-on-hold" experience. */
143
143
  /* ================================================================ */
144
144
 
145
- /* When JS is off, holding click on an image will trigger this zoom effect. */
146
- html:not(.js-image-zoom-enabled) img:active {
147
- cursor: zoom-out;
148
- display: block;
149
- position: fixed;
150
- z-index: var(--z-image-zoom);
151
- max-height: calc(100vh);
152
- max-width: calc(100vw);
153
- object-fit: contain;
154
- margin: 0 auto;
155
- top: 50%;
156
- left: 50%;
157
- transform: translate(-50%, -50%);
158
- user-select: none;
159
- }
145
+ /* When JS is off, holding click on an image will trigger this zoom effect on desktop with fine pointer. */
146
+ @media (min-width: #{$small}) and (pointer: fine) {
147
+ html:not(.js-image-zoom-enabled) img:active {
148
+ cursor: zoom-out;
149
+ display: block;
150
+ position: fixed;
151
+ z-index: var(--z-image-zoom);
152
+ max-height: calc(100vh);
153
+ max-width: calc(100vw);
154
+ object-fit: contain;
155
+ margin: 0 auto;
156
+ top: 50%;
157
+ left: 50%;
158
+ transform: translate(-50%, -50%);
159
+ user-select: none;
160
+ }
160
161
 
161
- /* Creates a backdrop for the :active zoom. */
162
- html:not(.js-image-zoom-enabled):has(img:active)::before {
163
- content: "";
164
- position: fixed;
165
- inset: 0;
166
- background: var(--color-background);
167
- z-index: calc(var(--z-image-zoom) - 1);
162
+ /* Creates a backdrop for the :active zoom. */
163
+ html:not(.js-image-zoom-enabled):has(img:active)::before {
164
+ content: "";
165
+ position: fixed;
166
+ inset: 0;
167
+ background: var(--color-background);
168
+ z-index: calc(var(--z-image-zoom) - 1);
169
+ }
168
170
  }
169
171
 
170
172
  /* ================================================================ */
@@ -221,7 +223,7 @@ html.image-zoomed-active {
221
223
 
222
224
  /* Uses #{$small} — same breakpoint variable as everywhere else in the
223
225
  framework. */
224
- @media (min-width: #{$small}) {
226
+ @media (min-width: #{$small}) and (pointer: fine) {
225
227
  /* Global zoomable image cursor */
226
228
  img:not([data-no-zoom]) {
227
229
  cursor: zoom-in !important;
@@ -249,7 +249,13 @@ input[type="radio"] {
249
249
  input[type="checkbox"][role="switch"] {
250
250
  --switch-height: calc(var(--space) - var(--space-d3));
251
251
  --switch-width: calc(var(--switch-height) * 2);
252
- --switch-padding: 2px;
252
+ /* Was a fixed 2px — correct-looking at the default ~16px-tall switch
253
+ (an 8px thumb inset by 2px on each side), but any consumer overriding
254
+ --switch-height alone (a smaller, denser control panel, say) kept that
255
+ same fixed inset and ended up with a visibly undersized thumb, since
256
+ the padding never scaled down with it. 1/8 of the height reproduces
257
+ the original ~2px look at the default size while actually scaling. */
258
+ --switch-padding: calc(var(--switch-height) / 8);
253
259
 
254
260
  appearance: none;
255
261
  box-sizing: border-box; /* Reset content-box from base checkbox rule */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stnd/styles",
3
- "version": "0.6.0",
3
+ "version": "0.7.1",
4
4
  "type": "module",
5
5
  "author": "Francis Fontaine",
6
6
  "license": "MIT",