@fluixi-ui/tokens 0.4.0-alpha.3 → 0.4.0-alpha.5

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.
@@ -75,8 +75,11 @@
75
75
  transition: background var(--flx-ui-duration-fast) var(--flx-ui-ease-standard),
76
76
  color var(--flx-ui-duration-fast) var(--flx-ui-ease-standard);
77
77
  }
78
- :where([data-sidenav-link]:hover) {
79
- background: var(--flx-ui-color-bg-subtle);
78
+ /* Hover uses an fg-relative tint (not gray-2, which is invisible on the gray-1
79
+ rail) so it stays legible on any surface, light or dark. `:not([data-active])`
80
+ keeps the active pill from being flattened by hover. */
81
+ :where([data-sidenav-link]:hover:not([data-active])) {
82
+ background: color-mix(in oklab, var(--flx-ui-color-fg) 6%, transparent);
80
83
  color: var(--flx-ui-color-fg);
81
84
  }
82
85
  :where([data-sidenav-link][data-active]) {
@@ -109,6 +112,7 @@
109
112
  justify-content: center;
110
113
  width: 2rem;
111
114
  height: 2rem;
115
+ flex-shrink: 0;
112
116
  padding: 0;
113
117
  background: transparent;
114
118
  border: none;
@@ -116,23 +120,64 @@
116
120
  color: var(--flx-ui-color-fg-muted);
117
121
  cursor: pointer;
118
122
  }
123
+ /* A trigger in the header sits at the trailing edge on its own — the consumer
124
+ drops in <SidenavTrigger/> without wiring any layout. On the compact icon rail
125
+ the header centres its contents, so the auto-margin is dropped. */
126
+ :where([data-sidenav-header] [data-sidenav-trigger]) {
127
+ margin-inline-start: auto;
128
+ }
129
+ :where([data-sidenav][data-state='compact']:not([data-mobile]) [data-sidenav-header] [data-sidenav-trigger]) {
130
+ margin-inline-start: 0;
131
+ }
119
132
  :where([data-sidenav-trigger]:hover) {
120
- background: var(--flx-ui-color-bg-subtle);
133
+ background: color-mix(in oklab, var(--flx-ui-color-fg) 6%, transparent);
121
134
  color: var(--flx-ui-color-fg);
122
135
  }
123
136
  :where([data-sidenav-trigger]:focus-visible) {
124
137
  outline: var(--flx-ui-ctl-ring);
125
138
  outline-offset: 2px;
126
139
  }
140
+ /* Built-in trigger icon: a chevron pointing in the collapse direction, flipping
141
+ between expanded and compact (and mirrored for a right-side rail). */
142
+ :where([data-sidenav-trigger-icon]) {
143
+ display: block;
144
+ width: 1.15em;
145
+ height: 1.15em;
146
+ background: currentColor;
147
+ mask: var(--flx-ui-chevron-down) center / contain no-repeat;
148
+ -webkit-mask: var(--flx-ui-chevron-down) center / contain no-repeat;
149
+ transform: rotate(90deg);
150
+ transition: transform var(--flx-ui-duration-normal) var(--flx-ui-ease-standard);
151
+ }
152
+ :where([data-sidenav][data-collapsed] [data-sidenav-trigger-icon]),
153
+ :where([data-sidenav][data-side='right'] [data-sidenav-trigger-icon]) {
154
+ transform: rotate(-90deg);
155
+ }
156
+ :where([data-sidenav][data-side='right'][data-collapsed] [data-sidenav-trigger-icon]) {
157
+ transform: rotate(90deg);
158
+ }
127
159
 
128
- /* Compact icon rail: hide text labels, center the icons. Scoped to `compact` (not
129
- the mobile drawer, which presents full-width) — `hidden` is clipped anyway. */
130
- :where([data-sidenav][data-state='compact']:not([data-mobile]) [data-sidenav-label]),
131
- :where([data-sidenav][data-state='compact']:not([data-mobile]) [data-sidenav-group-label]) {
160
+ /* Compact icon rail: collapse each row to its leading icon. Scoped to `compact`
161
+ (not the mobile drawer, which is full-width; `hidden` is clipped anyway).
162
+ Applies to DIRECT rail rows ONLY — a sub's flyout content is portalled OUTSIDE
163
+ [data-sidenav], so these descendant rules never reach it (subitems keep their
164
+ labels in the popup). Three ways an element hides in compact:
165
+ 1. [data-sidenav-label] / [data-sidenav-group-label] — the recommended wrapper.
166
+ 2. [data-sidenav-hide-compact] — an explicit opt-in marker for ANY element.
167
+ 3. auto — any non-leading child of a link / sub-trigger (the first child is the
168
+ icon), so unmarked label text collapses with no extra markup. */
169
+ :where([data-sidenav][data-state='compact']:not([data-mobile]))
170
+ :where([data-sidenav-label], [data-sidenav-group-label], [data-sidenav-hide-compact]) {
171
+ display: none;
172
+ }
173
+ :where([data-sidenav][data-state='compact']:not([data-mobile]))
174
+ :where([data-sidenav-link], [data-sidenav-sub-trigger]) > :not(:first-child) {
132
175
  display: none;
133
176
  }
134
- :where([data-sidenav][data-state='compact']:not([data-mobile]) [data-sidenav-link]) {
177
+ :where([data-sidenav][data-state='compact']:not([data-mobile]))
178
+ :where([data-sidenav-link], [data-sidenav-sub-trigger]) {
135
179
  justify-content: center;
180
+ gap: 0;
136
181
  padding-inline: 0;
137
182
  }
138
183
 
@@ -165,21 +210,23 @@
165
210
  display: none;
166
211
  }
167
212
 
168
- /* Inline nested list (expanded / mobile). Collapsed via grid-rows so it animates. */
213
+ /* Inline nested list (expanded / mobile). Collapsed via max-height so every child
214
+ hides (a grid-rows 0fr trick only collapses a single grid child — the rest fall
215
+ into implicit auto rows and stay visible). The cap is generous; nav lists are short. */
169
216
  :where([data-sidenav-sub-content]:not([data-flyout])) {
170
- display: grid;
171
- grid-template-rows: 0fr;
172
217
  margin: 0;
173
218
  padding: 0 0 0 var(--flx-ui-space-5);
174
219
  list-style: none;
220
+ max-height: 0;
175
221
  overflow: hidden;
176
- transition: grid-template-rows var(--flx-ui-duration-normal) var(--flx-ui-ease-standard);
222
+ opacity: 0;
223
+ transition:
224
+ max-height var(--flx-ui-duration-normal) var(--flx-ui-ease-standard),
225
+ opacity var(--flx-ui-duration-fast) var(--flx-ui-ease-standard);
177
226
  }
178
227
  :where([data-sidenav-sub-content]:not([data-flyout])[data-open]) {
179
- grid-template-rows: 1fr;
180
- }
181
- :where([data-sidenav-sub-content]:not([data-flyout]) > *) {
182
- min-height: 0;
228
+ max-height: 40rem;
229
+ opacity: 1;
183
230
  }
184
231
 
185
232
  /* Flyout panel (compact rail): a floating anchored menu of the nested links. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluixi-ui/tokens",
3
- "version": "0.4.0-alpha.3",
3
+ "version": "0.4.0-alpha.5",
4
4
  "description": "Design tokens and theming for the Fluixi UI ecosystem",
5
5
  "license": "MIT",
6
6
  "private": false,