@eluan/core 0.5.0 → 0.6.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 +33 -1
- package/dist/{action-popover-D6K9aVFk.cjs → action-popover-DrHKPGqw.cjs} +1 -1
- package/dist/{action-popover-BVJQBuky.js → action-popover-NkXDAHJT.js} +1 -1
- package/dist/action-popover.cjs +1 -1
- package/dist/action-popover.js +1 -1
- package/dist/{avatar-Co-k8KqV.cjs → avatar-B-t3ctR4.cjs} +1 -1
- package/dist/{avatar-CS5f1irF.js → avatar-kDEa0rjF.js} +1 -1
- package/dist/avatar.cjs +1 -1
- package/dist/avatar.js +1 -1
- package/dist/{badge-D9NYZFWH.js → badge-BLZ8V-KC.js} +10 -10
- package/dist/{badge-DXKWztL-.cjs → badge-D1A0Tc79.cjs} +1 -1
- package/dist/badge.cjs +1 -1
- package/dist/badge.js +1 -1
- package/dist/{banner-COlEFRuK.cjs → banner-CNdwDPqA.cjs} +1 -1
- package/dist/{banner-CyYFLZXw.js → banner-DzSp5WfQ.js} +9 -9
- package/dist/banner.cjs +1 -1
- package/dist/banner.js +1 -1
- package/dist/box-DG-tkaYi.cjs +1 -0
- package/dist/box-DKbNgGGG.js +17 -0
- package/dist/box.cjs +1 -0
- package/dist/box.d.ts +1 -0
- package/dist/box.js +5 -0
- package/dist/{breadcrumb-NWXeCH5q.cjs → breadcrumb-BuxXkm6O.cjs} +1 -1
- package/dist/{breadcrumb-Cm1nb9Xj.js → breadcrumb-C6qj-tDx.js} +1 -1
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.js +1 -1
- package/dist/button--_WI-fM6.cjs +1 -0
- package/dist/{button-ANAPDrvs.js → button-DNSNShUc.js} +28 -26
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/{calendar-BpBsomy5.js → calendar-BA2tSwZD.js} +6 -6
- package/dist/{calendar-7LX5YGGT.cjs → calendar-DS5821-k.cjs} +3 -3
- package/dist/calendar.cjs +1 -1
- package/dist/calendar.js +1 -1
- package/dist/{card-C88--zB4.cjs → card-BNdR5aDa.cjs} +1 -1
- package/dist/{card-BC_4C3ns.js → card-BSgN7WSe.js} +1 -1
- package/dist/card.cjs +1 -1
- package/dist/card.js +1 -1
- package/dist/{carousel-BfL7oy_q.cjs → carousel-4AERgboz.cjs} +1 -1
- package/dist/{carousel-DuP0hvF-.js → carousel-Bb7jpzep.js} +1 -1
- package/dist/carousel.cjs +1 -1
- package/dist/carousel.js +1 -1
- package/dist/{checkbox-Bi0Kmuut.js → checkbox-CGUTGery.js} +1 -1
- package/dist/{checkbox-M8DmWKiC.cjs → checkbox-Cq9sHU_S.cjs} +1 -1
- package/dist/{checkbox-group-KBwPhjmW.cjs → checkbox-group-DGXZ4o2-.cjs} +1 -1
- package/dist/{checkbox-group-CQMEJnhD.js → checkbox-group-Tkio3IhK.js} +1 -1
- package/dist/checkbox-group.cjs +1 -1
- package/dist/checkbox-group.js +1 -1
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/{command-BCl0seLL.cjs → command-D02vvta9.cjs} +1 -1
- package/dist/{command-Chs5VlBL.js → command-sUMAxm8S.js} +1 -1
- package/dist/command.cjs +1 -1
- package/dist/command.js +1 -1
- package/dist/components/box.d.ts +12 -0
- package/dist/components/grid.d.ts +35 -0
- package/dist/components/hover-card.d.ts +14 -2
- package/dist/components/icon.d.ts +26 -0
- package/dist/components/layout-shared.d.ts +307 -0
- package/dist/components/multi-select.d.ts +1 -1
- package/dist/components/navigation-drawer.d.ts +25 -5
- package/dist/components/row.d.ts +18 -0
- package/dist/components/stack.d.ts +14 -0
- package/dist/components/tone-shared.d.ts +39 -0
- package/dist/components/tooltip.d.ts +14 -2
- package/dist/components/typography.d.ts +22 -2
- package/dist/components/visually-hidden.d.ts +11 -0
- package/dist/{credit-card-input-DN-8vaFj.js → credit-card-input-9VPlzvDm.js} +1 -1
- package/dist/{credit-card-input-CUqA9CX3.cjs → credit-card-input-DppPJBne.cjs} +1 -1
- package/dist/credit-card-input.cjs +1 -1
- package/dist/credit-card-input.js +1 -1
- package/dist/{date-picker-ni8td8Ru.js → date-picker-M5hLx_1s.js} +2 -2
- package/dist/{date-picker-DGBsfZXx.cjs → date-picker-hE7cDg2B.cjs} +1 -1
- package/dist/date-picker.cjs +1 -1
- package/dist/date-picker.js +1 -1
- package/dist/{datetime-picker-C1d63MaA.cjs → datetime-picker-BeRUPJ7s.cjs} +1 -1
- package/dist/{datetime-picker-DsnHYRK-.js → datetime-picker-CIqBZYMH.js} +3 -3
- package/dist/datetime-picker.cjs +1 -1
- package/dist/datetime-picker.js +1 -1
- package/dist/{decimal-input-yTk35W_5.js → decimal-input-Bg2BPKIr.js} +38 -38
- package/dist/decimal-input-CkTEjo2J.cjs +1 -0
- package/dist/decimal-input.cjs +1 -1
- package/dist/decimal-input.js +1 -1
- package/dist/{dialog-B8eWKqzS.js → dialog-Bsfviqvy.js} +2 -2
- package/dist/dialog-DRAoumvB.cjs +1 -0
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.js +1 -1
- package/dist/{email-input-DFI4h_KN.cjs → email-input-CehmtNUq.cjs} +1 -1
- package/dist/{email-input-pX0hlYV3.js → email-input-DIiY9Q3S.js} +1 -1
- package/dist/email-input.cjs +1 -1
- package/dist/email-input.js +1 -1
- package/dist/{footer-DB0_-IwN.cjs → footer-fovIsy-0.cjs} +1 -1
- package/dist/{footer-B3KUIwXW.js → footer-jWaFq3qk.js} +9 -9
- package/dist/footer.cjs +1 -1
- package/dist/footer.js +1 -1
- package/dist/grid-BDz4Xs6M.cjs +1 -0
- package/dist/grid-BX5vZjDo.js +612 -0
- package/dist/grid.cjs +1 -0
- package/dist/grid.d.ts +1 -0
- package/dist/grid.js +5 -0
- package/dist/{header-CDOWlOAR.js → header-Dnf8AnIx.js} +2 -2
- package/dist/{header-CiZQY_7S.cjs → header-DzItWqW4.cjs} +1 -1
- package/dist/header.cjs +1 -1
- package/dist/header.js +1 -1
- package/dist/hover-card-C5KsTSZR.cjs +1 -0
- package/dist/hover-card-C_FCzE41.js +21 -0
- package/dist/hover-card.cjs +1 -1
- package/dist/hover-card.js +1 -1
- package/dist/icon-BmLOodCQ.cjs +1 -0
- package/dist/icon-BwDfkIdR.js +153 -0
- package/dist/icon.cjs +1 -0
- package/dist/icon.d.ts +1 -0
- package/dist/icon.js +5 -0
- package/dist/index.cjs +10 -5
- package/dist/index.d.ts +6 -0
- package/dist/index.js +612 -541
- package/dist/{input-BrGJn-D9.cjs → input-BcjL2oxv.cjs} +1 -1
- package/dist/{input-Cccufiqn.js → input-CPb9yVU5.js} +8 -8
- package/dist/input-otp-BhJ3ERrY.cjs +1 -0
- package/dist/{input-otp-DmEGB1nu.js → input-otp-CTvJztkH.js} +32 -32
- package/dist/input-otp.cjs +1 -1
- package/dist/input-otp.js +1 -1
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/layout-shared-B_1iX4Hj.js +319 -0
- package/dist/layout-shared-CsBZcT4V.cjs +1 -0
- package/dist/multi-select-CVxkWW29.js +85 -0
- package/dist/multi-select-DBFINH3F.cjs +1 -0
- package/dist/multi-select.cjs +1 -1
- package/dist/multi-select.js +1 -1
- package/dist/navigation-drawer-BCBFtLEq.cjs +1 -0
- package/dist/navigation-drawer-BMyHXhhX.js +198 -0
- package/dist/navigation-drawer.cjs +1 -1
- package/dist/navigation-drawer.js +1 -1
- package/dist/{number-input-vICbRc2y.js → number-input-Cm9YPBOX.js} +1 -1
- package/dist/{number-input-Bc7jUsu-.cjs → number-input-Dr9MbuRV.cjs} +1 -1
- package/dist/number-input.cjs +1 -1
- package/dist/number-input.js +1 -1
- package/dist/{pagination-DTWRjiOm.js → pagination-D2tjMpVU.js} +2 -2
- package/dist/{pagination-4IuE_APs.cjs → pagination-yKmFlFMR.cjs} +1 -1
- package/dist/pagination.cjs +1 -1
- package/dist/pagination.js +1 -1
- package/dist/{password-input-BwnlHPbX.cjs → password-input-CmHubHuU.cjs} +1 -1
- package/dist/{password-input-B9V45d3Q.js → password-input-ljwdGCO6.js} +2 -2
- package/dist/password-input.cjs +1 -1
- package/dist/password-input.js +1 -1
- package/dist/{phone-input-BQjZj5jI.cjs → phone-input-B8VksCer.cjs} +1 -1
- package/dist/{phone-input-CSBpGHvI.js → phone-input-qTL6K8rT.js} +2 -2
- package/dist/phone-input.cjs +1 -1
- package/dist/phone-input.js +1 -1
- package/dist/progress-BpdmBGaX.cjs +1 -0
- package/dist/{progress-Dz_it5I-.js → progress-ChFf9bIq.js} +1 -1
- package/dist/progress.cjs +1 -1
- package/dist/progress.js +1 -1
- package/dist/providers/create-theme.d.ts +10 -1
- package/dist/providers/eluan-provider.d.ts +2 -1
- package/dist/providers/portal-container.d.ts +1 -1
- package/dist/{radio-group-C--1neiq.cjs → radio-group-9gozRouT.cjs} +1 -1
- package/dist/{radio-group-CNMPZx_2.js → radio-group-Bs9933bk.js} +6 -6
- package/dist/radio-group.cjs +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/{rich-text-BZSyuYSo.js → rich-text-DImwK9hN.js} +1 -1
- package/dist/{rich-text-DerWxzdn.cjs → rich-text-DzHLeG7W.cjs} +1 -1
- package/dist/rich-text.cjs +1 -1
- package/dist/rich-text.js +1 -1
- package/dist/row-BYAk7G5d.js +37 -0
- package/dist/row-Bjn-GQAC.cjs +1 -0
- package/dist/row.cjs +1 -0
- package/dist/row.d.ts +1 -0
- package/dist/row.js +5 -0
- package/dist/{search-input-Dmmo-BEL.cjs → search-input-BKTjebg7.cjs} +1 -1
- package/dist/{search-input-bFNW6oiE.js → search-input-Dgr9kT1a.js} +1 -1
- package/dist/search-input.cjs +1 -1
- package/dist/search-input.js +1 -1
- package/dist/select-Cdh991T-.cjs +1 -0
- package/dist/{select-DDSYjKtj.js → select-Dp5AJ6I-.js} +15 -15
- package/dist/select.cjs +1 -1
- package/dist/select.js +1 -1
- package/dist/sheet-CkXjinUG.cjs +1 -0
- package/dist/{sheet-D5HWF66e.js → sheet-uiyHNKEw.js} +6 -6
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.js +1 -1
- package/dist/{slider-CZQBAXup.js → slider-BQmbh0Nl.js} +1 -1
- package/dist/{slider-DdEOapYP.cjs → slider-DK2yk-YK.cjs} +1 -1
- package/dist/slider.cjs +1 -1
- package/dist/slider.js +1 -1
- package/dist/stack-Ck1w2iJu.cjs +1 -0
- package/dist/stack-D2btWM1t.js +27 -0
- package/dist/stack.cjs +1 -0
- package/dist/stack.d.ts +1 -0
- package/dist/stack.js +5 -0
- package/dist/{stepper-D5nDwJUz.cjs → stepper-ByYKX7qw.cjs} +1 -1
- package/dist/{stepper-BtlKiHtd.js → stepper-Copsj87A.js} +4 -4
- package/dist/stepper.cjs +1 -1
- package/dist/stepper.js +1 -1
- package/dist/styles.css +935 -59
- package/dist/{switch-KzBijHMJ.cjs → switch-C2OPCq5Z.cjs} +1 -1
- package/dist/{switch-C7EBLT5H.js → switch-CXBWUZcq.js} +3 -3
- package/dist/switch.cjs +1 -1
- package/dist/switch.js +1 -1
- package/dist/{tabs-DztJ2iVc.cjs → tabs-D8p6Tr5i.cjs} +1 -1
- package/dist/{tabs-C9NKBmH0.js → tabs-TV4_2wi1.js} +9 -9
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/{textarea-Dl-daLHR.cjs → textarea-BnpQmE74.cjs} +1 -1
- package/dist/{textarea-DXUk1b_-.js → textarea-CJRmnazN.js} +1 -1
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +1 -1
- package/dist/{time-input-BPoFvoeM.js → time-input-A603mEFQ.js} +38 -38
- package/dist/time-input-qxljhdEb.cjs +1 -0
- package/dist/time-input.cjs +1 -1
- package/dist/time-input.js +1 -1
- package/dist/{toggle-Dv1VZ5Le.js → toggle-Bx3q15Pu.js} +6 -6
- package/dist/{toggle-Bvh1v32T.cjs → toggle-Z3t4jPdv.cjs} +1 -1
- package/dist/{toggle-group-SyHMwO90.cjs → toggle-group-BZIW4wJp.cjs} +1 -1
- package/dist/{toggle-group-DE8BPZih.js → toggle-group-LaZmOMx_.js} +7 -7
- package/dist/toggle-group.cjs +1 -1
- package/dist/toggle-group.js +1 -1
- package/dist/toggle.cjs +1 -1
- package/dist/toggle.js +1 -1
- package/dist/tooltip-DZqn4wKl.js +23 -0
- package/dist/tooltip-faf1dIXp.cjs +1 -0
- package/dist/tooltip.cjs +1 -1
- package/dist/tooltip.js +1 -1
- package/dist/{tree-view-CyeJR7cW.js → tree-view-DRmm6oL6.js} +23 -23
- package/dist/tree-view-DVQyRQDg.cjs +1 -0
- package/dist/tree-view.cjs +1 -1
- package/dist/tree-view.js +1 -1
- package/dist/visually-hidden-BQMRYGxP.js +14 -0
- package/dist/visually-hidden-DzxxOswl.cjs +1 -0
- package/dist/visually-hidden.cjs +1 -0
- package/dist/visually-hidden.d.ts +1 -0
- package/dist/visually-hidden.js +5 -0
- package/package.json +8 -8
- package/skills/eluan/DESIGN.md +409 -0
- package/skills/eluan/SKILL.md +166 -0
- package/skills/eluan/components/accordion.md +212 -0
- package/skills/eluan/components/action-popover.md +266 -0
- package/skills/eluan/components/aspect-ratio.md +169 -0
- package/skills/eluan/components/avatar.md +277 -0
- package/skills/eluan/components/badge.md +190 -0
- package/skills/eluan/components/banner.md +247 -0
- package/skills/eluan/components/box.md +166 -0
- package/skills/eluan/components/breadcrumb.md +240 -0
- package/skills/eluan/components/button.md +214 -0
- package/skills/eluan/components/calendar.md +192 -0
- package/skills/eluan/components/card.md +270 -0
- package/skills/eluan/components/carousel.md +274 -0
- package/skills/eluan/components/checkbox-group.md +228 -0
- package/skills/eluan/components/checkbox.md +226 -0
- package/skills/eluan/components/code-block.md +193 -0
- package/skills/eluan/components/collapsible.md +240 -0
- package/skills/eluan/components/command.md +359 -0
- package/skills/eluan/components/context-menu.md +296 -0
- package/skills/eluan/components/credit-card-input.md +217 -0
- package/skills/eluan/components/date-picker.md +255 -0
- package/skills/eluan/components/date-time-picker.md +196 -0
- package/skills/eluan/components/decimal-input.md +232 -0
- package/skills/eluan/components/dialog.md +322 -0
- package/skills/eluan/components/drawer.md +292 -0
- package/skills/eluan/components/dropdown-menu.md +450 -0
- package/skills/eluan/components/email-input.md +200 -0
- package/skills/eluan/components/fieldset.md +219 -0
- package/skills/eluan/components/file-input.md +249 -0
- package/skills/eluan/components/footer.md +290 -0
- package/skills/eluan/components/form-label.md +254 -0
- package/skills/eluan/components/grid.md +192 -0
- package/skills/eluan/components/header.md +242 -0
- package/skills/eluan/components/hover-card.md +215 -0
- package/skills/eluan/components/icon.md +161 -0
- package/skills/eluan/components/input-otp.md +227 -0
- package/skills/eluan/components/input.md +249 -0
- package/skills/eluan/components/kbd.md +216 -0
- package/skills/eluan/components/media.md +244 -0
- package/skills/eluan/components/menubar.md +300 -0
- package/skills/eluan/components/multi-select.md +221 -0
- package/skills/eluan/components/navigation-drawer.md +297 -0
- package/skills/eluan/components/navigation-menu.md +291 -0
- package/skills/eluan/components/number-input.md +190 -0
- package/skills/eluan/components/pagination.md +262 -0
- package/skills/eluan/components/password-input.md +218 -0
- package/skills/eluan/components/phone-input.md +205 -0
- package/skills/eluan/components/popover.md +250 -0
- package/skills/eluan/components/progress.md +185 -0
- package/skills/eluan/components/radio-group.md +232 -0
- package/skills/eluan/components/rich-text.md +195 -0
- package/skills/eluan/components/row.md +174 -0
- package/skills/eluan/components/scroll-area.md +203 -0
- package/skills/eluan/components/search-input.md +281 -0
- package/skills/eluan/components/segmented-control.md +201 -0
- package/skills/eluan/components/select.md +296 -0
- package/skills/eluan/components/separator.md +179 -0
- package/skills/eluan/components/sheet.md +326 -0
- package/skills/eluan/components/skeleton.md +202 -0
- package/skills/eluan/components/slider.md +195 -0
- package/skills/eluan/components/spinner.md +187 -0
- package/skills/eluan/components/stack.md +158 -0
- package/skills/eluan/components/stepper.md +236 -0
- package/skills/eluan/components/switch.md +218 -0
- package/skills/eluan/components/table.md +348 -0
- package/skills/eluan/components/tabs.md +277 -0
- package/skills/eluan/components/textarea.md +202 -0
- package/skills/eluan/components/time-input.md +181 -0
- package/skills/eluan/components/toast.md +251 -0
- package/skills/eluan/components/toggle-group.md +241 -0
- package/skills/eluan/components/toggle.md +198 -0
- package/skills/eluan/components/tooltip.md +222 -0
- package/skills/eluan/components/tree-view.md +213 -0
- package/skills/eluan/components/typography.md +207 -0
- package/skills/eluan/components/visually-hidden.md +132 -0
- package/skills/eluan/foundations/colour.md +252 -0
- package/skills/eluan/foundations/elevation.md +57 -0
- package/skills/eluan/foundations/iconography.md +70 -0
- package/skills/eluan/foundations/motion.md +60 -0
- package/skills/eluan/foundations/radius.md +61 -0
- package/skills/eluan/foundations/spacing.md +98 -0
- package/skills/eluan/foundations/theming.md +197 -0
- package/skills/eluan/foundations/typography.md +163 -0
- package/skills/eluan/patterns/empty-states.md +84 -0
- package/skills/eluan/patterns/feedback.md +95 -0
- package/skills/eluan/patterns/forms.md +138 -0
- package/skills/eluan/patterns/navigation.md +95 -0
- package/skills/eluan/patterns/page-layout.md +101 -0
- package/dist/button-Ny6OF8Un.cjs +0 -1
- package/dist/decimal-input-BLmifKF2.cjs +0 -1
- package/dist/dialog-DWYtFhZl.cjs +0 -1
- package/dist/hover-card-BN7Ew2Y1.js +0 -16
- package/dist/hover-card-Dft-08Ha.cjs +0 -1
- package/dist/input-otp-DcZ7wyjs.cjs +0 -1
- package/dist/multi-select-DPoOHWSC.js +0 -74
- package/dist/multi-select-fX5FXYEY.cjs +0 -1
- package/dist/navigation-drawer-BbeDYPhu.js +0 -171
- package/dist/navigation-drawer-DOOHfbY3.cjs +0 -1
- package/dist/progress-DpQjGEyn.cjs +0 -1
- package/dist/select-1Eb3NSrR.cjs +0 -1
- package/dist/sheet-7NP1LuHy.cjs +0 -1
- package/dist/time-input-DR2snTgB.cjs +0 -1
- package/dist/tooltip-BlCQKhUE.js +0 -18
- package/dist/tooltip-Cyu7fWYZ.cjs +0 -1
- package/dist/tree-view-CNvEc1TT.cjs +0 -1
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: colour
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Colour
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
Every colour in Eluan is a semantic token set by the theme and resolved against the active mode (light, dim, dark). Token names say what a colour is for, not what it looks like: `--container-bg` is a surface, `--action-primary-bg` is the main call to action. A custom theme or the theme generator changes the values; the names stay the same. See [theming.md](./theming.md).
|
|
10
|
+
|
|
11
|
+
Tokens come in families, and each family has matching background, foreground and border tokens per state:
|
|
12
|
+
|
|
13
|
+
| Family | For |
|
|
14
|
+
| --- | --- |
|
|
15
|
+
| `--container-*` | surfaces: page, cards, panels, popovers, table rows |
|
|
16
|
+
| `--interactive-*` | inputs, selectable rows, hoverable items |
|
|
17
|
+
| `--focus-ring` | the keyboard focus outline; components draw it, so you rarely need it |
|
|
18
|
+
| `--action-primary-*` | the main action (Button `default`) |
|
|
19
|
+
| `--action-secondary-*` | outline actions (Button `outline`) |
|
|
20
|
+
| `--action-tertiary-*` | ghost actions (Button `ghost`) |
|
|
21
|
+
| `--destructive-*` | errors and destructive actions |
|
|
22
|
+
| `--cautionary-*` | warnings; the `caution` tone in component props |
|
|
23
|
+
| `--positive-*` | success |
|
|
24
|
+
| `--informative-*` | neutral information |
|
|
25
|
+
| `--important-*` | emphasis that isn't a warning |
|
|
26
|
+
| `--dataviz-*` | chart series only |
|
|
27
|
+
|
|
28
|
+
## Rules
|
|
29
|
+
|
|
30
|
+
1. Use semantic tokens for every colour. Never write hex, rgb, hsl or oklch values.
|
|
31
|
+
2. Pair a background with the foreground from the same family and state: `--container-bg` with `--container-fg`, `--action-primary-bg-active` with `--action-primary-fg-active`.
|
|
32
|
+
3. Use a tone component prop (`variant="destructive"`, `variant="caution"`) before reaching for tone tokens yourself.
|
|
33
|
+
4. The `caution` tone reads the `--cautionary-*` tokens. There is no separate caution token family.
|
|
34
|
+
5. Use `--dataviz-*` only for chart series, never for status or decoration.
|
|
35
|
+
6. Never use primitives (`--color-*`, `--blazeorange-*`) or the mode layer (`--backgrounds-*`, `--foregrounds-*`) in app code.
|
|
36
|
+
7. Never override one side of a pair. Contrast is checked at theme generation; change the theme instead.
|
|
37
|
+
8. Never mix states: don't put a `-hover` background behind a resting foreground.
|
|
38
|
+
|
|
39
|
+
## Tokens
|
|
40
|
+
|
|
41
|
+
Values show the mode alias each token points to, then the resolved value in light mode (and dark mode where it differs).
|
|
42
|
+
|
|
43
|
+
<!-- tokens:start -->
|
|
44
|
+
| Token | Value (default theme) | Use for |
|
|
45
|
+
| --- | --- | --- |
|
|
46
|
+
| `--container-bg` | `--backgrounds-primary` → oklch(1.0000 0.0000 0.00) / dark oklch(0.2686 0.0000 0.00) | Surfaces (cards, panels, popovers): background |
|
|
47
|
+
| `--container-bg-alt` | `--backgrounds-secondary` → oklch(0.9702 0.0000 0.00) / dark oklch(0.2046 0.0000 0.00) | Surfaces (cards, panels, popovers): subtle alternate background |
|
|
48
|
+
| `--container-bg-inverse` | `--foregrounds-secondary` → oklch(0.2686 0.0000 0.00) / dark oklch(0.9702 0.0000 0.00) | Surfaces (cards, panels, popovers): background on an inverse surface |
|
|
49
|
+
| `--container-border` | `--backgrounds-tertiary` → oklch(0.9219 0.0000 0.00) / dark oklch(0.1448 0.0000 0.00) | Surfaces (cards, panels, popovers): border |
|
|
50
|
+
| `--container-border-alt` | `--backgrounds-quaternary` → oklch(0.8699 0.0000 0.00) / dark oklch(0.3715 0.0000 0.00) | Surfaces (cards, panels, popovers): subtle border |
|
|
51
|
+
| `--container-border-inverse` | `--foregrounds-tertiary` → oklch(0.4386 0.0000 0.00) / dark oklch(0.9219 0.0000 0.00) | Surfaces (cards, panels, popovers): border on an inverse surface |
|
|
52
|
+
| `--container-fg` | `--foregrounds-primary` → oklch(0.1448 0.0000 0.00) / dark oklch(1.0000 0.0000 0.00) | Surfaces (cards, panels, popovers): text and icons |
|
|
53
|
+
| `--container-fg-alt` | `--foregrounds-secondary` → oklch(0.2686 0.0000 0.00) / dark oklch(0.9702 0.0000 0.00) | Surfaces (cards, panels, popovers): muted text and icons |
|
|
54
|
+
| `--container-fg-inverse` | `--backgrounds-primary` → oklch(1.0000 0.0000 0.00) / dark oklch(0.2686 0.0000 0.00) | Surfaces (cards, panels, popovers): text on an inverse surface |
|
|
55
|
+
| `--interactive-bg` | `--backgrounds-primary` → oklch(1.0000 0.0000 0.00) / dark oklch(0.2686 0.0000 0.00) | Inputs and selectable items: background |
|
|
56
|
+
| `--interactive-bg-alt` | `--backgrounds-secondary` → oklch(0.9702 0.0000 0.00) / dark oklch(0.2046 0.0000 0.00) | Inputs and selectable items: subtle alternate background |
|
|
57
|
+
| `--interactive-bg-alt2` | `--backgrounds-secondary` → oklch(0.9702 0.0000 0.00) / dark oklch(0.2046 0.0000 0.00) | Inputs and selectable items: second alternate background |
|
|
58
|
+
| `--interactive-bg-disabled` | `--backgrounds-tertiary` → oklch(0.9219 0.0000 0.00) / dark oklch(0.1448 0.0000 0.00) | Inputs and selectable items: background when disabled |
|
|
59
|
+
| `--interactive-bg-hover` | `--backgrounds-tertiary` → oklch(0.9219 0.0000 0.00) / dark oklch(0.1448 0.0000 0.00) | Inputs and selectable items: background on hover |
|
|
60
|
+
| `--interactive-bg-active` | `--foregrounds-primary` → oklch(0.1448 0.0000 0.00) / dark oklch(1.0000 0.0000 0.00) | Inputs and selectable items: background while pressed |
|
|
61
|
+
| `--interactive-bg-selected` | `--foregrounds-primary` → oklch(0.1448 0.0000 0.00) / dark oklch(1.0000 0.0000 0.00) | Inputs and selectable items: background when selected |
|
|
62
|
+
| `--interactive-bg-inverse` | `--foregrounds-primary` → oklch(0.1448 0.0000 0.00) / dark oklch(1.0000 0.0000 0.00) | Inputs and selectable items: background on an inverse surface |
|
|
63
|
+
| `--interactive-border` | `--backgrounds-tertiary` → oklch(0.9219 0.0000 0.00) / dark oklch(0.1448 0.0000 0.00) | Inputs and selectable items: border |
|
|
64
|
+
| `--interactive-border-alt` | `--backgrounds-quaternary` → oklch(0.8699 0.0000 0.00) / dark oklch(0.3715 0.0000 0.00) | Inputs and selectable items: subtle border |
|
|
65
|
+
| `--interactive-border-disabled` | `--backgrounds-quaternary` → oklch(0.8699 0.0000 0.00) / dark oklch(0.3715 0.0000 0.00) | Inputs and selectable items: border when disabled |
|
|
66
|
+
| `--interactive-fg` | `--foregrounds-primary` → oklch(0.1448 0.0000 0.00) / dark oklch(1.0000 0.0000 0.00) | Inputs and selectable items: text and icons |
|
|
67
|
+
| `--interactive-fg-alt` | `--foregrounds-tertiary` → oklch(0.4386 0.0000 0.00) / dark oklch(0.9219 0.0000 0.00) | Inputs and selectable items: muted text and icons |
|
|
68
|
+
| `--interactive-fg-readonly` | `--foregrounds-secondary` → oklch(0.2686 0.0000 0.00) / dark oklch(0.9702 0.0000 0.00) | Inputs and selectable items: text when read-only |
|
|
69
|
+
| `--interactive-fg-disabled` | `--foregrounds-quinary` → oklch(0.7090 0.0000 0.00) | Inputs and selectable items: text when disabled |
|
|
70
|
+
| `--interactive-fg-active` | `--backgrounds-primary` → oklch(1.0000 0.0000 0.00) / dark oklch(0.2686 0.0000 0.00) | Inputs and selectable items: text while pressed |
|
|
71
|
+
| `--interactive-fg-selected` | `--backgrounds-primary` → oklch(1.0000 0.0000 0.00) / dark oklch(0.2686 0.0000 0.00) | Inputs and selectable items: text when selected |
|
|
72
|
+
| `--interactive-fg-inverse` | `--backgrounds-primary` → oklch(1.0000 0.0000 0.00) / dark oklch(0.2686 0.0000 0.00) | Inputs and selectable items: text on an inverse surface |
|
|
73
|
+
| `--action-primary-bg` | `--foregrounds-primary` → oklch(0.1448 0.0000 0.00) / dark oklch(1.0000 0.0000 0.00) | Primary actions: background |
|
|
74
|
+
| `--action-primary-bg-hover` | `--foregrounds-tertiary` → oklch(0.4386 0.0000 0.00) / dark oklch(0.9219 0.0000 0.00) | Primary actions: background on hover |
|
|
75
|
+
| `--action-primary-bg-active` | `--foregrounds-secondary` → oklch(0.2686 0.0000 0.00) / dark oklch(0.9702 0.0000 0.00) | Primary actions: background while pressed |
|
|
76
|
+
| `--action-primary-bg-selected` | `--foregrounds-secondary` → oklch(0.2686 0.0000 0.00) / dark oklch(0.9702 0.0000 0.00) | Primary actions: background when selected |
|
|
77
|
+
| `--action-primary-bg-disabled` | `--foregrounds-quinary` → oklch(0.7090 0.0000 0.00) | Primary actions: background when disabled |
|
|
78
|
+
| `--action-primary-bg-inverse` | `--backgrounds-primary` → oklch(1.0000 0.0000 0.00) / dark oklch(0.2686 0.0000 0.00) | Primary actions: background on an inverse surface |
|
|
79
|
+
| `--action-primary-fg` | `--backgrounds-primary` → oklch(1.0000 0.0000 0.00) / dark oklch(0.2686 0.0000 0.00) | Primary actions: text and icons |
|
|
80
|
+
| `--action-primary-fg-disabled` | `--backgrounds-quaternary` → oklch(0.8699 0.0000 0.00) / dark oklch(0.3715 0.0000 0.00) | Primary actions: text when disabled |
|
|
81
|
+
| `--action-primary-fg-active` | `--backgrounds-primary` → oklch(1.0000 0.0000 0.00) / dark oklch(0.2686 0.0000 0.00) | Primary actions: text while pressed |
|
|
82
|
+
| `--action-primary-fg-selected` | `--backgrounds-primary` → oklch(1.0000 0.0000 0.00) / dark oklch(0.2686 0.0000 0.00) | Primary actions: text when selected |
|
|
83
|
+
| `--action-primary-fg-inverse` | `--foregrounds-primary` → oklch(0.1448 0.0000 0.00) / dark oklch(1.0000 0.0000 0.00) | Primary actions: text on an inverse surface |
|
|
84
|
+
| `--action-secondary-bg-hover` | `--backgrounds-tertiary` → oklch(0.9219 0.0000 0.00) / dark oklch(0.1448 0.0000 0.00) | Secondary (outline) actions: background on hover |
|
|
85
|
+
| `--action-secondary-bg-active` | `--mono-background` → oklch(0.1448 0.0000 0.00) / dark oklch(0.9851 0.0000 0.00) | Secondary (outline) actions: background while pressed |
|
|
86
|
+
| `--action-secondary-bg-selected` | `--mono-background` → oklch(0.1448 0.0000 0.00) / dark oklch(0.9851 0.0000 0.00) | Secondary (outline) actions: background when selected |
|
|
87
|
+
| `--action-secondary-bg-disabled` | `--backgrounds-tertiary` → oklch(0.9219 0.0000 0.00) / dark oklch(0.1448 0.0000 0.00) | Secondary (outline) actions: background when disabled |
|
|
88
|
+
| `--action-secondary-border` | `--mono-background` → oklch(0.1448 0.0000 0.00) / dark oklch(0.9851 0.0000 0.00) | Secondary (outline) actions: border |
|
|
89
|
+
| `--action-secondary-border-alt` | `--mono-shade` → oklch(0.3715 0.0000 0.00) / dark oklch(0.9702 0.0000 0.00) | Secondary (outline) actions: subtle border |
|
|
90
|
+
| `--action-secondary-border-disabled` | `--mono-tint` → oklch(0.9702 0.0000 0.00) / dark oklch(0.3715 0.0000 0.00) | Secondary (outline) actions: border when disabled |
|
|
91
|
+
| `--action-secondary-border-inverse` | `--backgrounds-secondary` → oklch(0.9702 0.0000 0.00) / dark oklch(0.2046 0.0000 0.00) | Secondary (outline) actions: border on an inverse surface |
|
|
92
|
+
| `--action-secondary-fg-alt` | `--foregrounds-primary` → oklch(0.1448 0.0000 0.00) / dark oklch(1.0000 0.0000 0.00) | Secondary (outline) actions: muted text and icons |
|
|
93
|
+
| `--action-secondary-fg-disabled` | `--foregrounds-quinary` → oklch(0.7090 0.0000 0.00) | Secondary (outline) actions: text when disabled |
|
|
94
|
+
| `--action-secondary-fg-active` | `--backgrounds-primary` → oklch(1.0000 0.0000 0.00) / dark oklch(0.2686 0.0000 0.00) | Secondary (outline) actions: text while pressed |
|
|
95
|
+
| `--action-secondary-fg-selected` | `--backgrounds-primary` → oklch(1.0000 0.0000 0.00) / dark oklch(0.2686 0.0000 0.00) | Secondary (outline) actions: text when selected |
|
|
96
|
+
| `--action-secondary-fg-inverse` | `--foregrounds-primary` → oklch(0.1448 0.0000 0.00) / dark oklch(1.0000 0.0000 0.00) | Secondary (outline) actions: text on an inverse surface |
|
|
97
|
+
| `--action-secondary-fg` | `--mono-background` → oklch(0.1448 0.0000 0.00) / dark oklch(0.9851 0.0000 0.00) | Secondary (outline) actions: text and icons |
|
|
98
|
+
| `--action-tertiary-bg` | `--backgrounds-primary` → oklch(1.0000 0.0000 0.00) / dark oklch(0.2686 0.0000 0.00) | Tertiary (ghost) actions: background |
|
|
99
|
+
| `--action-tertiary-bg-alt` | `--backgrounds-secondary` → oklch(0.9702 0.0000 0.00) / dark oklch(0.2046 0.0000 0.00) | Tertiary (ghost) actions: subtle alternate background |
|
|
100
|
+
| `--action-tertiary-bg-hover` | `--backgrounds-secondary` → oklch(0.9702 0.0000 0.00) / dark oklch(0.2046 0.0000 0.00) | Tertiary (ghost) actions: background on hover |
|
|
101
|
+
| `--action-tertiary-bg-active` | `--mono-tint` → oklch(0.9702 0.0000 0.00) / dark oklch(0.3715 0.0000 0.00) | Tertiary (ghost) actions: background while pressed |
|
|
102
|
+
| `--action-tertiary-bg-selected` | `--mono-tint` → oklch(0.9702 0.0000 0.00) / dark oklch(0.3715 0.0000 0.00) | Tertiary (ghost) actions: background when selected |
|
|
103
|
+
| `--action-tertiary-bg-disabled` | `--backgrounds-primary` → oklch(1.0000 0.0000 0.00) / dark oklch(0.2686 0.0000 0.00) | Tertiary (ghost) actions: background when disabled |
|
|
104
|
+
| `--action-tertiary-bg-inverse` | `--backgrounds-primary` → oklch(1.0000 0.0000 0.00) / dark oklch(0.2686 0.0000 0.00) | Tertiary (ghost) actions: background on an inverse surface |
|
|
105
|
+
| `--action-tertiary-border` | `--backgrounds-quaternary` → oklch(0.8699 0.0000 0.00) / dark oklch(0.3715 0.0000 0.00) | Tertiary (ghost) actions: border |
|
|
106
|
+
| `--action-tertiary-border-alt` | `--mono-tint` → oklch(0.9702 0.0000 0.00) / dark oklch(0.3715 0.0000 0.00) | Tertiary (ghost) actions: subtle border |
|
|
107
|
+
| `--action-tertiary-border-disabled` | `--backgrounds-quaternary` → oklch(0.8699 0.0000 0.00) / dark oklch(0.3715 0.0000 0.00) | Tertiary (ghost) actions: border when disabled |
|
|
108
|
+
| `--action-tertiary-border-inverse` | `--backgrounds-secondary` → oklch(0.9702 0.0000 0.00) / dark oklch(0.2046 0.0000 0.00) | Tertiary (ghost) actions: border on an inverse surface |
|
|
109
|
+
| `--action-tertiary-fg-alt` | `--foregrounds-primary` → oklch(0.1448 0.0000 0.00) / dark oklch(1.0000 0.0000 0.00) | Tertiary (ghost) actions: muted text and icons |
|
|
110
|
+
| `--action-tertiary-fg-disabled` | `--foregrounds-quinary` → oklch(0.7090 0.0000 0.00) | Tertiary (ghost) actions: text when disabled |
|
|
111
|
+
| `--action-tertiary-fg-active` | `--mono-shade` → oklch(0.3715 0.0000 0.00) / dark oklch(0.9702 0.0000 0.00) | Tertiary (ghost) actions: text while pressed |
|
|
112
|
+
| `--action-tertiary-fg-selected` | `--mono-shade` → oklch(0.3715 0.0000 0.00) / dark oklch(0.9702 0.0000 0.00) | Tertiary (ghost) actions: text when selected |
|
|
113
|
+
| `--action-tertiary-fg-inverse` | `--backgrounds-primary` → oklch(1.0000 0.0000 0.00) / dark oklch(0.2686 0.0000 0.00) | Tertiary (ghost) actions: text on an inverse surface |
|
|
114
|
+
| `--action-tertiary-fg` | `--mono-background` → oklch(0.1448 0.0000 0.00) / dark oklch(0.9851 0.0000 0.00) | Tertiary (ghost) actions: text and icons |
|
|
115
|
+
| `--action-neutral-bg` | `--backgrounds-tertiary` → oklch(0.9219 0.0000 0.00) / dark oklch(0.1448 0.0000 0.00) | Neutral actions (the `secondary` button): background |
|
|
116
|
+
| `--action-neutral-bg-hover` | `--backgrounds-quaternary` → oklch(0.8699 0.0000 0.00) / dark oklch(0.3715 0.0000 0.00) | Neutral actions (the `secondary` button): background on hover |
|
|
117
|
+
| `--action-neutral-fg` | `--foregrounds-primary` → oklch(0.1448 0.0000 0.00) / dark oklch(1.0000 0.0000 0.00) | Neutral actions (the `secondary` button): text and icons |
|
|
118
|
+
| `--destructive-bg` | `--torchred-background` → oklch(0.9691 0.0151 17.42) / dark oklch(0.2639 0.1083 29.23) | Destructive status and actions: background |
|
|
119
|
+
| `--destructive-bg-alt` | `--torchred-tint` → oklch(0.9322 0.0343 17.78) / dark oklch(0.4062 0.1665 28.83) | Destructive status and actions: subtle alternate background |
|
|
120
|
+
| `--destructive-bg-hover` | `--torchred-tint` → oklch(0.9322 0.0343 17.78) / dark oklch(0.4062 0.1665 28.83) | Destructive status and actions: background on hover |
|
|
121
|
+
| `--destructive-bg-active` | `--torchred-shade` → oklch(0.4695 0.1927 29.23) / dark oklch(0.8751 0.0665 18.51) | Destructive status and actions: background while pressed |
|
|
122
|
+
| `--destructive-bg-selected` | `--torchred-shade` → oklch(0.4695 0.1927 29.23) / dark oklch(0.8751 0.0665 18.51) | Destructive status and actions: background when selected |
|
|
123
|
+
| `--destructive-bg-disabled` | `--backgrounds-tertiary` → oklch(0.9219 0.0000 0.00) / dark oklch(0.1448 0.0000 0.00) | Destructive status and actions: background when disabled |
|
|
124
|
+
| `--destructive-bg-inverse` | `--torchred-shade` → oklch(0.4695 0.1927 29.23) / dark oklch(0.8751 0.0665 18.51) | Destructive status and actions: background on an inverse surface |
|
|
125
|
+
| `--destructive-border` | `--torchred-main` → oklch(0.6280 0.2577 29.23) / dark oklch(0.6695 0.2182 21.71) | Destructive status and actions: border |
|
|
126
|
+
| `--destructive-border-alt` | `--torchred-shade` → oklch(0.4695 0.1927 29.23) / dark oklch(0.8751 0.0665 18.51) | Destructive status and actions: subtle border |
|
|
127
|
+
| `--destructive-border-disabled` | `--torchred-tint` → oklch(0.9322 0.0343 17.78) / dark oklch(0.4062 0.1665 28.83) | Destructive status and actions: border when disabled |
|
|
128
|
+
| `--destructive-border-inverse` | `--torchred-background` → oklch(0.9691 0.0151 17.42) / dark oklch(0.2639 0.1083 29.23) | Destructive status and actions: border on an inverse surface |
|
|
129
|
+
| `--destructive-fg` | `--torchred-foreground` → oklch(0.5444 0.2234 29.23) / dark oklch(0.9691 0.0151 17.42) | Destructive status and actions: text and icons |
|
|
130
|
+
| `--destructive-fg-alt` | `--foregrounds-primary` → oklch(0.1448 0.0000 0.00) / dark oklch(1.0000 0.0000 0.00) | Destructive status and actions: muted text and icons |
|
|
131
|
+
| `--destructive-fg-disabled` | `--foregrounds-quinary` → oklch(0.7090 0.0000 0.00) | Destructive status and actions: text when disabled |
|
|
132
|
+
| `--destructive-fg-active` | `--backgrounds-primary` → oklch(1.0000 0.0000 0.00) / dark oklch(0.2686 0.0000 0.00) | Destructive status and actions: text while pressed |
|
|
133
|
+
| `--destructive-fg-selected` | `--backgrounds-primary` → oklch(1.0000 0.0000 0.00) / dark oklch(0.2686 0.0000 0.00) | Destructive status and actions: text when selected |
|
|
134
|
+
| `--destructive-fg-inverse` | `--torchred-background` → oklch(0.9691 0.0151 17.42) / dark oklch(0.2639 0.1083 29.23) | Destructive status and actions: text on an inverse surface |
|
|
135
|
+
| `--cautionary-bg` | `--maitai-background` → oklch(0.9852 0.0151 90.23) / dark oklch(0.2758 0.0580 42.34) | Caution status (the `caution` tone): background |
|
|
136
|
+
| `--cautionary-bg-alt` | `--maitai-tint` → oklch(0.9601 0.0401 88.20) / dark oklch(0.4118 0.0860 41.58) | Caution status (the `caution` tone): subtle alternate background |
|
|
137
|
+
| `--cautionary-bg-inverse` | `--maitai-shade` → oklch(0.4724 0.1071 42.23) / dark oklch(0.8686 0.1177 83.38) | Caution status (the `caution` tone): background on an inverse surface |
|
|
138
|
+
| `--cautionary-border` | `--maitai-main` → oklch(0.7516 0.1455 61.95) | Caution status (the `caution` tone): border |
|
|
139
|
+
| `--cautionary-border-alt` | `--maitai-shade` → oklch(0.4724 0.1071 42.23) / dark oklch(0.8686 0.1177 83.38) | Caution status (the `caution` tone): subtle border |
|
|
140
|
+
| `--cautionary-border-inverse` | `--maitai-background` → oklch(0.9852 0.0151 90.23) / dark oklch(0.2758 0.0580 42.34) | Caution status (the `caution` tone): border on an inverse surface |
|
|
141
|
+
| `--cautionary-fg` | `--maitai-foreground` → oklch(0.5534 0.1277 44.34) / dark oklch(0.9852 0.0151 90.23) | Caution status (the `caution` tone): text and icons |
|
|
142
|
+
| `--cautionary-fg-alt` | `--foregrounds-primary` → oklch(0.1448 0.0000 0.00) / dark oklch(1.0000 0.0000 0.00) | Caution status (the `caution` tone): muted text and icons |
|
|
143
|
+
| `--cautionary-fg-inverse` | `--maitai-background` → oklch(0.9852 0.0151 90.23) / dark oklch(0.2758 0.0580 42.34) | Caution status (the `caution` tone): text on an inverse surface |
|
|
144
|
+
| `--positive-bg` | `--seagreen-background` → oklch(0.9796 0.0247 164.47) / dark oklch(0.2646 0.0515 171.60) | Positive status: background |
|
|
145
|
+
| `--positive-bg-alt` | `--seagreen-tint` → oklch(0.9488 0.0579 162.90) / dark oklch(0.3827 0.0785 166.91) | Positive status: subtle alternate background |
|
|
146
|
+
| `--positive-bg-inverse` | `--seagreen-shade` → oklch(0.4389 0.0946 163.18) / dark oklch(0.9488 0.0579 162.90) | Positive status: background on an inverse surface |
|
|
147
|
+
| `--positive-border` | `--seagreen-main` → oklch(0.7780 0.1777 159.41) | Positive status: border |
|
|
148
|
+
| `--positive-border-alt` | `--seagreen-shade` → oklch(0.4389 0.0946 163.18) / dark oklch(0.9488 0.0579 162.90) | Positive status: subtle border |
|
|
149
|
+
| `--positive-border-inverse` | `--seagreen-background` → oklch(0.9796 0.0247 164.47) / dark oklch(0.2646 0.0515 171.60) | Positive status: border on an inverse surface |
|
|
150
|
+
| `--positive-fg` | `--seagreen-foreground` → oklch(0.5180 0.1144 161.56) / dark oklch(0.9796 0.0247 164.47) | Positive status: text and icons |
|
|
151
|
+
| `--positive-fg-alt` | `--foregrounds-primary` → oklch(0.1448 0.0000 0.00) / dark oklch(1.0000 0.0000 0.00) | Positive status: muted text and icons |
|
|
152
|
+
| `--positive-fg-inverse` | `--seagreen-background` → oklch(0.9796 0.0247 164.47) / dark oklch(0.2646 0.0515 171.60) | Positive status: text on an inverse surface |
|
|
153
|
+
| `--informative-bg` | `--blueribbon-background` → oklch(0.9705 0.0142 254.60) / dark oklch(0.2795 0.0978 270.78) | Informative status: background |
|
|
154
|
+
| `--informative-bg-alt` | `--blueribbon-tint` → oklch(0.9322 0.0328 256.76) / dark oklch(0.3775 0.1564 267.71) | Informative status: subtle alternate background |
|
|
155
|
+
| `--informative-bg-inverse` | `--blueribbon-shade` → oklch(0.4225 0.2126 267.93) / dark oklch(0.9322 0.0328 256.76) | Informative status: background on an inverse surface |
|
|
156
|
+
| `--informative-border` | `--blueribbon-main` → oklch(0.6102 0.2112 261.20) | Informative status: border |
|
|
157
|
+
| `--informative-border-alt` | `--blueribbon-shade` → oklch(0.4225 0.2126 267.93) / dark oklch(0.9322 0.0328 256.76) | Informative status: subtle border |
|
|
158
|
+
| `--informative-border-inverse` | `--blueribbon-background` → oklch(0.9705 0.0142 254.60) / dark oklch(0.2795 0.0978 270.78) | Informative status: border on an inverse surface |
|
|
159
|
+
| `--informative-fg` | `--blueribbon-foreground` → oklch(0.4867 0.2603 266.61) / dark oklch(0.9705 0.0142 254.60) | Informative status: text and icons |
|
|
160
|
+
| `--informative-fg-alt` | `--foregrounds-primary` → oklch(0.1448 0.0000 0.00) / dark oklch(1.0000 0.0000 0.00) | Informative status: muted text and icons |
|
|
161
|
+
| `--informative-fg-inverse` | `--blueribbon-background` → oklch(0.9705 0.0142 254.60) / dark oklch(0.2795 0.0978 270.78) | Informative status: text on an inverse surface |
|
|
162
|
+
| `--important-bg` | `--electricviolet-background` → oklch(0.9761 0.0139 304.14) / dark oklch(0.2898 0.1386 301.20) | Important status: background |
|
|
163
|
+
| `--important-bg-alt` | `--electricviolet-tint` → oklch(0.9453 0.0311 306.20) / dark oklch(0.3800 0.1656 303.37) | Important status: subtle alternate background |
|
|
164
|
+
| `--important-bg-inverse` | `--electricviolet-shade` → oklch(0.4379 0.2047 302.40) / dark oklch(0.9453 0.0311 306.20) | Important status: background on an inverse surface |
|
|
165
|
+
| `--important-border` | `--electricviolet-main` → oklch(0.6255 0.2466 302.49) / dark oklch(0.7125 0.1872 304.45) | Important status: border |
|
|
166
|
+
| `--important-border-alt` | `--electricviolet-shade` → oklch(0.4379 0.2047 302.40) / dark oklch(0.9453 0.0311 306.20) | Important status: subtle border |
|
|
167
|
+
| `--important-border-inverse` | `--electricviolet-background` → oklch(0.9761 0.0139 304.14) / dark oklch(0.2898 0.1386 301.20) | Important status: border on an inverse surface |
|
|
168
|
+
| `--important-fg` | `--electricviolet-foreground` → oklch(0.4955 0.2482 300.40) / dark oklch(0.9761 0.0139 304.14) | Important status: text and icons |
|
|
169
|
+
| `--important-fg-alt` | `--foregrounds-primary` → oklch(0.1448 0.0000 0.00) / dark oklch(1.0000 0.0000 0.00) | Important status: muted text and icons |
|
|
170
|
+
| `--important-fg-inverse` | `--electricviolet-background` → oklch(0.9761 0.0139 304.14) / dark oklch(0.2898 0.1386 301.20) | Important status: text on an inverse surface |
|
|
171
|
+
| `--tooltip-bg` | `--backgrounds-primary` → oklch(1.0000 0.0000 0.00) / dark oklch(0.1448 0.0000 0.00) | Tooltip background |
|
|
172
|
+
| `--overlay-bg` | `--foregrounds-primary` → oklch(0.1448 0.0000 0.00) | Scrim behind modal overlays |
|
|
173
|
+
| `--focus-ring` | `--foregrounds-quaternary` → oklch(0.5555 0.0000 0.00) / dark oklch(0.7090 0.0000 0.00) | Keyboard focus outline; components draw it, don't restyle it |
|
|
174
|
+
| `--dataviz-1-main` | `--blazeorange-main` → oklch(0.6717 0.2205 37.86) | Charts only: series colour |
|
|
175
|
+
| `--dataviz-1-tint` | `--blazeorange-tint` → oklch(0.9479 0.0381 69.88) / dark oklch(0.4063 0.1389 34.11) | Charts only: series colour |
|
|
176
|
+
| `--dataviz-1-shade` | `--blazeorange-shade` → oklch(0.4663 0.1768 31.99) / dark oklch(0.9479 0.0381 69.88) | Charts only: series colour |
|
|
177
|
+
| `--dataviz-2-main` | `--blueribbon-main` → oklch(0.6102 0.2112 261.20) | Charts only: series colour |
|
|
178
|
+
| `--dataviz-2-tint` | `--blueribbon-tint` → oklch(0.9322 0.0328 256.76) / dark oklch(0.3775 0.1564 267.71) | Charts only: series colour |
|
|
179
|
+
| `--dataviz-2-shade` | `--blueribbon-shade` → oklch(0.4225 0.2126 267.93) / dark oklch(0.9322 0.0328 256.76) | Charts only: series colour |
|
|
180
|
+
| `--dataviz-3-main` | `--seagreen-main` → oklch(0.7780 0.1777 159.41) | Charts only: series colour |
|
|
181
|
+
| `--dataviz-3-tint` | `--seagreen-tint` → oklch(0.9488 0.0579 162.90) / dark oklch(0.3827 0.0785 166.91) | Charts only: series colour |
|
|
182
|
+
| `--dataviz-3-shade` | `--seagreen-shade` → oklch(0.4389 0.0946 163.18) / dark oklch(0.9488 0.0579 162.90) | Charts only: series colour |
|
|
183
|
+
| `--dataviz-4-main` | `--electricviolet-main` → oklch(0.6255 0.2466 302.49) / dark oklch(0.7125 0.1872 304.45) | Charts only: series colour |
|
|
184
|
+
| `--dataviz-4-tint` | `--electricviolet-tint` → oklch(0.9453 0.0311 306.20) / dark oklch(0.3800 0.1656 303.37) | Charts only: series colour |
|
|
185
|
+
| `--dataviz-4-shade` | `--electricviolet-shade` → oklch(0.4379 0.2047 302.40) / dark oklch(0.9453 0.0311 306.20) | Charts only: series colour |
|
|
186
|
+
| `--dataviz-5-main` | `--maitai-main` → oklch(0.7516 0.1455 61.95) | Charts only: series colour |
|
|
187
|
+
| `--dataviz-5-tint` | `--maitai-tint` → oklch(0.9601 0.0401 88.20) / dark oklch(0.4118 0.0860 41.58) | Charts only: series colour |
|
|
188
|
+
| `--dataviz-5-shade` | `--maitai-shade` → oklch(0.4724 0.1071 42.23) / dark oklch(0.8686 0.1177 83.38) | Charts only: series colour |
|
|
189
|
+
| `--dataviz-6-main` | `--cerise-main` → oklch(0.6521 0.2154 2.21) | Charts only: series colour |
|
|
190
|
+
| `--dataviz-6-tint` | `--cerise-tint` → oklch(0.9470 0.0251 352.47) / dark oklch(0.4086 0.1369 6.37) | Charts only: series colour |
|
|
191
|
+
| `--dataviz-6-shade` | `--cerise-shade` → oklch(0.4577 0.1664 8.23) / dark oklch(0.9470 0.0251 352.47) | Charts only: series colour |
|
|
192
|
+
| `--dataviz-7-main` | `--electriclime-main` → oklch(0.8485 0.2093 123.47) | Charts only: series colour |
|
|
193
|
+
| `--dataviz-7-tint` | `--electriclime-tint` → oklch(0.9681 0.0792 116.21) / dark oklch(0.4073 0.0978 121.11) | Charts only: series colour |
|
|
194
|
+
| `--dataviz-7-shade` | `--electriclime-shade` → oklch(0.4593 0.1121 122.51) / dark oklch(0.9681 0.0792 116.21) | Charts only: series colour |
|
|
195
|
+
| `--dataviz-8-main` | `--lochmara-main` → oklch(0.6823 0.1723 245.16) | Charts only: series colour |
|
|
196
|
+
| `--dataviz-8-tint` | `--lochmara-tint` → oklch(0.9483 0.0276 239.65) / dark oklch(0.3898 0.1005 246.39) | Charts only: series colour |
|
|
197
|
+
| `--dataviz-8-shade` | `--lochmara-shade` → oklch(0.4439 0.1218 248.78) / dark oklch(0.9483 0.0276 239.65) | Charts only: series colour |
|
|
198
|
+
<!-- tokens:end -->
|
|
199
|
+
|
|
200
|
+
## Choosing a value
|
|
201
|
+
|
|
202
|
+
| If you need… | Use |
|
|
203
|
+
| --- | --- |
|
|
204
|
+
| the page or a panel background | `--container-bg` with `--container-fg` |
|
|
205
|
+
| a subtle section background or a zebra row | `--container-bg-alt` |
|
|
206
|
+
| secondary or helper text | `--container-fg-alt` |
|
|
207
|
+
| a divider or panel border | `--container-border`; or the Separator component |
|
|
208
|
+
| an input-like or hoverable surface you compose | `--interactive-bg`, `--interactive-bg-hover`, `--interactive-fg` |
|
|
209
|
+
| an error message colour | `--destructive-fg`; or FormMessage / Banner `destructive` |
|
|
210
|
+
| a success, warning or info surface | Banner or Badge with the matching `variant` |
|
|
211
|
+
| a scrim behind an overlay | Dialog or Sheet, which set `--overlay-bg` for you |
|
|
212
|
+
| chart series colours | `--dataviz-1-main` to `--dataviz-8-main`, with `-tint` and `-shade` |
|
|
213
|
+
|
|
214
|
+
## Dos and don'ts
|
|
215
|
+
|
|
216
|
+
**Do:** pair tokens from one family.
|
|
217
|
+
|
|
218
|
+
```tsx
|
|
219
|
+
<section style={{ backgroundColor: "var(--container-bg-alt)", color: "var(--container-fg)" }}>
|
|
220
|
+
<p style={{ color: "var(--container-fg-alt)" }}>Last updated 2 hours ago</p>
|
|
221
|
+
</section>
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
**Don't:** hardcode colours or mix families.
|
|
225
|
+
|
|
226
|
+
```tsx
|
|
227
|
+
<section style={{ backgroundColor: "#f5f5f5", color: "var(--action-primary-fg)" }}>
|
|
228
|
+
<p style={{ color: "gray" }}>Last updated 2 hours ago</p>
|
|
229
|
+
</section>
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
**Do:** use the component's tone.
|
|
233
|
+
|
|
234
|
+
```tsx
|
|
235
|
+
<Badge variant="positive">Active</Badge>
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
**Don't:** recolour a component with tone tokens.
|
|
239
|
+
|
|
240
|
+
```tsx
|
|
241
|
+
<div style={{ "--action-primary-bg": "var(--positive-bg)" } as React.CSSProperties}>
|
|
242
|
+
<Badge>Active</Badge>
|
|
243
|
+
</div>
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
## Known issues
|
|
247
|
+
|
|
248
|
+
- `--interactive-bg-selected` is near-black in `minimal`. It reads well on a checkbox but heavy across a whole table row.
|
|
249
|
+
|
|
250
|
+
## Common agent mistakes
|
|
251
|
+
|
|
252
|
+
_Filled from evals._
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: elevation
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Elevation
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
Eluan has no elevation or shadow tokens yet. Depth comes from components: Card has an `elevation` prop (`none`, `sm`, `md`, `lg`), and floating surfaces (Popover, DropdownMenu, Select, Tooltip, HoverCard, Dialog, Sheet) draw their own shadow. Until tokens exist, layering is something you choose a component for, not something you style.
|
|
10
|
+
|
|
11
|
+
## Rules
|
|
12
|
+
|
|
13
|
+
1. Never write `box-shadow` in app code.
|
|
14
|
+
2. For a raised surface, use Card with `elevation`. For a floating surface, use the overlay component that fits.
|
|
15
|
+
3. Use `elevation="none"` (with the card's border) for flat layouts, and a raised level only to separate a surface from a busy background.
|
|
16
|
+
4. Never stack z-index values to layer things yourself. Overlay components portal and layer correctly; for scoped themes pass `portalContainer` (see [theming.md](./theming.md)).
|
|
17
|
+
|
|
18
|
+
## Tokens
|
|
19
|
+
|
|
20
|
+
<!-- tokens:start -->
|
|
21
|
+
| Token | Value (default theme) | Use for |
|
|
22
|
+
| --- | --- | --- |
|
|
23
|
+
| _No tokens yet_ | | Follow the rules above |
|
|
24
|
+
<!-- tokens:end -->
|
|
25
|
+
|
|
26
|
+
## Choosing a value
|
|
27
|
+
|
|
28
|
+
| If you need… | Use |
|
|
29
|
+
| --- | --- |
|
|
30
|
+
| a flat grouped surface | Card with `elevation="none"` |
|
|
31
|
+
| a surface lifted off the page | Card with `elevation="sm"` or `"md"` |
|
|
32
|
+
| a clickable card | Card with `clickable` (adds hover elevation) |
|
|
33
|
+
| content floating over the page | Popover, HoverCard, DropdownMenu or Tooltip |
|
|
34
|
+
| a blocking layer | Dialog; a side layer: Sheet |
|
|
35
|
+
|
|
36
|
+
## Dos and don'ts
|
|
37
|
+
|
|
38
|
+
**Do:** choose a component for depth.
|
|
39
|
+
|
|
40
|
+
```tsx
|
|
41
|
+
<Card elevation="md">
|
|
42
|
+
<CardHeader>
|
|
43
|
+
<CardTitle>Quarterly revenue</CardTitle>
|
|
44
|
+
</CardHeader>
|
|
45
|
+
<CardContent>Up 12% on last quarter.</CardContent>
|
|
46
|
+
</Card>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**Don't:** add your own shadow.
|
|
50
|
+
|
|
51
|
+
```tsx
|
|
52
|
+
<div style={{ boxShadow: "0 4px 12px rgba(0, 0, 0, 0.15)" }}>Quarterly revenue</div>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Common agent mistakes
|
|
56
|
+
|
|
57
|
+
_Filled from evals._
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: iconography
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Iconography
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
Eluan uses [Lucide](https://lucide.dev) icons (`lucide-react`, a dependency of `@eluan/core`). Components that need icons already render them: Input picks a leading icon from its `type`, PasswordInput has the show/hide eye, Select and Accordion have their chevrons. Icons draw with `currentColor`, so they take the colour of the text around them.
|
|
10
|
+
|
|
11
|
+
Icon boxes are sized with `--size-*` tokens, so they scale with density. Components use `--size-xxs` for icons inside controls.
|
|
12
|
+
|
|
13
|
+
## Rules
|
|
14
|
+
|
|
15
|
+
1. Use `lucide-react` icons. Don't mix in other icon sets or inline SVGs, except brand logos.
|
|
16
|
+
2. Size icons with `--size-*` tokens through the [Icon](../components/icon.md) component (`<Icon size="xxs"><Check /></Icon>`): `xxs` inside controls and text, `xs` or `sm` for standalone icons. Never use Lucide's numeric `size` prop or px values.
|
|
17
|
+
3. Let icons inherit colour. If an icon must differ from the text beside it, wrap it in `Icon` and set `tone`.
|
|
18
|
+
4. Mark decorative icons `aria-hidden="true"`.
|
|
19
|
+
5. Give every icon-only control an accessible name: `aria-label` on the Button, not on the icon.
|
|
20
|
+
6. Use Button with an `icon`, `iconSm`, `iconXs` or `iconInline` size for icon-only actions. There is no IconButton.
|
|
21
|
+
7. Don't add an icon to Input for `type="search"`, `email`, `password`, `tel` or `url`; it already shows one. Pass `icon` for a custom one or `icon={false}` to remove it; `icon={null}` keeps the automatic icon.
|
|
22
|
+
8. Brand logos: inline the SVG with `fill="currentColor"` and `fillRule="evenodd"` so cutouts stay transparent.
|
|
23
|
+
|
|
24
|
+
## Tokens
|
|
25
|
+
|
|
26
|
+
<!-- tokens:start -->
|
|
27
|
+
| Token | Value (default theme) | Use for |
|
|
28
|
+
| --- | --- | --- |
|
|
29
|
+
| `--size-xxs` | 14px (compact 12px, wide 20px) | Control height, icon size |
|
|
30
|
+
| `--size-xs` | 18px (compact 16px, wide 24px) | Control height, icon size |
|
|
31
|
+
| `--size-sm` | 22px (compact 20px, wide 32px) | Control height, icon size |
|
|
32
|
+
| `--size-md` | 28px (compact 24px, wide 40px) | Control height, icon size |
|
|
33
|
+
<!-- tokens:end -->
|
|
34
|
+
|
|
35
|
+
## Choosing a value
|
|
36
|
+
|
|
37
|
+
| If you need… | Use |
|
|
38
|
+
| --- | --- |
|
|
39
|
+
| an icon next to button or input text | `--size-xxs` |
|
|
40
|
+
| an icon-only button | Button `size="icon"` with the icon at `--size-xxs` |
|
|
41
|
+
| a small icon-only button in a dense row | Button `size="iconSm"` or `"iconXs"` |
|
|
42
|
+
| an icon inline with body text | Button `size="iconInline"` for actions; `--size-xxs` for decoration |
|
|
43
|
+
| a standalone illustrative icon (empty state) | `--size-sm` to `--size-md` |
|
|
44
|
+
|
|
45
|
+
## Dos and don'ts
|
|
46
|
+
|
|
47
|
+
**Do:** name the button and hide the icon.
|
|
48
|
+
|
|
49
|
+
```tsx
|
|
50
|
+
import { X } from "lucide-react";
|
|
51
|
+
import { Button, Icon } from "@eluan/core";
|
|
52
|
+
|
|
53
|
+
<Button variant="ghost" size="icon" aria-label="Close panel">
|
|
54
|
+
<Icon size="xxs">
|
|
55
|
+
<X />
|
|
56
|
+
</Icon>
|
|
57
|
+
</Button>;
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Don't:** leave an icon-only control unnamed or sized in px.
|
|
61
|
+
|
|
62
|
+
```tsx
|
|
63
|
+
<button onClick={close}>
|
|
64
|
+
<X size={24} color="#666" />
|
|
65
|
+
</button>
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Common agent mistakes
|
|
69
|
+
|
|
70
|
+
_Filled from evals._
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: motion
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Motion
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
Eluan has no duration or easing tokens yet. Components own their motion: state transitions (hover, press) and loading animations are built in, and some components open and close without any animation (Accordion and Collapsible content). App code shouldn't animate Eluan components, and new motion must respect `prefers-reduced-motion`.
|
|
10
|
+
|
|
11
|
+
## Rules
|
|
12
|
+
|
|
13
|
+
1. Don't add transitions or animations to Eluan components or around them. Their motion is built in.
|
|
14
|
+
2. If you must animate your own element, gate it on reduced motion: under `prefers-reduced-motion: reduce`, remove the movement or shorten it to near zero.
|
|
15
|
+
3. Never animate layout properties (width, height, top, left) on content. Animate opacity or transform.
|
|
16
|
+
4. Use Spinner or Skeleton for loading. Never build your own loading animation.
|
|
17
|
+
5. Never autoplay looping motion that the user can't pause. Carousel doesn't autoplay; keep it that way.
|
|
18
|
+
|
|
19
|
+
## Tokens
|
|
20
|
+
|
|
21
|
+
<!-- tokens:start -->
|
|
22
|
+
| Token | Value (default theme) | Use for |
|
|
23
|
+
| --- | --- | --- |
|
|
24
|
+
| _No tokens yet_ | | Follow the rules above |
|
|
25
|
+
<!-- tokens:end -->
|
|
26
|
+
|
|
27
|
+
## Choosing a value
|
|
28
|
+
|
|
29
|
+
| If you need… | Use |
|
|
30
|
+
| --- | --- |
|
|
31
|
+
| loading feedback in place | Spinner |
|
|
32
|
+
| a loading placeholder for layout | Skeleton |
|
|
33
|
+
| content that opens and closes | Accordion or Collapsible (they don't animate; don't add one) |
|
|
34
|
+
| a panel that slides in | Sheet (overlay) or Drawer (pushes content) |
|
|
35
|
+
| your own reveal animation | opacity or transform only, gated on reduced motion |
|
|
36
|
+
|
|
37
|
+
## Dos and don'ts
|
|
38
|
+
|
|
39
|
+
**Do:** open and close content with the component, as it ships.
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
<Collapsible>
|
|
43
|
+
<CollapsibleTrigger asChild>
|
|
44
|
+
<Button variant="ghost">Show details</Button>
|
|
45
|
+
</CollapsibleTrigger>
|
|
46
|
+
<CollapsibleContent>Order #4821 shipped on 12 March.</CollapsibleContent>
|
|
47
|
+
</Collapsible>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**Don't:** hand-roll a height animation.
|
|
51
|
+
|
|
52
|
+
```tsx
|
|
53
|
+
<div style={{ height: open ? 120 : 0, transition: "height 0.3s ease", overflow: "hidden" }}>
|
|
54
|
+
Order #4821 shipped on 12 March.
|
|
55
|
+
</div>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Common agent mistakes
|
|
59
|
+
|
|
60
|
+
_Filled from evals._
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: radius
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Radius
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
Corner radius comes from `--curves-*`, which the `data-curves` axis sets globally: `sharp` (square), `slight` (default) or `sweeping` (round). One Provider setting changes every corner in the product, so components and your own elements must read the tokens rather than fixed values. See [theming.md](./theming.md).
|
|
10
|
+
|
|
11
|
+
## Rules
|
|
12
|
+
|
|
13
|
+
1. Use `--curves-*` for every corner. Never write a radius in px, rem or %.
|
|
14
|
+
2. To make the whole product rounder or sharper, change `defaultCurves` on `EluanProvider`. Never override `--curves-*` values.
|
|
15
|
+
3. Use `--radius-radius-full` only for pills and circles (avatars, status dots, switches).
|
|
16
|
+
4. Nest smaller inside larger: an element inside a `--curves-lg` card uses `--curves-md` or smaller.
|
|
17
|
+
5. Don't restyle a component's corners. Components already use the right step.
|
|
18
|
+
|
|
19
|
+
## Tokens
|
|
20
|
+
|
|
21
|
+
<!-- tokens:start -->
|
|
22
|
+
| Token | Value (default theme) | Use for |
|
|
23
|
+
| --- | --- | --- |
|
|
24
|
+
| `--curves-xxs` | 1px (sharp 0px, sweeping 2px) | Corner radius |
|
|
25
|
+
| `--curves-xs` | 2px (sharp 0px, sweeping 4px) | Corner radius |
|
|
26
|
+
| `--curves-sm` | 4px (sharp 0px, sweeping 8px) | Corner radius |
|
|
27
|
+
| `--curves-md` | 8px (sharp 0px, sweeping 12px) | Corner radius |
|
|
28
|
+
| `--curves-lg` | 12px (sharp 0px, sweeping 16px) | Corner radius |
|
|
29
|
+
| `--curves-xl` | 16px (sharp 0px, sweeping 24px) | Corner radius |
|
|
30
|
+
| `--radius-radius-full` | 999px | Pills and circles only |
|
|
31
|
+
<!-- tokens:end -->
|
|
32
|
+
|
|
33
|
+
## Choosing a value
|
|
34
|
+
|
|
35
|
+
| If you need… | Use |
|
|
36
|
+
| --- | --- |
|
|
37
|
+
| a card, panel or fieldset you compose | `--curves-lg`, as Card and Fieldset use |
|
|
38
|
+
| a popover-sized surface or an input-sized element | `--curves-md`, as Popover and Button use |
|
|
39
|
+
| a small inner element (tag, close button, inline code) | `--curves-sm` |
|
|
40
|
+
| a pill or a circle | `--radius-radius-full` |
|
|
41
|
+
| rounder corners everywhere | `defaultCurves="sweeping"` |
|
|
42
|
+
|
|
43
|
+
## Dos and don'ts
|
|
44
|
+
|
|
45
|
+
**Do:** use the curves tokens and nest down a step.
|
|
46
|
+
|
|
47
|
+
```tsx
|
|
48
|
+
<div style={{ borderRadius: "var(--curves-lg)", padding: "var(--spacing-lg)" }}>
|
|
49
|
+
<img src="/cover.png" alt="" style={{ borderRadius: "var(--curves-md)", width: "100%" }} />
|
|
50
|
+
</div>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**Don't:** hardcode a radius or override the axis.
|
|
54
|
+
|
|
55
|
+
```tsx
|
|
56
|
+
<div style={{ borderRadius: 12, "--curves-md": "20px" } as React.CSSProperties} />
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Common agent mistakes
|
|
60
|
+
|
|
61
|
+
_Filled from evals._
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spacing
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Spacing
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
Two density-aware scales control space and size. `--spacing-*` is for gaps, padding and margins. `--size-*` is for fixed dimensions: control heights, icon boxes, avatars. Both change with the `data-spacing` axis (`compact`, `standard`, `wide`), so a layout built on them re-densifies with one Provider setting. See [theming.md](./theming.md).
|
|
10
|
+
|
|
11
|
+
Steps run `xxs`, `xs`, `sm`, `md`, `lg`, `xl`, `2xl`, `3xl`, `4xl`.
|
|
12
|
+
|
|
13
|
+
## Rules
|
|
14
|
+
|
|
15
|
+
1. Use `--spacing-*` for every margin, padding and gap.
|
|
16
|
+
2. Use `--size-*` for fixed widths and heights of small things: icons, avatars, control heights.
|
|
17
|
+
3. Never write px, rem or em for space or size.
|
|
18
|
+
4. Prefer `gap` on a parent over margins on children. [Stack](../components/stack.md), [Row](../components/row.md) and [Grid](../components/grid.md) take these steps by name: `gap="md"`, `pad="xl"`.
|
|
19
|
+
5. Never use `--spacing-xxs` for a border or line: it is 0 in compact density. Use a border token or the Separator component.
|
|
20
|
+
6. Never divide or multiply spacing tokens with `calc()` to invent a new step. Pick the nearest step.
|
|
21
|
+
7. Don't pad inside components. Card, Dialog, Fieldset and Popover already pad their content.
|
|
22
|
+
|
|
23
|
+
## Tokens
|
|
24
|
+
|
|
25
|
+
<!-- tokens:start -->
|
|
26
|
+
| Token | Value (default theme) | Use for |
|
|
27
|
+
| --- | --- | --- |
|
|
28
|
+
| `--spacing-xxs` | 2px (compact 0px, wide 4px) | Gap, padding, margin |
|
|
29
|
+
| `--spacing-xs` | 4px (compact 2px, wide 8px) | Gap, padding, margin |
|
|
30
|
+
| `--spacing-sm` | 6px (compact 4px, wide 12px) | Gap, padding, margin |
|
|
31
|
+
| `--spacing-md` | 10px (compact 8px, wide 16px) | Gap, padding, margin |
|
|
32
|
+
| `--spacing-lg` | 14px (compact 12px, wide 20px) | Gap, padding, margin |
|
|
33
|
+
| `--spacing-xl` | 18px (compact 16px, wide 24px) | Gap, padding, margin |
|
|
34
|
+
| `--spacing-2xl` | 20px (compact 20px, wide 32px) | Gap, padding, margin |
|
|
35
|
+
| `--spacing-3xl` | 32px (compact 24px, wide 80px) | Gap, padding, margin |
|
|
36
|
+
| `--spacing-4xl` | 64px (compact 32px, wide 160px) | Gap, padding, margin |
|
|
37
|
+
| `--size-xxs` | 14px (compact 12px, wide 20px) | Control height, icon size |
|
|
38
|
+
| `--size-xs` | 18px (compact 16px, wide 24px) | Control height, icon size |
|
|
39
|
+
| `--size-sm` | 22px (compact 20px, wide 32px) | Control height, icon size |
|
|
40
|
+
| `--size-md` | 28px (compact 24px, wide 40px) | Control height, icon size |
|
|
41
|
+
| `--size-lg` | 36px (compact 32px, wide 48px) | Control height, icon size |
|
|
42
|
+
| `--size-xl` | 44px (compact 40px, wide 56px) | Control height, icon size |
|
|
43
|
+
| `--size-2xl` | 56px (compact 48px, wide 80px) | Control height, icon size |
|
|
44
|
+
| `--size-3xl` | 80px (compact 64px, wide 120px) | Control height, icon size |
|
|
45
|
+
| `--size-4xl` | 120px (compact 96px, wide 240px) | Control height, icon size |
|
|
46
|
+
<!-- tokens:end -->
|
|
47
|
+
|
|
48
|
+
## Choosing a value
|
|
49
|
+
|
|
50
|
+
Component values come from the component source; page-level values are drafts.
|
|
51
|
+
|
|
52
|
+
| If you need… | Use |
|
|
53
|
+
| --- | --- |
|
|
54
|
+
| space between a label, its input and its message | `--spacing-sm` on your field stack |
|
|
55
|
+
| space between fields in a group | `--spacing-lg`, as Fieldset uses |
|
|
56
|
+
| padding inside a card | Card handles it (`--spacing-2xl`) |
|
|
57
|
+
| padding inside a dialog or sheet | Dialog and Sheet handle it (`--spacing-lg`) |
|
|
58
|
+
| space between inline items (icon and text, buttons in a row) | `--spacing-xs` to `--spacing-sm` |
|
|
59
|
+
| space between sections of a page | `--spacing-3xl` |
|
|
60
|
+
| page gutter | `--spacing-xl` |
|
|
61
|
+
| an icon box inside a control | `--size-xxs` |
|
|
62
|
+
| a standard control height | the component sets it (`--size-lg` default, `--size-md` small, `--size-xl` large) |
|
|
63
|
+
|
|
64
|
+
## Dos and don'ts
|
|
65
|
+
|
|
66
|
+
**Do:** space with gap and tokens.
|
|
67
|
+
|
|
68
|
+
```tsx
|
|
69
|
+
<div style={{ display: "flex", flexDirection: "column", gap: "var(--spacing-lg)" }}>
|
|
70
|
+
<Input aria-label="Email" type="email" />
|
|
71
|
+
<Input aria-label="Password" type="password" />
|
|
72
|
+
</div>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**Don't:** use raw values or margins on each child.
|
|
76
|
+
|
|
77
|
+
```tsx
|
|
78
|
+
<div>
|
|
79
|
+
<div style={{ marginBottom: 16 }}><Input aria-label="Email" type="email" /></div>
|
|
80
|
+
<div style={{ marginBottom: "1rem" }}><Input aria-label="Password" type="password" /></div>
|
|
81
|
+
</div>
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
**Do:** draw a divider with the Separator component.
|
|
85
|
+
|
|
86
|
+
```tsx
|
|
87
|
+
<Separator />
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
**Don't:** make a line out of a spacing token.
|
|
91
|
+
|
|
92
|
+
```tsx
|
|
93
|
+
<div style={{ height: "var(--spacing-xxs)", backgroundColor: "var(--container-border)" }} />
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Common agent mistakes
|
|
97
|
+
|
|
98
|
+
_Filled from evals._
|