@mirrordown/remd-tabs 0.2.1 → 0.2.2

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
@@ -5,6 +5,13 @@
5
5
 
6
6
 
7
7
 
8
+
9
+ ## 0.2.2
10
+ <sub>2026-10-28</sub>
11
+
12
+ - *(patch)*
13
+ A tab strip too long for its group now scrolls with a thin scrollbar and fades at each edge that has more labels to scroll to (where scroll-driven animations are supported: Chrome 115+, Safari 26+). A strip that fits doesn't fade.
14
+
8
15
  ## 0.2.1
9
16
  <sub>2026-10-28</sub>
10
17
 
package/dist/tabs.css CHANGED
@@ -19,6 +19,19 @@
19
19
  allows arbitrary tab counts with a single rule pair, replacing the N×2 block.
20
20
  */
21
21
 
22
+ /* The label strip's edge fades, animated by its scroll position (registered so they animate). */
23
+ @property --_tabs-fade-start {
24
+ syntax: "<length>";
25
+ inherits: false;
26
+ initial-value: 0px;
27
+ }
28
+
29
+ @property --_tabs-fade-end {
30
+ syntax: "<length>";
31
+ inherits: false;
32
+ initial-value: 0px;
33
+ }
34
+
22
35
  @layer markdown-tabs {
23
36
  /* ── Container ──────────────────────────────────────────────────────────── */
24
37
 
@@ -59,10 +72,56 @@
59
72
  display: flex;
60
73
  overflow-x: auto;
61
74
  overflow-y: hidden;
75
+ scrollbar-width: thin;
76
+ scrollbar-color: color-mix(in oklch, currentColor 25%, transparent)
77
+ transparent;
62
78
  background-color: var(--_tabs-strip-bg);
63
79
  box-shadow: inset 0 -1px var(--_tabs-border);
64
80
  }
65
81
 
82
+ /*
83
+ A strip too long for its group fades at each edge that has more labels to
84
+ scroll to: the scroll position drives the fades, and a strip that fits has
85
+ no scroll timeline, so it doesn't fade. Requires scroll-driven animations
86
+ (Chrome 115+, Safari 26+); elsewhere the strip scrolls without the fade.
87
+ */
88
+ @keyframes markdown-tabs-edges {
89
+ from {
90
+ --_tabs-fade-start: 0px;
91
+ --_tabs-fade-end: 2rem;
92
+ }
93
+ 10%,
94
+ 90% {
95
+ --_tabs-fade-start: 2rem;
96
+ --_tabs-fade-end: 2rem;
97
+ }
98
+ to {
99
+ --_tabs-fade-start: 2rem;
100
+ --_tabs-fade-end: 0px;
101
+ }
102
+ }
103
+
104
+ @supports (animation-timeline: scroll()) {
105
+ .markdown-tabs-labels {
106
+ --_tabs-fade-direction: to right;
107
+ /* Longhands: minifiers fold `animation` and `animation-timeline` into one shorthand, which browsers reject. */
108
+ animation-name: markdown-tabs-edges;
109
+ animation-timing-function: linear;
110
+ animation-timeline: scroll(self inline);
111
+ mask-image: linear-gradient(
112
+ var(--_tabs-fade-direction),
113
+ transparent,
114
+ #000 var(--_tabs-fade-start),
115
+ #000 calc(100% - var(--_tabs-fade-end)),
116
+ transparent
117
+ );
118
+
119
+ &:dir(rtl) {
120
+ --_tabs-fade-direction: to left;
121
+ }
122
+ }
123
+ }
124
+
66
125
  /* Hide radio inputs without removing them from the DOM (needed for :has()) */
67
126
  .markdown-tabs-labels input[type="radio"] {
68
127
  position: fixed;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mirrordown/remd-tabs",
3
3
  "description": "A remark plugin for tabbed content blocks.",
4
- "version": "0.2.1",
4
+ "version": "0.2.2",
5
5
  "license": "MIT",
6
6
  "author": "Drake Costa <drake@saeris.io> (https://saeris.gg)",
7
7
  "repository": {
@@ -22,7 +22,7 @@
22
22
  "./*.css": "./dist/*.css"
23
23
  },
24
24
  "dependencies": {
25
- "@mirrordown/core": "^0.1.1"
25
+ "@mirrordown/core": "^0.1.2"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/hast": "^3.0.4",