@cube-dev/ui-kit 0.0.0-canary-0202feb → 0.0.0-canary-ace121b
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/dist/_internal/hooks/use-debounced-value.js +1 -1
- package/dist/_internal/hooks/use-deprecation-warning.js +1 -1
- package/dist/_internal/hooks/use-event.js +1 -1
- package/dist/_internal/hooks/use-is-first-render.js +1 -1
- package/dist/_internal/hooks/use-sync-ref.js +1 -1
- package/dist/_internal/hooks/use-timer/timer.js +1 -1
- package/dist/_internal/hooks/use-timer/use-timer.js +1 -1
- package/dist/_internal/hooks/use-warn.js +1 -1
- package/dist/components/Block.js +1 -1
- package/dist/components/CollectionItem.js +1 -1
- package/dist/components/GlobalStyles.js +1 -1
- package/dist/components/GridProvider.js +1 -1
- package/dist/components/HiddenInput.js +1 -1
- package/dist/components/Root.js +1 -1
- package/dist/components/actions/Action/Action.js +1 -1
- package/dist/components/actions/Banner/Banner.js +1 -1
- package/dist/components/actions/Button/Button.js +1 -1
- package/dist/components/actions/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/components/actions/ButtonSplit/ButtonSplit.js +1 -1
- package/dist/components/actions/ButtonSplit/context.js +1 -1
- package/dist/components/actions/CommandMenu/CommandMenu.js +1 -1
- package/dist/components/actions/CommandMenu/styled.js +1 -1
- package/dist/components/actions/ItemAction/ItemAction.js +1 -1
- package/dist/components/actions/ItemActionContext.js +1 -1
- package/dist/components/actions/ItemActionsWrapper.js +1 -1
- package/dist/components/actions/ItemButton/ItemButton.js +1 -1
- package/dist/components/actions/Link/Link.js +1 -1
- package/dist/components/actions/Menu/Menu.js +1 -1
- package/dist/components/actions/Menu/MenuCollectionItem.js +1 -1
- package/dist/components/actions/Menu/MenuItem.js +1 -1
- package/dist/components/actions/Menu/MenuSection.js +1 -1
- package/dist/components/actions/Menu/MenuTrigger.js +1 -1
- package/dist/components/actions/Menu/SubMenuTrigger.js +1 -1
- package/dist/components/actions/Menu/SubmenuTriggerContext.js +1 -1
- package/dist/components/actions/Menu/context.js +1 -1
- package/dist/components/actions/Menu/styled.js +1 -1
- package/dist/components/actions/actions-run.js +1 -1
- package/dist/components/actions/index.js +1 -1
- package/dist/components/actions/use-action.js +1 -1
- package/dist/components/actions/use-anchored-menu.js +1 -1
- package/dist/components/actions/use-context-menu.js +1 -1
- package/dist/components/content/ActiveZone/ActiveZone.js +1 -1
- package/dist/components/content/Alert/Alert.js +1 -1
- package/dist/components/content/Alert/use-alert.js +1 -1
- package/dist/components/content/Avatar/Avatar.js +1 -1
- package/dist/components/content/Badge/Badge.js +1 -1
- package/dist/components/content/Card/Card.js +1 -1
- package/dist/components/content/Content.js +1 -1
- package/dist/components/content/CopyPasteBlock/CopyPasteBlock.js +1 -1
- package/dist/components/content/CopySnippet/CopySnippet.js +1 -1
- package/dist/components/content/Disclosure/Disclosure.js +1 -1
- package/dist/components/content/Divider/Divider.js +1 -1
- package/dist/components/content/Footer.js +1 -1
- package/dist/components/content/Header.js +1 -1
- package/dist/components/content/HotKeys/HotKeys.js +1 -1
- package/dist/components/content/InfoBadge/InfoBadge.js +1 -1
- package/dist/components/content/InlineInput/InlineInput.js +1 -1
- package/dist/components/content/Item/Item.js +1 -1
- package/dist/components/content/Item/ItemWithNativeLinks.js +1 -1
- package/dist/components/content/ItemBadge/ItemBadge.js +1 -1
- package/dist/components/content/ItemCard/ItemCard.js +1 -1
- package/dist/components/content/Layout/GridLayout.js +1 -1
- package/dist/components/content/Layout/Layout.js +1 -1
- package/dist/components/content/Layout/LayoutBlock.js +1 -1
- package/dist/components/content/Layout/LayoutCenter.js +1 -1
- package/dist/components/content/Layout/LayoutContainer.js +1 -1
- package/dist/components/content/Layout/LayoutContent.js +1 -1
- package/dist/components/content/Layout/LayoutContext.js +1 -1
- package/dist/components/content/Layout/LayoutFlex.js +1 -1
- package/dist/components/content/Layout/LayoutFooter.js +1 -1
- package/dist/components/content/Layout/LayoutGrid.js +1 -1
- package/dist/components/content/Layout/LayoutHeader.js +1 -1
- package/dist/components/content/Layout/LayoutPane.js +1 -1
- package/dist/components/content/Layout/LayoutPanel.js +1 -1
- package/dist/components/content/Layout/LayoutPanelHeader.js +1 -1
- package/dist/components/content/Layout/LayoutPanelTransition.js +1 -1
- package/dist/components/content/Layout/LayoutToolbar.js +1 -1
- package/dist/components/content/Layout/hooks/useTinyScrollbar.js +1 -1
- package/dist/components/content/Layout/index.js +1 -1
- package/dist/components/content/Layout/utils.js +1 -1
- package/dist/components/content/Paragraph.js +1 -1
- package/dist/components/content/Placeholder/Placeholder.js +1 -1
- package/dist/components/content/PrismCode/PrismCode.js +1 -1
- package/dist/components/content/PrismCode/prismSetup.js +1 -1
- package/dist/components/content/PrismDiffCode/PrismDiffCode.js +1 -1
- package/dist/components/content/Result/Result.js +1 -1
- package/dist/components/content/Skeleton/Skeleton.js +1 -1
- package/dist/components/content/Tag/Tag.js +1 -1
- package/dist/components/content/Text.js +1 -1
- package/dist/components/content/TextItem/TextItem.js +1 -1
- package/dist/components/content/Title.js +1 -1
- package/dist/components/content/Tree/Tree.js +1 -1
- package/dist/components/content/Tree/TreeNode.js +1 -1
- package/dist/components/content/Tree/checked-keys.js +1 -1
- package/dist/components/content/Tree/rowId.js +1 -1
- package/dist/components/content/Tree/styled.js +1 -1
- package/dist/components/content/Tree/tree-index.js +1 -1
- package/dist/components/content/Tree/use-checkbox-tree.js +1 -1
- package/dist/components/content/Tree/use-load-data.js +1 -1
- package/dist/components/content/highlightText.js +1 -1
- package/dist/components/content/use-auto-tooltip.js +1 -1
- package/dist/components/data/DataTable/DataTable.js +1 -1
- package/dist/components/data/ItemTable/ItemTable.js +1 -1
- package/dist/components/data/ItemTable/ItemTableBulkBar.js +1 -1
- package/dist/components/data/ItemTable/ItemTableDragPreview.js +1 -1
- package/dist/components/data/ItemTable/ItemTableFooter.js +1 -1
- package/dist/components/data/ItemTable/ItemTableToolbar.js +1 -1
- package/dist/components/data/ItemTable/item-table-sections.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-column-widths.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-drag-drop.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-pagination.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-selection.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-sort.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-tree-model.js +1 -1
- package/dist/components/data/TableBase/ColumnResizer.js +1 -1
- package/dist/components/data/TableBase/RowCollection.js +1 -1
- package/dist/components/data/TableBase/TableHeaderCell.js +1 -1
- package/dist/components/data/TableBase/TableRow.js +1 -1
- package/dist/components/data/TableBase/TableRowLink.js +1 -1
- package/dist/components/data/TableBase/TableView.js +1 -1
- package/dist/components/data/TableBase/TreeGridTable.js +1 -1
- package/dist/components/data/TableBase/column-header.js +1 -1
- package/dist/components/data/TableBase/column-menu.js +1 -1
- package/dist/components/data/TableBase/column-styles.js +1 -1
- package/dist/components/data/TableBase/column-tint.js +1 -1
- package/dist/components/data/TableBase/row-menu.js +1 -1
- package/dist/components/data/TableBase/styled.js +1 -1
- package/dist/components/data/TableBase/table-body-sections.js +1 -1
- package/dist/components/data/TableBase/table-tree.js +1 -1
- package/dist/components/data/TableBase/types.js +1 -1
- package/dist/components/data/TableBase/use-cell-selection.js +0 -0
- package/dist/components/data/TableBase/use-column-menu.js +1 -1
- package/dist/components/data/TableBase/use-column-order.js +1 -1
- package/dist/components/data/TableBase/use-column-window.js +1 -1
- package/dist/components/data/TableBase/use-container-width.js +1 -1
- package/dist/components/data/TableBase/use-row-move-animation.js +1 -1
- package/dist/components/data/TableBase/use-scrollability.js +1 -1
- package/dist/components/data/TableBase/use-table-columns.js +1 -1
- package/dist/components/data/TableBase/use-table-search.js +1 -1
- package/dist/components/data/TableBase/use-table-selection.js +1 -1
- package/dist/components/data/TableBase/use-table-sort.js +1 -1
- package/dist/components/data/TableBase/use-table-sorts.js +1 -1
- package/dist/components/data/TableBase/use-table-storage.js +1 -1
- package/dist/components/data/TableBase/use-table-tooltip-refresh.js +1 -1
- package/dist/components/data/TableBase/use-table-tree-state.js +1 -1
- package/dist/components/fields/Checkbox/Checkbox.js +1 -1
- package/dist/components/fields/Checkbox/CheckboxGroup.js +1 -1
- package/dist/components/fields/Checkbox/context.js +1 -1
- package/dist/components/fields/ColorInput/ColorInput.js +1 -1
- package/dist/components/fields/ColorPicker/ColorPicker.js +1 -1
- package/dist/components/fields/ColorSwatch/ColorSwatch.js +1 -1
- package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js +1 -1
- package/dist/components/fields/ComboBox/ComboBox.js +1 -1
- package/dist/components/fields/ComboBox/comboBoxOptions.js +1 -1
- package/dist/components/fields/CommandTextArea/CommandTextArea.js +1 -1
- package/dist/components/fields/CommandTextArea/caretPosition.js +1 -1
- package/dist/components/fields/CommandTextArea/useCaretAnchor.js +1 -1
- package/dist/components/fields/DatePicker/CalendarPopover.js +1 -1
- package/dist/components/fields/DatePicker/DateInput.js +1 -1
- package/dist/components/fields/DatePicker/DateInputBase.js +1 -1
- package/dist/components/fields/DatePicker/DatePicker.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerButton.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerElement.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerInput.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerSegment.js +1 -1
- package/dist/components/fields/DatePicker/DateRangePicker.js +1 -1
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js +1 -1
- package/dist/components/fields/DatePicker/MonthPicker.js +1 -1
- package/dist/components/fields/DatePicker/PeriodPicker.js +1 -1
- package/dist/components/fields/DatePicker/QuarterPicker.js +1 -1
- package/dist/components/fields/DatePicker/TimeInput.js +1 -1
- package/dist/components/fields/DatePicker/WeekPicker.js +1 -1
- package/dist/components/fields/DatePicker/YearPicker.js +1 -1
- package/dist/components/fields/DatePicker/parseDate.js +1 -1
- package/dist/components/fields/DatePicker/period.js +1 -1
- package/dist/components/fields/DatePicker/props.js +1 -1
- package/dist/components/fields/DatePicker/utils.js +1 -1
- package/dist/components/fields/FileInput/FileInput.js +1 -2
- package/dist/components/fields/FileInput/FileInput.js.map +1 -1
- package/dist/components/fields/FilterListBox/FilterListBox.js +1 -1
- package/dist/components/fields/FilterListBox/styled.js +1 -1
- package/dist/components/fields/FilterPicker/FilterPicker.js +1 -1
- package/dist/components/fields/FilterPicker/FilterTree.js +1 -1
- package/dist/components/fields/Input/Input.js +1 -1
- package/dist/components/fields/ListBox/DraggableListBox.js +1 -1
- package/dist/components/fields/ListBox/ListBox.js +1 -1
- package/dist/components/fields/ListBox/optionId.js +1 -1
- package/dist/components/fields/ListBoxPopover/ListBoxPopover.js +1 -1
- package/dist/components/fields/ListBoxPopover/listNavigation.js +1 -1
- package/dist/components/fields/ListBoxPopover/useCompositeFocus.js +1 -1
- package/dist/components/fields/NumberInput/NumberInput.js +1 -1
- package/dist/components/fields/NumberInput/StepButton.js +1 -1
- package/dist/components/fields/PasswordInput/PasswordInput.js +1 -1
- package/dist/components/fields/Picker/Picker.js +1 -1
- package/dist/components/fields/RadioGroup/Radio.js +1 -1
- package/dist/components/fields/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/fields/RadioGroup/context.js +1 -1
- package/dist/components/fields/SearchComboBox/SearchComboBox.js +1 -1
- package/dist/components/fields/SearchInput/SearchInput.js +1 -1
- package/dist/components/fields/Select/Select.js +1 -1
- package/dist/components/fields/Slider/Gradation.js +1 -1
- package/dist/components/fields/Slider/HueSlider.js +1 -1
- package/dist/components/fields/Slider/RangeSlider.js +1 -1
- package/dist/components/fields/Slider/Slider.js +1 -1
- package/dist/components/fields/Slider/SliderBase.js +1 -1
- package/dist/components/fields/Slider/SliderThumb.js +1 -1
- package/dist/components/fields/Slider/SliderTrack.js +1 -1
- package/dist/components/fields/Slider/elements.js +1 -1
- package/dist/components/fields/Slider/index.js +1 -1
- package/dist/components/fields/Switch/Switch.js +1 -1
- package/dist/components/fields/TagInput/TagInput.js +1 -1
- package/dist/components/fields/TagInput/TagList.js +1 -1
- package/dist/components/fields/TagInput/useActiveOption.js +1 -1
- package/dist/components/fields/TagInput/useTagError.js +1 -1
- package/dist/components/fields/TextArea/TextArea.js +1 -1
- package/dist/components/fields/TextInput/TextInput.js +1 -1
- package/dist/components/fields/TextInput/TextInputBase.js +1 -1
- package/dist/components/fields/TextInput/displayed-validation.js +1 -1
- package/dist/components/fields/TextInput/useAutoSizeTextArea.js +1 -1
- package/dist/components/fields/TextInputMapper/TextInputMapper.js +1 -1
- package/dist/components/fields/TriggerActions.js +1 -1
- package/dist/components/fields/color/ColorPanel.js +1 -1
- package/dist/components/fields/color/channels.js +1 -1
- package/dist/components/fields/color/color.js +1 -1
- package/dist/components/fields/color/context.js +1 -1
- package/dist/components/fields/option-origin-press.js +1 -1
- package/dist/components/form/FieldWrapper/FieldWrapper.js +1 -1
- package/dist/components/form/FieldWrapper/field-description.js +1 -1
- package/dist/components/form/Form/Field.js +1 -1
- package/dist/components/form/Form/Form.js +1 -1
- package/dist/components/form/Form/ModernFormRoot.js +1 -1
- package/dist/components/form/Form/ResetButton/ResetButton.js +1 -1
- package/dist/components/form/Form/SubmitButton/SubmitButton.js +1 -1
- package/dist/components/form/Form/SubmitError.js +1 -1
- package/dist/components/form/Form/backend.js +1 -1
- package/dist/components/form/Form/index.js +1 -1
- package/dist/components/form/Form/modern/actions.js +1 -1
- package/dist/components/form/Form/modern/context.js +1 -1
- package/dist/components/form/Form/modern/controller.js +1 -1
- package/dist/components/form/Form/modern/field-binding.js +1 -1
- package/dist/components/form/Form/modern/field.js +1 -1
- package/dist/components/form/Form/modern/react.js +1 -1
- package/dist/components/form/Form/modern/store.js +1 -1
- package/dist/components/form/Form/modern/validation.js +1 -1
- package/dist/components/form/Form/modern/values.js +1 -1
- package/dist/components/form/Form/reset-unbound-controls.js +1 -1
- package/dist/components/form/Form/use-field/use-field-binding.js +1 -1
- package/dist/components/form/Form/use-field/use-field-props.js +1 -1
- package/dist/components/form/Form/use-field/use-field.js +1 -1
- package/dist/components/form/Form/use-form.js +1 -1
- package/dist/components/form/Form/validation.js +1 -1
- package/dist/components/form/Label.js +1 -1
- package/dist/components/form/field-chrome.js +1 -1
- package/dist/components/form/field-layout.js +1 -1
- package/dist/components/form/legacy-tooltip.js +1 -1
- package/dist/components/form/validation/ValidationIndicator.js +1 -1
- package/dist/components/form/validation/resolve-validation-props.js +1 -1
- package/dist/components/form/validation/use-validation-props.js +1 -1
- package/dist/components/form/wrapper.js +1 -1
- package/dist/components/helpers/DisplayTransition/DisplayTransition.js +1 -1
- package/dist/components/helpers/IconSwitch/IconSwitch.js +1 -1
- package/dist/components/layout/Flex.js +1 -1
- package/dist/components/layout/Flow.js +1 -1
- package/dist/components/layout/Grid.js +1 -1
- package/dist/components/layout/Panel.js +1 -1
- package/dist/components/layout/Prefix.js +1 -1
- package/dist/components/layout/ResizablePanel.js +1 -1
- package/dist/components/layout/Space.js +1 -1
- package/dist/components/layout/Suffix.js +1 -1
- package/dist/components/navigation/Pagination/Pagination.js +1 -1
- package/dist/components/navigation/Pagination/use-pagination.js +1 -1
- package/dist/components/navigation/Tabs/BoardDragActiveProvider.js +1 -1
- package/dist/components/navigation/Tabs/DraggableTabList.js +1 -1
- package/dist/components/navigation/Tabs/TabButton.js +1 -1
- package/dist/components/navigation/Tabs/TabDropIndicator.js +1 -1
- package/dist/components/navigation/Tabs/TabPanel.js +1 -1
- package/dist/components/navigation/Tabs/TabPicker.js +1 -1
- package/dist/components/navigation/Tabs/Tabs.js +1 -1
- package/dist/components/navigation/Tabs/TabsAction.js +1 -1
- package/dist/components/navigation/Tabs/TabsContext.js +1 -1
- package/dist/components/navigation/Tabs/popover-placement.js +1 -1
- package/dist/components/navigation/Tabs/segmented-styles.js +1 -1
- package/dist/components/navigation/Tabs/styled.js +1 -1
- package/dist/components/navigation/Tabs/types.js +1 -1
- package/dist/components/navigation/Tabs/use-tab-editing.js +1 -1
- package/dist/components/navigation/Tabs/use-tab-indicator.js +1 -1
- package/dist/components/organisms/StatsCard/StatsCard.js +1 -1
- package/dist/components/other/Calendar/Calendar.js +1 -1
- package/dist/components/other/Calendar/CalendarCell.js +1 -1
- package/dist/components/other/Calendar/CalendarGrid.js +1 -1
- package/dist/components/other/Calendar/CalendarHeader.js +1 -1
- package/dist/components/other/Calendar/CalendarPanel.js +1 -1
- package/dist/components/other/Calendar/PeriodCalendar.js +1 -1
- package/dist/components/other/Calendar/PeriodGrid.js +1 -1
- package/dist/components/other/Calendar/RangeCalendar.js +1 -1
- package/dist/components/other/Calendar/styled.js +1 -1
- package/dist/components/other/CubeLogo/CubeLogo.js +1 -1
- package/dist/components/other/NoDataIcon/NoDataIcon.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialog.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogApiProvider.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogZone.js +1 -1
- package/dist/components/overlays/Dialog/Dialog.js +1 -1
- package/dist/components/overlays/Dialog/DialogContainer.js +1 -1
- package/dist/components/overlays/Dialog/DialogForm.js +1 -1
- package/dist/components/overlays/Dialog/DialogTrigger.js +1 -1
- package/dist/components/overlays/Dialog/ModernDialogForm.js +1 -1
- package/dist/components/overlays/Dialog/context.js +1 -1
- package/dist/components/overlays/Dialog/default-button-text.js +1 -1
- package/dist/components/overlays/Dialog/use-content-overflow.js +1 -1
- package/dist/components/overlays/Dialog/use-dialog-container.js +1 -1
- package/dist/components/overlays/Dialog/use-dialog-open-sync.js +1 -1
- package/dist/components/overlays/Dialog/use-dismiss-confirmation.js +1 -1
- package/dist/components/overlays/Dialog/use-retained-dialog-focus.js +1 -1
- package/dist/components/overlays/Modal/Modal.js +1 -1
- package/dist/components/overlays/Modal/OpenTransitionContext.js +1 -1
- package/dist/components/overlays/Modal/Overlay.js +1 -1
- package/dist/components/overlays/Modal/Popover.js +1 -1
- package/dist/components/overlays/Modal/Tray.js +1 -1
- package/dist/components/overlays/Modal/Underlay.js +1 -1
- package/dist/components/overlays/Modal/modal-containment.js +1 -1
- package/dist/components/overlays/Notifications/Notification.js +1 -1
- package/dist/components/overlays/Notifications/NotificationAction.js +1 -1
- package/dist/components/overlays/Notifications/NotificationCard.js +1 -1
- package/dist/components/overlays/Notifications/NotificationContext.js +1 -1
- package/dist/components/overlays/Notifications/NotificationItem.js +1 -1
- package/dist/components/overlays/Notifications/OverlayContainer.js +1 -1
- package/dist/components/overlays/Notifications/OverlayProvider.js +1 -1
- package/dist/components/overlays/Notifications/PersistentNotificationsList.js +1 -1
- package/dist/components/overlays/Notifications/dismissed-storage.js +1 -1
- package/dist/components/overlays/Notifications/format-relative-time.js +1 -1
- package/dist/components/overlays/Notifications/index.js +1 -1
- package/dist/components/overlays/Notifications/use-notification-state.js +1 -1
- package/dist/components/overlays/Notifications/use-notifications.js +1 -1
- package/dist/components/overlays/Notifications/use-overlay-timers.js +1 -1
- package/dist/components/overlays/Notifications/use-persistent-notifications.js +1 -1
- package/dist/components/overlays/Notifications/use-persistent-state.js +1 -1
- package/dist/components/overlays/Notifications/use-toast-state.js +1 -1
- package/dist/components/overlays/Toast/ToastItem.js +1 -1
- package/dist/components/overlays/Toast/index.js +1 -1
- package/dist/components/overlays/Toast/useProgressToast.js +1 -1
- package/dist/components/overlays/Toast/useToast.js +1 -1
- package/dist/components/overlays/Tooltip/Tooltip.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipProvider.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipTrigger.js +1 -1
- package/dist/components/overlays/Tooltip/context.js +1 -1
- package/dist/components/overlays/Tooltip/split-trigger-props.js +1 -1
- package/dist/components/portal/Portal.js +1 -1
- package/dist/components/portal/PortalProvider.js +1 -1
- package/dist/components/portal/usePortal.js +1 -1
- package/dist/components/shared/DraggableCollection.js +1 -1
- package/dist/components/shared/InvalidIcon.js +1 -1
- package/dist/components/shared/ValidIcon.js +1 -1
- package/dist/components/status/LoadingAnimation/LoadingAnimation.js +1 -1
- package/dist/components/status/Spin/Cube.js +1 -1
- package/dist/components/status/Spin/InternalSpinner.js +1 -1
- package/dist/components/status/Spin/Spin.js +1 -1
- package/dist/components/status/Spin/SpinsContainer.js +1 -1
- package/dist/data/item-themes.js +1 -1
- package/dist/data/themes.js +1 -1
- package/dist/eslint-plugin/defaults.generated.js +1 -1
- package/dist/eslint-plugin/index.js +1 -1
- package/dist/eslint-plugin/rules/no-redundant-default-prop.js +1 -1
- package/dist/i18n/I18nProvider.js +1 -1
- package/dist/i18n/createFormatter.js +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/i18n/instance.js +1 -1
- package/dist/i18n/locales/de-DE/uikit.js +1 -1
- package/dist/i18n/locales/en-US/uikit.js +1 -1
- package/dist/i18n/locales/es-ES/uikit.js +1 -1
- package/dist/i18n/locales/es-MX/uikit.js +1 -1
- package/dist/i18n/locales/fr-FR/uikit.js +1 -1
- package/dist/i18n/locales/it-IT/uikit.js +1 -1
- package/dist/i18n/locales/ja-JP/uikit.js +1 -1
- package/dist/i18n/locales/nb-NO/uikit.js +1 -1
- package/dist/i18n/locales/pt-BR/uikit.js +1 -1
- package/dist/i18n/locales/pt-PT/uikit.js +1 -1
- package/dist/i18n/locales/sv-SE/uikit.js +1 -1
- package/dist/i18n/locales/vi-VN/uikit.js +1 -1
- package/dist/i18n/locales.js +1 -1
- package/dist/i18n/namespace.js +1 -1
- package/dist/i18n/useFormatter.js +1 -1
- package/dist/i18n/useI18n.js +1 -1
- package/dist/icons/AdjustmentsHorizontalIcon.js +1 -1
- package/dist/icons/AdjustmentsIcon.js +1 -1
- package/dist/icons/AiIcon.js +1 -1
- package/dist/icons/AreaChartIcon.js +1 -1
- package/dist/icons/ArrowNarrowDownIcon.js +1 -1
- package/dist/icons/ArrowNarrowUpIcon.js +1 -1
- package/dist/icons/BackwardIcon.js +1 -1
- package/dist/icons/BarChartIcon.js +1 -1
- package/dist/icons/BellFilledIcon.js +1 -1
- package/dist/icons/BellIcon.js +1 -1
- package/dist/icons/BooleanIcon.js +1 -1
- package/dist/icons/CalendarEditIcon.js +1 -1
- package/dist/icons/CalendarIcon.js +1 -1
- package/dist/icons/CaretDownIcon.js +1 -1
- package/dist/icons/CaretUpIcon.js +1 -1
- package/dist/icons/ChartAreaStackedIcon.js +1 -1
- package/dist/icons/ChartAreaStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBarGroupedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarGroupedIcon.js +1 -1
- package/dist/icons/ChartBarHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarLineIcon.js +1 -1
- package/dist/icons/ChartBarStackedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBoxPlot2Icon.js +1 -1
- package/dist/icons/ChartBoxPlotIcon.js +1 -1
- package/dist/icons/ChartBubbleIcon.js +1 -1
- package/dist/icons/ChartDonut2Icon.js +1 -1
- package/dist/icons/ChartFunnelIcon.js +1 -1
- package/dist/icons/ChartHeatmapIcon.js +1 -1
- package/dist/icons/ChartKPIIcon.js +1 -1
- package/dist/icons/ChartPie2Icon.js +1 -1
- package/dist/icons/ChartScatterIcon.js +1 -1
- package/dist/icons/CheckCircleFilledIcon.js +1 -1
- package/dist/icons/CheckCircleIcon.js +1 -1
- package/dist/icons/CheckIcon.js +1 -1
- package/dist/icons/CircleFilledIcon.js +1 -1
- package/dist/icons/ClearIcon.js +1 -1
- package/dist/icons/CloseCircleFilledIcon.js +1 -1
- package/dist/icons/CloseCircleIcon.js +1 -1
- package/dist/icons/CloseIcon.js +1 -1
- package/dist/icons/CodeIcon.js +1 -1
- package/dist/icons/ColumnTotalIcon.js +1 -1
- package/dist/icons/CopyIcon.js +1 -1
- package/dist/icons/CountIcon.js +1 -1
- package/dist/icons/CubeIcon.js +1 -1
- package/dist/icons/CubePauseIcon.js +1 -1
- package/dist/icons/CubePlayIcon.js +1 -1
- package/dist/icons/CurrencyDollarIcon.js +1 -1
- package/dist/icons/DangerIcon.js +1 -1
- package/dist/icons/DashboardIcon.js +1 -1
- package/dist/icons/DatabaseIcon.js +1 -1
- package/dist/icons/DecimalDecreaseIcon.js +1 -1
- package/dist/icons/DecimalIncreaseIcon.js +1 -1
- package/dist/icons/DirectionIcon.js +1 -1
- package/dist/icons/DonutIcon.js +1 -1
- package/dist/icons/DownIcon.js +1 -1
- package/dist/icons/EditIcon.js +1 -1
- package/dist/icons/ExclamationCircleFilledIcon.js +1 -1
- package/dist/icons/ExclamationCircleIcon.js +1 -1
- package/dist/icons/ExclamationIcon.js +1 -1
- package/dist/icons/EyeIcon.js +1 -1
- package/dist/icons/EyeInvisibleIcon.js +1 -1
- package/dist/icons/FilterIcon.js +1 -1
- package/dist/icons/FolderFilledIcon.js +1 -1
- package/dist/icons/FolderIcon.js +1 -1
- package/dist/icons/FolderOpenFilledIcon.js +1 -1
- package/dist/icons/FolderOpenIcon.js +1 -1
- package/dist/icons/ForwardIcon.js +1 -1
- package/dist/icons/GripVerticalIcon.js +1 -1
- package/dist/icons/HierarchyIcon.js +1 -1
- package/dist/icons/HierarchyOpenIcon.js +1 -1
- package/dist/icons/Icon.js +1 -1
- package/dist/icons/InfoCircleIcon.js +1 -1
- package/dist/icons/InfoIcon.js +1 -1
- package/dist/icons/KeyIcon.js +1 -1
- package/dist/icons/LeftIcon.js +1 -1
- package/dist/icons/LineChartIcon.js +1 -1
- package/dist/icons/LoadingIcon.js +1 -1
- package/dist/icons/LockFilledIcon.js +1 -1
- package/dist/icons/LockIcon.js +1 -1
- package/dist/icons/MoreIcon.js +1 -1
- package/dist/icons/NotAllowedIcon.js +1 -1
- package/dist/icons/Number123Icon.js +1 -1
- package/dist/icons/NumberIcon.js +1 -1
- package/dist/icons/PauseCircleFilledIcon.js +1 -1
- package/dist/icons/PauseCircleIcon.js +1 -1
- package/dist/icons/PauseIcon.js +1 -1
- package/dist/icons/PercentageIcon.js +1 -1
- package/dist/icons/PieChartIcon.js +1 -1
- package/dist/icons/PipetteIcon.js +1 -1
- package/dist/icons/PlayCircleIcon.js +1 -1
- package/dist/icons/PlayIcon.js +1 -1
- package/dist/icons/PlusIcon.js +1 -1
- package/dist/icons/ProgressBarIcon.js +1 -1
- package/dist/icons/ReloadIcon.js +1 -1
- package/dist/icons/ReportIcon.js +1 -1
- package/dist/icons/ReturnIcon.js +1 -1
- package/dist/icons/RightIcon.js +1 -1
- package/dist/icons/RowTotalsIcon.js +1 -1
- package/dist/icons/SchemeIcon.js +1 -1
- package/dist/icons/SearchIcon.js +1 -1
- package/dist/icons/SemanticQueryIcon.js +1 -1
- package/dist/icons/SettingsIcon.js +1 -1
- package/dist/icons/ShieldFilledIcon.js +1 -1
- package/dist/icons/ShieldIcon.js +1 -1
- package/dist/icons/SlashIcon.js +1 -1
- package/dist/icons/SparklesIcon.js +1 -1
- package/dist/icons/SqlIcon.js +1 -1
- package/dist/icons/StatsIcon.js +1 -1
- package/dist/icons/StopIcon.js +1 -1
- package/dist/icons/StringIcon.js +1 -1
- package/dist/icons/SubtotalsIcon.js +1 -1
- package/dist/icons/SwitchIcon.js +1 -1
- package/dist/icons/TableIcon.js +1 -1
- package/dist/icons/ThumbsDownIcon.js +1 -1
- package/dist/icons/ThumbsUpIcon.js +1 -1
- package/dist/icons/ThunderboltCrossedIcon.js +1 -1
- package/dist/icons/ThunderboltFilledIcon.js +1 -1
- package/dist/icons/ThunderboltIcon.js +1 -1
- package/dist/icons/TimeIcon.js +1 -1
- package/dist/icons/TrashIcon.js +1 -1
- package/dist/icons/UnlockIcon.js +1 -1
- package/dist/icons/UpIcon.js +1 -1
- package/dist/icons/UserGroupIcon.js +1 -1
- package/dist/icons/UserIcon.js +1 -1
- package/dist/icons/UserLockIcon.js +1 -1
- package/dist/icons/ViewIcon.js +1 -1
- package/dist/icons/WarningFilledIcon.js +1 -1
- package/dist/icons/WarningIcon.js +1 -1
- package/dist/icons/wrap-icon.js +1 -1
- package/dist/index.js +1 -1
- package/dist/probe/canonicalize.js +1 -1
- package/dist/probe/css.js +1 -1
- package/dist/probe/index.js +1 -1
- package/dist/provider.js +1 -1
- package/dist/providers/TrackingProvider.js +1 -1
- package/dist/providers/navigation-url.js +1 -1
- package/dist/providers/navigationAdapter.default.js +1 -1
- package/dist/providers/use-navigation.js +1 -1
- package/dist/tokens/all-tokens.js +1 -1
- package/dist/tokens/base.js +1 -1
- package/dist/tokens/color-seed.js +1 -1
- package/dist/tokens/color-theme.js +1 -1
- package/dist/tokens/colors.js +1 -1
- package/dist/tokens/layout.js +1 -1
- package/dist/tokens/lazy-styles.js +1 -1
- package/dist/tokens/legacy-color.js +1 -1
- package/dist/tokens/palette-config.js +1 -1
- package/dist/tokens/palette.js +1 -1
- package/dist/tokens/resolve.js +1 -1
- package/dist/tokens/shadows.js +1 -1
- package/dist/tokens/sizes.js +1 -1
- package/dist/tokens/spacing.js +1 -1
- package/dist/tokens/typography.js +1 -1
- package/dist/utils/ResizeSensor.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/dotize.js +1 -1
- package/dist/utils/is-dev-env.js +1 -1
- package/dist/utils/modules.js +1 -1
- package/dist/utils/promise.js +1 -1
- package/dist/utils/raf.js +1 -1
- package/dist/utils/random.js +1 -1
- package/dist/utils/range.js +1 -1
- package/dist/utils/react/RenderCache.js +1 -1
- package/dist/utils/react/Slots.js +1 -1
- package/dist/utils/react/chain.js +1 -1
- package/dist/utils/react/disabledProps.js +1 -1
- package/dist/utils/react/forwardRefWithGenerics.js +1 -1
- package/dist/utils/react/index.js +1 -1
- package/dist/utils/react/interactions.js +1 -1
- package/dist/utils/react/isTextOnly.js +1 -1
- package/dist/utils/react/mapProps.js +1 -1
- package/dist/utils/react/mergeProps.js +1 -1
- package/dist/utils/react/nullableValue.js +1 -1
- package/dist/utils/react/overlayKeyPropagation.js +1 -1
- package/dist/utils/react/programmaticFocus.js +1 -1
- package/dist/utils/react/resolveIcon.js +1 -1
- package/dist/utils/react/sharedStore.js +1 -1
- package/dist/utils/react/useBufferedValue.js +1 -1
- package/dist/utils/react/useCombinedRefs.js +1 -1
- package/dist/utils/react/useControlledFocusVisible.js +1 -1
- package/dist/utils/react/useEventBus.js +1 -1
- package/dist/utils/react/useId.js +1 -1
- package/dist/utils/react/useIsDarwin.js +1 -1
- package/dist/utils/react/useKeySymbols.js +1 -1
- package/dist/utils/react/useLayoutEffect.js +1 -1
- package/dist/utils/react/useLocalStorage.js +1 -1
- package/dist/utils/react/useMergeStyles.js +1 -1
- package/dist/utils/react/useOverlayEscapeGuard.js +1 -1
- package/dist/utils/react/usePopoverSync.js +1 -1
- package/dist/utils/react/useQaProps.js +1 -1
- package/dist/utils/react/useScheme.js +1 -1
- package/dist/utils/react/useViewportSize.js +1 -1
- package/dist/utils/react/wrapNodeIfPlain.js +1 -1
- package/dist/utils/selection.js +1 -1
- package/dist/utils/styles.js +1 -1
- package/dist/utils/tree.js +1 -1
- package/dist/utils/warnings.js +1 -1
- package/dist/version.js +2 -2
- package/docs/Usage.md +1 -1
- package/docs/glaze/api.md +2021 -0
- package/docs/glaze/methodology.md +686 -0
- package/docs/glaze/migration.md +285 -477
- package/docs/glaze/okhst.md +207 -0
- package/package.json +3 -2
- package/tasty.config.ts +52 -13
- package/docs/glaze/contrast.mdx +0 -751
- package/docs/glaze/exporting.mdx +0 -851
- package/docs/glaze/getting-started.mdx +0 -488
- package/docs/glaze/methodology.mdx +0 -977
- package/docs/glaze/mixes.mdx +0 -305
- package/docs/glaze/okhst.mdx +0 -680
- package/docs/glaze/reference/color-definitions.md +0 -554
- package/docs/glaze/reference/color-tokens.md +0 -421
- package/docs/glaze/reference/configuration.md +0 -517
- package/docs/glaze/reference/contrast.md +0 -277
- package/docs/glaze/reference/index.md +0 -223
- package/docs/glaze/reference/output.md +0 -835
- package/docs/glaze/reference/palette.md +0 -435
- package/docs/glaze/reference/theme.md +0 -332
- package/docs/glaze/reference/utilities.md +0 -629
- package/docs/glaze/schemes.mdx +0 -637
- package/docs/glaze/shadows-and-glows.mdx +0 -739
package/docs/glaze/migration.md
CHANGED
|
@@ -1,75 +1,263 @@
|
|
|
1
|
-
|
|
2
|
-
title: Migration and upgrading
|
|
3
|
-
description: Move an existing color system to Glaze without renaming tokens, and upgrade between major Glaze versions.
|
|
4
|
-
---
|
|
1
|
+
# Migration & Integration
|
|
5
2
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
How to move an existing CSS, design-token, or application color system to
|
|
4
|
+
Glaze, then export the resulting palette in the shape your app and design tools
|
|
5
|
+
consume.
|
|
6
|
+
|
|
7
|
+
If you're starting from scratch, see [methodology.md](methodology.md) first — that's about _designing_ the palette. This doc is about _consuming_ it.
|
|
8
|
+
|
|
9
|
+
## Contents
|
|
10
|
+
|
|
11
|
+
- [Choosing an export](#choosing-an-export)
|
|
12
|
+
- [Wiring exports into the app](#wiring-exports-into-the-app)
|
|
13
|
+
- [Prefix map strategies](#prefix-map-strategies)
|
|
14
|
+
- [Migrating an existing color system](#migrating-from-an-existing-color-system)
|
|
15
|
+
- [Upgrading Glaze](#upgrading-glaze)
|
|
16
|
+
- [Common pitfalls](#common-pitfalls)
|
|
17
|
+
|
|
18
|
+
## Choosing an export
|
|
19
|
+
|
|
20
|
+
Glaze has two layers of “export”:
|
|
21
|
+
|
|
22
|
+
1. **Authoring snapshots** — `theme.export(override?)` / `token.export(override?)` / `palette.export(override?)`, restored with `glaze.themeFrom` / `colorFrom` / `paletteFrom`. These carry definitions, relations, and a config freeze taken at export time (`kind` + `version`). Live instances keep only a sparse local override; omitted global fields track `configure()` until export.
|
|
23
|
+
2. **Resolved output** — the seven shapes below. These are color strings / design-token documents for apps and tools, **not** restorable as authoring config.
|
|
24
|
+
|
|
25
|
+
Glaze emits the same resolved colors in seven shapes. Pick one based on your
|
|
26
|
+
renderer or tooling.
|
|
27
|
+
|
|
28
|
+
| Method | Output shape | Use it for |
|
|
29
|
+
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
30
|
+
| `palette.tasty(options?)` | `{ '#name': { '': value, '@media(prefers-color-scheme: dark)': value, '@media(prefers-contrast: more)': value } }` | The [Tasty](https://tasty.style) style system. Single object, state aliases keyed inside each token. |
|
|
31
|
+
| `palette.tokens(options?)` | `{ light: { name: value }, dark: { name: value }, ... }` | Most CSS-in-JS systems. Per-variant flat maps, easy to feed into a `:root { ... }` selector via your framework's globals. |
|
|
32
|
+
| `palette.css(options?)` | `{ light: '--name-color: rgb(...);', dark: '...', ... }` | Framework-free CSS / static stylesheets. Variant-grouped CSS custom property strings ready to wrap in `:root` and `prefers-color-scheme` queries. |
|
|
33
|
+
| `palette.json(options?)` | `{ themeName: { name: { light, dark, ... } } }` | Tooling, JSON pipelines. |
|
|
34
|
+
| `palette.dtcg(options?)` | `{ light: { name: { $type, $value } }, dark: { ... }, ... }` | W3C [DTCG 2025.10](https://www.designtokens.org/) `.tokens.json` — Figma, Tokens Studio, Style Dictionary, Terrazzo, Penpot. One document per scheme. |
|
|
35
|
+
| `palette.dtcgResolver(options?)` | `{ version, sets, modifiers, resolutionOrder }` | W3C DTCG **Resolver-Module** — a single document describing every scheme variant as `sets` + a `scheme` modifier with a context per variant. For resolver tools such as Dispersa. |
|
|
36
|
+
| `palette.tailwind(options?)` | `'@theme { --color-*: ... } .dark { ... } ...'` | Tailwind CSS v4. A single ready-to-paste `@theme` block plus dark / high-contrast overrides. |
|
|
37
|
+
|
|
38
|
+
`tasty()`, `tokens()`, `json()`, `dtcg()`, `dtcgResolver()`, and `tailwind()` accept `modes` (`{ dark, highContrast }`). `css()` always returns all four strings (`light`, `dark`, `lightContrast`, `darkContrast`). CSS-string exports accept `format` and default to `'oklch'` (`tokens`/`json`/`css`/`tailwind`/`tasty`; `'rgb'` and `'hsl'` also available). `'okhsl'` and `'okhst'` are supported only on [Tasty](https://tasty.style)-shaped exports (`tasty()`, standalone `token()` / `.tasty()`). `dtcg()` and `dtcgResolver()` ignore `format` and use `colorSpace` instead (`'srgb'` default, `'oklch'` opt-in). See [api.md → Palette](api.md#palette) for full options.
|
|
39
|
+
|
|
40
|
+
## Wiring exports into the app
|
|
41
|
+
|
|
42
|
+
### [Tasty](https://tasty.style)
|
|
43
|
+
|
|
44
|
+
Spread the result of `palette.tasty()` into a global style call:
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
import type { Styles } from '@tenphi/tasty';
|
|
48
|
+
import { useGlobalStyles } from '@tenphi/tasty';
|
|
49
|
+
import { tastyStatic } from '@tenphi/tasty/static';
|
|
50
|
+
|
|
51
|
+
export const PALETTE_TOKENS = palette.tasty({
|
|
52
|
+
/* prefix map */
|
|
53
|
+
}) as Styles;
|
|
54
|
+
|
|
55
|
+
// In your root component:
|
|
56
|
+
useGlobalStyles('body', PALETTE_TOKENS);
|
|
57
|
+
|
|
58
|
+
// Or, for zero-runtime builds:
|
|
59
|
+
tastyStatic('body', PALETTE_TOKENS);
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
By default the dark / high-contrast variants are keyed by media-query states — `'@media(prefers-color-scheme: dark)'` and `'@media(prefers-contrast: more)'` — so the tokens react to the OS preference out of the box, with no extra [Tasty](https://tasty.style) setup.
|
|
63
|
+
|
|
64
|
+
If you'd rather drive the schemes from custom aliases (e.g. a manual toggle that also falls back to the OS preference), set your own [`glaze.configure({ states })`](api.md#configuration) and register what those states _mean_:
|
|
65
|
+
|
|
66
|
+
```ts
|
|
67
|
+
import { setGlobalPredefinedStates } from '@tenphi/tasty';
|
|
68
|
+
|
|
69
|
+
// glaze.configure({ states: { dark: '@dark', highContrast: '@hc' } });
|
|
70
|
+
setGlobalPredefinedStates({
|
|
71
|
+
'@dark':
|
|
72
|
+
'@root(schema=dark) | (!@root(schema) & @media(prefers-color-scheme: dark))',
|
|
73
|
+
'@hc':
|
|
74
|
+
'@root(contrast=high) | (!@root(contrast) & @media(prefers-contrast: more))',
|
|
75
|
+
});
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
The state names here must match the `states` you set in [`glaze.configure({ states })`](api.md#configuration).
|
|
79
|
+
|
|
80
|
+
You can also register the tokens as a [Tasty](https://tasty.style) recipe instead of spreading them globally:
|
|
81
|
+
|
|
82
|
+
```ts
|
|
83
|
+
import { configure, tasty } from '@tenphi/tasty';
|
|
84
|
+
|
|
85
|
+
configure({ recipes: { 'theme-tokens': PALETTE_TOKENS } });
|
|
86
|
+
|
|
87
|
+
const Page = tasty({
|
|
88
|
+
styles: { recipe: 'theme-tokens', fill: '#surface', color: '#surface-text' },
|
|
89
|
+
});
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### CSS custom properties
|
|
93
|
+
|
|
94
|
+
```ts
|
|
95
|
+
const css = palette.css();
|
|
96
|
+
const stylesheet = `
|
|
97
|
+
:root { ${css.light} }
|
|
98
|
+
@media (prefers-color-scheme: dark) { :root { ${css.dark} } }
|
|
99
|
+
@media (prefers-contrast: more) { :root { ${css.lightContrast} } }
|
|
100
|
+
@media (prefers-color-scheme: dark) and (prefers-contrast: more) {
|
|
101
|
+
:root { ${css.darkContrast} }
|
|
102
|
+
}
|
|
103
|
+
`;
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Each property name is `--<prefix><name>-color` by default. Override the suffix:
|
|
107
|
+
|
|
108
|
+
```ts
|
|
109
|
+
palette.css({ suffix: '' }); // → '--surface: rgb(...);'
|
|
110
|
+
palette.css({ format: 'oklch' }); // → '--surface-color: oklch(...);'
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Framework-agnostic JSON
|
|
114
|
+
|
|
115
|
+
```ts
|
|
116
|
+
const data = palette.json();
|
|
117
|
+
// → { primary: { surface: { light: 'oklch(...)', dark: 'oklch(...)' } }, ... }
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Feed into your tooling pipeline. Each color is grouped by theme name, then by token name, then by variant — no prefix logic to undo.
|
|
121
|
+
|
|
122
|
+
### W3C DTCG (`.tokens.json`)
|
|
123
|
+
|
|
124
|
+
```ts
|
|
125
|
+
import { writeFileSync } from 'node:fs';
|
|
126
|
+
const dtcg = palette.dtcg();
|
|
127
|
+
|
|
128
|
+
writeFileSync('tokens.light.tokens.json', JSON.stringify(dtcg.light, null, 2));
|
|
129
|
+
if (dtcg.dark) {
|
|
130
|
+
writeFileSync('tokens.dark.tokens.json', JSON.stringify(dtcg.dark, null, 2));
|
|
131
|
+
}
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Each document is a spec-conformant token tree. One file per scheme is the most tool-compatible convention — Style Dictionary treats them as themes, Tokens Studio as sets, and Figma as variable modes. Use `colorSpace: 'oklch'` for wide-gamut, Glaze-native values (no `hex`); the default `'srgb'` emits components plus a `hex` hint that every reader understands. Feed the files straight into Style Dictionary v4+, Tokens Studio, or any DTCG-compatible tool — no Glaze-specific transform needed.
|
|
135
|
+
|
|
136
|
+
### W3C DTCG Resolver-Module (single document)
|
|
137
|
+
|
|
138
|
+
When you want **one file** describing every scheme variant — for a resolver tool such as [Dispersa](https://github.com/dispersa-core/dispersa) — use `dtcgResolver()` instead of `dtcg()`:
|
|
139
|
+
|
|
140
|
+
```ts
|
|
141
|
+
import { writeFileSync } from 'node:fs';
|
|
142
|
+
const resolver = palette.dtcgResolver({ modes: { highContrast: true } });
|
|
143
|
+
|
|
144
|
+
writeFileSync('resolver.json', JSON.stringify(resolver, null, 2));
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
The document places the light tokens in `sets.base.sources[0]` (the default context) and emits a single `scheme` modifier with a context per variant (`light` / `dark` / `lightContrast` / `darkContrast`). Each non-default context holds that variant's exact resolved tokens — Glaze resolves `darkContrast` independently, so the four-context shape keeps every value correct (two independent modifiers would compose additively and produce wrong dark + high-contrast values). Rename the set, modifier, or contexts via `setName` / `modifierName` / `contextNames` if your resolver expects different labels. Prefer `dtcg()` when you need maximum per-file tool compatibility; prefer `dtcgResolver()` when a resolver tool consumes the document for you.
|
|
148
|
+
|
|
149
|
+
### Tailwind CSS v4
|
|
150
|
+
|
|
151
|
+
```ts
|
|
152
|
+
const css = palette.tailwind();
|
|
153
|
+
// Write to your CSS entry, or paste into a `@import "tailwindcss"` stylesheet:
|
|
154
|
+
// @theme { --color-primary-surface: oklch(...); ... }
|
|
155
|
+
// .dark { --color-primary-surface: oklch(...); ... }
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
The `--color-*` namespace makes every color available as `bg-*` / `text-*` / `border-*`. Drive dark mode from the OS preference instead of a class with `darkSelector: '@media (prefers-color-scheme: dark)'` (it nests `:root` automatically). High-contrast overrides land under `.high-contrast` and `.dark.high-contrast` by default; both are omitted unless `modes.highContrast` is enabled.
|
|
159
|
+
|
|
160
|
+
## Prefix map strategies
|
|
161
|
+
|
|
162
|
+
`palette.tokens()` / `tasty()` / `css()` / `dtcg()` / `tailwind()` accept a `prefix` option:
|
|
163
|
+
|
|
164
|
+
| Value | Result |
|
|
165
|
+
| ------------------------ | -------------------------------------------------------------------------- |
|
|
166
|
+
| `true` (default) | Every theme prefixes its tokens with `<themeName>-`. |
|
|
167
|
+
| `false` | No prefixes. Colliding keys produce a `console.warn`; first-write wins. |
|
|
168
|
+
| `Record<string, string>` | Per-theme prefix overrides. Themes not listed fall back to `<themeName>-`. |
|
|
169
|
+
|
|
170
|
+
The most common production pattern: **default theme unprefixed, every other theme prefixed with its name**:
|
|
171
|
+
|
|
172
|
+
```ts
|
|
173
|
+
palette.tasty({
|
|
174
|
+
prefix: {
|
|
175
|
+
default: '',
|
|
176
|
+
primary: 'primary-',
|
|
177
|
+
success: 'success-',
|
|
178
|
+
danger: 'danger-',
|
|
179
|
+
warning: 'warning-',
|
|
180
|
+
note: 'note-',
|
|
181
|
+
},
|
|
182
|
+
});
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
This makes neutral tokens consume as `#surface`, `#border`, `#disabled-surface` (no theme namespace) while status colors live under `#danger-surface`, `#success-accent-text`, etc.
|
|
186
|
+
|
|
187
|
+
This explicit map is usually clearer for a neutral `default` theme. The
|
|
188
|
+
separate `primary` palette option below solves a different namespace problem:
|
|
189
|
+
it duplicates one named theme without a prefix while retaining that theme's
|
|
190
|
+
prefixed tokens.
|
|
191
|
+
|
|
192
|
+
### Alias themes for legacy names
|
|
193
|
+
|
|
194
|
+
Two aliases for the same theme instance produce identical token values under different prefixes — useful when you want to support a legacy token name without duplicating definitions:
|
|
195
|
+
|
|
196
|
+
```ts
|
|
197
|
+
const palette = glaze.palette({
|
|
198
|
+
default: defaultTheme,
|
|
199
|
+
primary: primaryTheme,
|
|
200
|
+
purple: primaryTheme, // legacy alias — same theme, different prefix
|
|
201
|
+
// ...
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
palette.tasty({
|
|
205
|
+
prefix: {
|
|
206
|
+
default: '',
|
|
207
|
+
primary: 'primary-',
|
|
208
|
+
purple: 'purple-', // emits #purple-surface alongside #primary-surface
|
|
209
|
+
},
|
|
210
|
+
});
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
Both `#primary-surface` and `#purple-surface` resolve to the exact same color. Drop the alias when the legacy name is no longer referenced.
|
|
214
|
+
|
|
215
|
+
### `primary` (the unprefixed alias)
|
|
216
|
+
|
|
217
|
+
`glaze.palette(themes, { primary })` and the per-export `primary` option duplicate one theme's tokens _without_ prefix on top of any prefix map. Equivalent to listing that theme twice with different prefixes; useful when the "primary" theme is conceptually distinct from `default` and you want both sets of unprefixed tokens.
|
|
218
|
+
|
|
219
|
+
```ts
|
|
220
|
+
const palette = glaze.palette({ brand, accent }, { primary: 'brand' });
|
|
221
|
+
palette.tokens();
|
|
222
|
+
// → { light: { 'brand-surface': '...', 'surface': '...', 'accent-surface': '...' } }
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Override per call: `palette.tokens({ primary: 'accent' })`, or disable with `palette.tokens({ primary: false })`.
|
|
11
226
|
|
|
12
227
|
## Migrating from an existing color system
|
|
13
228
|
|
|
14
|
-
The fastest path
|
|
15
|
-
producing a Glaze-resolved color (even a rough first pass), wire the new
|
|
16
|
-
palette in, then iterate on the resolved colors without touching component
|
|
17
|
-
code.
|
|
229
|
+
The fastest path: **map first, design second**. Get every existing token name producing a Glaze-resolved color value (even if it's a rough first pass), wire the new palette in, then iterate on the resolved colors without touching component code.
|
|
18
230
|
|
|
19
231
|
### 1. Inventory the existing tokens
|
|
20
232
|
|
|
21
|
-
Walk your current color system and
|
|
233
|
+
Walk your current color system and bucket every token into one of these categories:
|
|
22
234
|
|
|
23
|
-
- **Surfaces
|
|
24
|
-
- **Surface text
|
|
25
|
-
- **Borders
|
|
26
|
-
- **Brand fills
|
|
27
|
-
- **Brand foregrounds
|
|
28
|
-
|
|
29
|
-
- **
|
|
30
|
-
- **
|
|
31
|
-
and fixed-alpha overlays such as scrims (`opacity`).
|
|
32
|
-
- **One-off colors**: syntax highlighting, charts, illustrations.
|
|
235
|
+
- **Surfaces** — backgrounds, panels, cards, banners.
|
|
236
|
+
- **Surface text** — body text, headings, captions, labels.
|
|
237
|
+
- **Borders / dividers / focus rings** — neutral structural lines.
|
|
238
|
+
- **Brand fills** — solid CTA backgrounds, badges, status banners.
|
|
239
|
+
- **Brand foregrounds** — link text, status text, icon colors on neutral backgrounds.
|
|
240
|
+
- **Disabled** — disabled chip + label.
|
|
241
|
+
- **Shadows / overlays** — elevation, scrims.
|
|
242
|
+
- **One-off colors** — syntax highlighting, charts, illustrations.
|
|
33
243
|
|
|
34
|
-
Each bucket maps
|
|
35
|
-
[Designing a palette](./methodology.mdx). The bucket decides the _shape_ of the
|
|
36
|
-
Glaze definition (root or dependent, `mode: 'auto'` or `'fixed'`, a contrast
|
|
37
|
-
floor or an absolute tone), not its value.
|
|
244
|
+
Each bucket maps cleanly to one of the patterns in [methodology.md](methodology.md). The bucket determines the _shape_ of the Glaze definition (root vs dependent, `mode: 'auto'` vs `'fixed'`, contrast-floor vs absolute tone), not the value.
|
|
38
245
|
|
|
39
246
|
### 2. Reproduce the existing values
|
|
40
247
|
|
|
41
|
-
Pick a definition shape that lands the new color _close to_ the legacy
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
Three tactics make matching easier:
|
|
47
|
-
|
|
48
|
-
- **Anchor strong text at the edge** instead of solving for `'AAA'`. The
|
|
49
|
-
contrast solver stops at the floor, which usually leaves text noticeably
|
|
50
|
-
softer than the legacy value: on a white surface, a neutral
|
|
51
|
-
`contrast: 'AAA'` (7:1) solves to tone 36, while a legacy `#1a1a1a` sits at
|
|
52
|
-
tone 6.2 (17.4:1). An absolute `tone` preserves the look, but author it a
|
|
53
|
-
little below the measured value: the light
|
|
54
|
-
[tone window](./schemes.mdx#tone-windows) lifts authored tones (tone 0
|
|
55
|
-
renders at 4.95, tone 2 at 6.85), so a neutral `tone: 1.3` renders
|
|
56
|
-
`#1a1a1a`. With `lightTone: false` on the theme, light tones render exactly
|
|
57
|
-
as authored.
|
|
248
|
+
Pick a Glaze definition shape that lands the new color _close to_ the legacy hex in light mode. The methodology doc explains the shape per bucket; the API doc covers the levers (`tone`, `saturation`, `contrast`, `mode`, `hue`).
|
|
249
|
+
|
|
250
|
+
Two tactics that make matching easier:
|
|
251
|
+
|
|
252
|
+
- **Anchor strong text at the edge** instead of solving for `'AAA'`. The contrast solver stops at the floor (cr=7), which usually leaves text noticeably softer than a legacy hex like `#1a1a1a`. An absolute `tone: 2` (or wherever the legacy token sits) preserves the look.
|
|
58
253
|
- **Match the metric the old system actually used.** Numeric WCAG ratios are
|
|
59
|
-
useful when
|
|
254
|
+
useful when reproducing a measured legacy ratio. For new content roles,
|
|
60
255
|
prefer the APCA presets from the methodology. For low-stakes spacing, use a
|
|
61
|
-
tone delta instead of inventing a contrast target.
|
|
62
|
-
[Contrast solving](./contrast.mdx).
|
|
63
|
-
- **Pin values that are a contract with `from`.** A brand color you must honor
|
|
64
|
-
can be given as a literal: `{ from: '#2f5bff' }` reproduces that exact value
|
|
65
|
-
in the light scheme whatever the theme's seed saturation, while dark and high
|
|
66
|
-
contrast still adapt. Add `base` and `contrast` when it must stay legible
|
|
67
|
-
against something. See [`from`](./reference/color-definitions.md#from).
|
|
256
|
+
tone delta instead of inventing a contrast target.
|
|
68
257
|
|
|
69
258
|
### 3. Keep the old token names
|
|
70
259
|
|
|
71
|
-
Use a custom `prefix` map (and
|
|
72
|
-
if needed) so the names your components already consume keep working:
|
|
260
|
+
Use a custom `prefix` map (and theme aliases if needed) so the names your components already consume keep working:
|
|
73
261
|
|
|
74
262
|
```ts
|
|
75
263
|
// Old: components consume `#dark`, `#dark-02`, `#dark-03`.
|
|
@@ -92,396 +280,34 @@ defaultTheme.colors({
|
|
|
92
280
|
});
|
|
93
281
|
|
|
94
282
|
palette.tasty({ prefix: { default: '' } });
|
|
95
|
-
// → '#dark', '#dark-02', '#dark-03'
|
|
283
|
+
// → '#dark', '#dark-02', '#dark-03' — components don't change.
|
|
96
284
|
```
|
|
97
285
|
|
|
98
|
-
Once consumers are off the legacy names, rename the Glaze tokens to match your
|
|
99
|
-
conventions. [Prefix map strategies](./exporting.mdx#prefix-map-strategies)
|
|
100
|
-
shows every naming option with real output.
|
|
101
|
-
|
|
102
|
-
### 4. Verify dark mode and high contrast before promoting
|
|
103
|
-
|
|
104
|
-
Glaze gives you light, dark, and high contrast for free, but only the light
|
|
105
|
-
scheme was matched against the legacy palette. Before you promote the
|
|
106
|
-
migration:
|
|
107
|
-
|
|
108
|
-
- Spot-check every surface, text, accent, and disabled pair in dark mode. The
|
|
109
|
-
tone inversion plus the per-color `mode` can produce results that look right
|
|
110
|
-
in light but feel off in dark. The usual fixes: switch a brand color to
|
|
111
|
-
`mode: 'fixed'`, or anchor a foreground to `surface` instead of the brand
|
|
112
|
-
fill (see [adaptation modes](./schemes.mdx#adaptation-modes) and
|
|
113
|
-
[Designing a palette](./methodology.mdx)).
|
|
114
|
-
- If the legacy system had no high-contrast mode, audit the high-contrast
|
|
115
|
-
variants Glaze emits. Wherever the resolved contrast is too low or a color
|
|
116
|
-
blows out, add a `[normal, highContrast]` pair (`tone: ['-7', '-20']`,
|
|
117
|
-
`contrast: [4.5, 7]`, and so on).
|
|
118
|
-
- Run real screens, not just the token grid. The interaction of several Glaze
|
|
119
|
-
tokens against each other (text on a chip, a hover background against its
|
|
120
|
-
fill, a disabled label on a disabled chip) is where mismatches show up.
|
|
286
|
+
Once consumers are off the legacy names, rename the Glaze tokens to match your conventions.
|
|
121
287
|
|
|
122
|
-
###
|
|
288
|
+
### 4. Verify dark mode and HC before promoting
|
|
123
289
|
|
|
124
|
-
|
|
125
|
-
the disabled chip, code highlighting, and so on) `inherit: false`. Colored
|
|
126
|
-
sibling themes created with `extend()` only need the accent and tinted-surface
|
|
127
|
-
chain; flagging the rest cuts the token set each theme emits dramatically.
|
|
290
|
+
Glaze gives you light/dark/HC for free, but only the light mode is matched against the legacy palette. Before promoting the migration:
|
|
128
291
|
|
|
129
|
-
|
|
292
|
+
- Spot-check every surface, text, accent, and disabled pair in dark mode. The tone inversion plus per-color `mode` choices may produce results that _look right_ in light but feel off in dark (typical fix: switch a brand color to `mode: 'fixed'`, or anchor a foreground to `surface` instead of the brand fill — see [methodology.md](methodology.md)).
|
|
293
|
+
- If the legacy system had no high-contrast mode, audit the HC variants Glaze emits. Anywhere the resolved cr is too low or the color blows out, add an HC pair (`tone: ['-7', '-20']`, `contrast: [4.5, 7]`, etc.).
|
|
294
|
+
- Run real screens, not just the token grid. The interaction of multiple Glaze tokens against each other (text on chip, hover bg vs. fill, disabled label on disabled chip) is where mismatches show up.
|
|
130
295
|
|
|
131
|
-
###
|
|
132
|
-
|
|
133
|
-
`shadow` was rebuilt so `intensity` produces the same visible change on every
|
|
134
|
-
surface, and `glow` was added as its mirror. Both emit a translucent pigment
|
|
135
|
-
whose opacity is solved, per surface and per scheme, so the composite lands an
|
|
136
|
-
exact **tone step** away from `bg`: darker for `shadow`, lighter for `glow`.
|
|
137
|
-
See [Shadows and glows](./shadows-and-glows.mdx).
|
|
138
|
-
|
|
139
|
-
What changed:
|
|
140
|
-
|
|
141
|
-
- **`intensity` is a tone step.** In 2.x it went through a `tanh` curve in
|
|
142
|
-
OKHSL lightness, so the same number darkened white by 9 tones, a surface
|
|
143
|
-
rendered at tone 35 by 13.9, and one rendered at tone 6 by 4.4. Now
|
|
144
|
-
`intensity: 10` is 10 tones on every surface with 10 tones of room. A
|
|
145
|
-
step past black (or white, for a glow) is pinned to the strongest composite
|
|
146
|
-
the pigment reaches, and Glaze warns; see
|
|
147
|
-
[Unreachable steps](./shadows-and-glows.mdx#unreachable-steps).
|
|
148
|
-
- **`fg` is the object, not a contrast reference.** In 2.x, strength scaled
|
|
149
|
-
with `|l_bg − l_fg|` and the docs pointed `fg` at `text`, which ran opposite
|
|
150
|
-
to the physics: a white card on a light surface got almost no shadow. Now
|
|
151
|
-
`fg` is the element casting the shadow; a darker object deepens it, a lighter
|
|
152
|
-
one softens it, and an object at the surface's tone (or no `fg`) gives
|
|
153
|
-
exactly `intensity`.
|
|
154
|
-
- **The pigment is neutral by default**: pure black for `shadow`, pure white
|
|
155
|
-
for `glow`. The surface keeps its hue and the output is clean: `intensity: 10`
|
|
156
|
-
on a white surface emits `rgb(0 0 0 / 0.1326)`, which composites to tone 90.
|
|
157
|
-
- **The `ShadowTuning` fields were replaced.** `saturationFactor`,
|
|
158
|
-
`maxSaturation`, `lightnessFactor`, `lightnessBounds`, `minGapTarget`,
|
|
159
|
-
`alphaMax`, and `bgHueBlend` are gone. The new knobs are `objectInfluence`,
|
|
160
|
-
`tint`, `reach`, and `hueBleed`, shared by `shadowTuning` and the new
|
|
161
|
-
`glowTuning`. The type is now `LightingTuning`, and `ShadowTuning` is an
|
|
162
|
-
alias of it. The new `GlowTuning` is its own interface: `LightingTuning`
|
|
163
|
-
plus `headroom`, which a shadow's tuning rejects.
|
|
164
|
-
- **`GLAZE_EXPORT_VERSION` is 2.** A version-1 theme or palette snapshot that
|
|
165
|
-
contains shadow colors or a `shadowTuning` now throws on restore instead of
|
|
166
|
-
silently re-rendering every shadow.
|
|
167
|
-
- **`ColorDef` has a fourth member, `GlowColorDef`.** Exhaustive `switch`es
|
|
168
|
-
over `def.type` need a `'glow'` branch.
|
|
169
|
-
|
|
170
|
-
How 2.x shadows map onto 3.0 (2.x steps measured with browser compositing;
|
|
171
|
-
tones are where the surface renders, so under the default light window a
|
|
172
|
-
`tone: 10` surface, rendered at 14.5, stepped 10.0):
|
|
173
|
-
|
|
174
|
-
| 2.x definition | 2.x step for `intensity: 10` | 3.0 equivalent |
|
|
175
|
-
| --- | --- | --- |
|
|
176
|
-
| No `fg`, light surface (tone 97–100) | ≈ 9 tones | `intensity: 9`, or keep `10` (a tone stronger) |
|
|
177
|
-
| No `fg`, mid surface (tone 50) | ≈ 13.6 tones | `intensity: 13.6`, or settle on one value for all surfaces |
|
|
178
|
-
| No `fg`, dark surface (tone 10) | ≈ 7.6 tones, and saturating | `intensity: 7.6`; dark shadows were weaker than authored and now aren't |
|
|
179
|
-
| `fg: 'text'` on a light surface | ≈ 5.5–8 tones, by the text's tone (7.8 for near-black text, 5.6 for `'AAA'` text on a tone-95 surface) | Drop `fg` and use the step your text gave (`intensity: 8` for near-black text), or point `fg` at the element and re-tune |
|
|
180
|
-
| `fg` = a near-white card on light | ≈ 0.3 tones (barely visible) | `fg: 'card'`, then pick `intensity` for the look you want |
|
|
181
|
-
|
|
182
|
-
Then:
|
|
183
|
-
|
|
184
|
-
1. Replace `fg: 'text'` (or any contrast-reference `fg`) with either no `fg` or
|
|
185
|
-
the element that casts the shadow.
|
|
186
|
-
2. Pick `intensity` as the number of tones you want. For a ladder, `4` / `8` /
|
|
187
|
-
`12` reads as evenly spaced on every surface with room for the deepest step.
|
|
188
|
-
Check the dark schemes: a white `auto` page sits at tone 9.25 in dark and at
|
|
189
|
-
tone 0 in dark high contrast. Shadows on it deeper than about `8`–`9` (a
|
|
190
|
-
saturated page has a little less room) pin to black and warn in dark, and
|
|
191
|
-
every shadow on it stays transparent and warns in dark high contrast. Use
|
|
192
|
-
glows for dark elevation, on a surface that also leaves them room in light
|
|
193
|
-
([Dark-mode elevation](./shadows-and-glows.mdx#dark-mode-elevation)). Leaving
|
|
194
|
-
a shadow token out of the dark schemes hides the pinned result but not the
|
|
195
|
-
warning: every color resolves in all four schemes.
|
|
196
|
-
3. Delete the old fields inside `tuning` / `shadowTuning` (`saturationFactor`,
|
|
197
|
-
`alphaMax`, …); TypeScript flags them. A tinted pigment is
|
|
198
|
-
`tuning: { tint: 0.3, reach: 0.85 }`. There is no opacity cap: lower
|
|
199
|
-
`intensity` for a lighter overlay.
|
|
200
|
-
4. Replace hand-tuned translucent white mixes (dark-mode elevation, edge
|
|
201
|
-
highlights, lightening state layers) with
|
|
202
|
-
`{ type: 'glow', bg, intensity }`. Direction is fixed per type, so a
|
|
203
|
-
`shadow` darkens and a `glow` lightens in light and dark alike. A glow on a
|
|
204
|
-
white light-mode surface has nothing to lighten and warns, unless it has
|
|
205
|
-
HDR headroom (below).
|
|
206
|
-
5. Re-export snapshots. A 2.x snapshot with shadows or a `shadowTuning` throws
|
|
207
|
-
on restore, so re-author it. In code, rebuild the theme with 3.0 shadow defs
|
|
208
|
-
and call `export()`. In the JSON, fix the shadow defs, drop
|
|
209
|
-
`config.shadowTuning`, and set `version` to `2` (a palette snapshot has one at
|
|
210
|
-
the top and one per theme), then load it and export again. A snapshot
|
|
211
|
-
without shadows passes the version check and restores, but it resolves with
|
|
212
|
-
the other 3.0 changes on this page, and one that holds a value 3.0 rejects
|
|
213
|
-
throws, on its first output or (for a token's color value) when restored
|
|
214
|
-
(see [stricter input validation](#30--stricter-input-validation)).
|
|
215
|
-
|
|
216
|
-
`glaze.shadow()` keeps its signature with the new semantics, and `glaze.glow()`
|
|
217
|
-
takes the same input. See
|
|
218
|
-
[`glaze.shadow()` / `glaze.glow()`](./reference/utilities.md#glazeshadowinput--glazeglowinput).
|
|
219
|
-
|
|
220
|
-
HDR glows are new in 3.0 and opt-in, so they need no migration. A glow
|
|
221
|
-
variant gets an `hdr` value only with a `headroom` above 0
|
|
222
|
-
(`glowTuning.headroom`, or a glow's own `tuning.headroom`; the default is 0),
|
|
223
|
-
and exports carry it only with `modes.hdr` (default `false`), or for `css()`
|
|
224
|
-
its `hdr` option. At the defaults nothing changes. See
|
|
225
|
-
[HDR glows](./shadows-and-glows.mdx#hdr-glows) and
|
|
226
|
-
[HDR output](./exporting.mdx#hdr-output).
|
|
227
|
-
|
|
228
|
-
### 3.0 — even dark steps for tone deltas
|
|
229
|
-
|
|
230
|
-
In 2.x an `auto` tone delta's dark variant stepped from the base's light tone.
|
|
231
|
-
That tone carries the light window's lift, and on a contrast-solved base or a
|
|
232
|
-
mix it sits wherever light put it, so dark steps came out uneven: on a tone-50
|
|
233
|
-
base, `'+4'` stepped −5.6 in dark and `'-4'` +1.3, and in `glaze(280, 40)` a
|
|
234
|
-
`'-4'` hover on an `'AAA'` button stepped darker in dark as well (−5.5).
|
|
235
|
-
|
|
236
|
-
In 3.0 a dark delta steps from where its base sits on the authored scale: the
|
|
237
|
-
base's authored tone, or, for a `fixed` or `static` base, an `auto`
|
|
238
|
-
contrast-solved base, a mix, or an `auto` `'max'` / `'min'` on a base, the
|
|
239
|
-
base's own dark tone read back through the dark window. A dark delta then
|
|
240
|
-
lands where the same authored tone would, on every base, along chains of
|
|
241
|
-
deltas, and for `from` colors. At the default dark window that is about 0.87×
|
|
242
|
-
the delta: `'+4'` steps −3.5, `'-4'` +3.5, and the `'AAA'` hover above +3.5.
|
|
243
|
-
Under a custom dark `eps` the steps follow that window's curve instead of a
|
|
244
|
-
fixed scale. On a `fixed` or `static` base the `auto` dependent still inverts
|
|
245
|
-
on its own, mirrored around wherever the base sits. See
|
|
246
|
-
[How relative tone adapts](./schemes.mdx#how-relative-tone-adapts).
|
|
247
|
-
|
|
248
|
-
What moves:
|
|
249
|
-
|
|
250
|
-
- **Dark variants** of `auto` tone-delta colors, and anything solved, mixed,
|
|
251
|
-
or lit from them in dark: at the default light window, by up to about
|
|
252
|
-
4 tones on the lowest bases, about 2 on a tone-50 base, and a fraction of a
|
|
253
|
-
tone on a light surface. Deltas on a contrast-solved, mixed, or extreme base
|
|
254
|
-
move more (the `'AAA'` hover above moves 9 tones), and so do deltas on a
|
|
255
|
-
base past the dark window or under a custom light window: the move grows
|
|
256
|
-
with how far the window lifts the base, so `lightTone: [15, 100]` moves a
|
|
257
|
-
tone-50 base's deltas about 4 tones and up to 8 at the bottom, and a `hi`
|
|
258
|
-
below 100 moves a white surface's about 0.7 tones per tone it drops (about
|
|
259
|
-
3.5 at `hi` 95). A custom light `eps` moves them too. A contrast-solved delta whose 2.x dark step
|
|
260
|
-
crossed its base now lands on the side that mirrors light, which can move
|
|
261
|
-
it most of the scale: in `glaze(0, 0)`,
|
|
262
|
-
`{ base: 'fill', tone: '-1', contrast: 3 }` on a tone-50 fill goes from
|
|
263
|
-
16.2 to 89.0 in dark.
|
|
264
|
-
- **`auto` deltas on a `fixed` or `static` base**, in dark and dark high
|
|
265
|
-
contrast. 2.x reflected them across the whole scale, so how far one landed
|
|
266
|
-
from its base depended on the base's tone. They now mirror around the base:
|
|
267
|
-
in `glaze(280, 30)`, an `auto` `'+30'` label on a `fixed` tone-52 fill goes
|
|
268
|
-
from 31.5 to 26.0 tones below it in dark (34 to 30 in dark high contrast),
|
|
269
|
-
and a `'-4'` hover on `{ base: 'surface', tone: '-10', mode: 'fixed' }`
|
|
270
|
-
over a tone-97 surface goes from 22.0 to 3.5 tones above it.
|
|
271
|
-
- **High-contrast variants**, only for deltas on contrast-solved, mixed,
|
|
272
|
-
extreme, `fixed`, or `static` bases, or under a custom light `eps`: at the
|
|
273
|
-
default dark `eps`, a high-contrast dark step is now exactly the delta,
|
|
274
|
-
short of the limits below. `contrastLevel: 100` still equals the
|
|
275
|
-
high-contrast tier.
|
|
276
|
-
- **`glaze.color()` links** whose base token has its own `darkTone`, is a
|
|
277
|
-
value-form token with its own `lightTone`, or is contrast-solved or an
|
|
278
|
-
`auto` `'max'` / `'min'` on a base. They now step like any other link in
|
|
279
|
-
dark, and a `'+0'` link lands on its base there: in 2.x a `'+0'` link on an
|
|
280
|
-
`'AAA'` token over `#f7f7fb` sat 8.95 tones below it in dark. Links on
|
|
281
|
-
other `auto` bases already stepped this way; links on a `fixed` or `static`
|
|
282
|
-
base move as described for those bases above.
|
|
283
|
-
- **Other light variants** only through a float-noise tie: a contrast-solved
|
|
284
|
-
color whose preferred tone lands within 1e-9 tones of its base's (a `'+0'`
|
|
285
|
-
/ `'-0'` delta, or an absolute tone equal to the base's) takes the solver's
|
|
286
|
-
own tie rule instead of a side picked by float noise, in every scheme, so
|
|
287
|
-
it can land on the other side of its base. Under a manual `contrastLevel`,
|
|
288
|
-
a level probe that lands on its base pins no side either.
|
|
289
|
-
|
|
290
|
-
Two limits apply. The flip is still decided on the light tone, so a step
|
|
291
|
-
that fits in light can run past 0 or 100 from the anchor and stop at the dark
|
|
292
|
-
window's edge. On an `auto` base placed by a tone that happens at the bottom,
|
|
293
|
-
where the light window lifts the light tone: `'-4'` on tone 2 steps about
|
|
294
|
-
+1.7 in dark, and on tone 0 it doesn't move. On a base anchored at its own
|
|
295
|
-
dark tone it can happen at either end, in high contrast too: in
|
|
296
|
-
`glaze(280, 40)`, a `'-4'` hover on `contrast: 12` text over a tone-97
|
|
297
|
-
surface steps +2.3 in dark, not +3.5. A base sitting past the dark window
|
|
298
|
-
(pushed there by a contrast floor or an extreme, or placed there as a
|
|
299
|
-
`fixed` or `static` color) is stepped from where it sits: a step back toward
|
|
300
|
-
the window moves the full scaled delta, and one pointing further out stops
|
|
301
|
-
at the base.
|
|
302
|
-
Re-check dark values you have pinned in tests or snapshots.
|
|
303
|
-
|
|
304
|
-
### 3.0 — other changes to resolved colors
|
|
305
|
-
|
|
306
|
-
These fixes move colors that 2.x resolved from the same input. Re-check values
|
|
307
|
-
you have pinned:
|
|
308
|
-
|
|
309
|
-
- **Contrast-solved colors.** The solver keeps its 1% (WCAG) / 0.5 Lc (APCA)
|
|
310
|
-
margin and lands on the side it reports. Saturated hues that read darker
|
|
311
|
-
than their gray tone (blues, violets, reds, oranges) land on their own
|
|
312
|
-
crossing instead of stopping at the gray seed: an `'AA'` text at hue 280 and
|
|
313
|
-
saturation 100 on a light gray surface goes from 5.03:1 to 4.55:1, 2.8 tones
|
|
314
|
-
nearer its authored tone. A contrast-solved color with no tone of its own
|
|
315
|
-
on a mid-tone base, where both sides meet the floor at the same distance,
|
|
316
|
-
now keeps the side it searches first instead of a side picked by search
|
|
317
|
-
noise. It starts toward the extreme that scores higher, and darker on a
|
|
318
|
-
gray base at tone 50, so it can land on the other side of its base: in
|
|
319
|
-
`glaze(0, 0)`, `{ base: 'b', contrast: 3 }` goes from 11.3 to 84.1 on a
|
|
320
|
-
tone-45 base and from 93.6 to 20.8 on a tone-55 one. Apart from those side
|
|
321
|
-
changes, most colors move less than half a tone, a few saturated ones up to
|
|
322
|
-
about 5.
|
|
323
|
-
- **Standalone `glaze.color()` tokens** default to the `'text'` role; 2.x
|
|
324
|
-
resolved a token without a `base` as a surface. `name` no longer drives role
|
|
325
|
-
inference. An APCA floor on a token without `role` can land elsewhere:
|
|
326
|
-
`glaze.color({ from: '#ffffff', contrast: { apca: 60 } })` now gives
|
|
327
|
-
`rgb(141.23 141.23 141.23)`, not `rgb(151.87 151.87 151.87)`. Set
|
|
328
|
-
`role: 'surface'` to keep a fill's 2.x polarity. WCAG floors don't change.
|
|
329
|
-
A relative high-contrast tone on a token (`tone: [50, '+20']`) is measured
|
|
330
|
-
from the token's own color; 2.x read `'+20'` as tone 20.
|
|
331
|
-
- **Value-form `glaze.color()` links on a structured base**
|
|
332
|
-
(`glaze.color({ from, base })` with `base` made by
|
|
333
|
-
`glaze.color({ hue, saturation, tone })`), in light, and in dark where the
|
|
334
|
-
painted light tone changes which way `autoFlip` sends a step. 2.x read such
|
|
335
|
-
a base at its raw input tone in light, not at the tone it renders, so the
|
|
336
|
-
link measured against a color that is never painted: a `'+0'` link on
|
|
337
|
-
`glaze.color({ hue: 280, saturation: 80, tone: 50 })` sat 2.5 tones below
|
|
338
|
-
it, and an `'AA'` link measured 4.16:1 against it, with no warning. A
|
|
339
|
-
`'+9.8'` link on a tone-90 structured base, which fit under 100 at the raw
|
|
340
|
-
tone, now flips in light, and so lands elsewhere in dark too. Links now
|
|
341
|
-
resolve against what the base paints in every scheme.
|
|
342
|
-
- **Transparent mixes with `contrast`** solve against browser compositing
|
|
343
|
-
(`source-over` on gamma-encoded sRGB) instead of linear light. A white
|
|
344
|
-
`'AA'` overlay on a surface rendered at tone 12
|
|
345
|
-
(`{ tone: 12, mode: 'static' }`) goes from alpha 0.26, which rendered at
|
|
346
|
-
2.3:1, to 0.48; a black overlay with a 1.2:1 floor on a tone-97 surface goes
|
|
347
|
-
from 0.18 to 0.09.
|
|
348
|
-
- **`glaze(seed, config)`** applies the config. 2.x read the object form's
|
|
349
|
-
override only from a third argument, so the documented two-argument call
|
|
350
|
-
dropped it. `glaze(seed, undefined, config)` still works but is deprecated.
|
|
351
|
-
|
|
352
|
-
### 3.0 — stricter input validation
|
|
353
|
-
|
|
354
|
-
3.0 throws a `glaze:` error for input that 2.x resolved, usually into wrong or
|
|
355
|
-
`NaN` colors:
|
|
356
|
-
|
|
357
|
-
| Input | 2.x |
|
|
358
|
-
| --- | --- |
|
|
359
|
-
| A tone window with `lo > hi` (`lightTone: [90, 20]`) | Inverted the scale |
|
|
360
|
-
| A window endpoint that isn't a finite number (`NaN`, `Infinity`, `'10'`) | `NaN` colors, or a string read as a number |
|
|
361
|
-
| An object window whose `eps` is missing, not above 0, or above `1e6` | The default `eps` when missing; `NaN` colors at 0 or below and from about `1e15` |
|
|
362
|
-
| A window that isn't `[lo, hi]`, `{ lo, hi, eps }`, or `false` (`50`, `[10]`, `true`, `null`) | `NaN` colors; `configure()` ignored `null`, and a theme or token override with `null` threw a `TypeError` when it resolved |
|
|
363
|
-
| A `darkDesaturation` that isn't a finite number (`NaN`, `Infinity`, `'0.5'`, `true`) | `NaN` dark colors (`NaN`), fully gray ones (`Infinity`, `true`), or a string read as a number |
|
|
364
|
-
| A relative tone in the high-contrast entry of a root color (`tone: [50, '+20']`, no `base`) | Read `'+20'` as tone 20. Now throws: add a `base`, or write the tone you got (`[50, 20]`) |
|
|
365
|
-
| A hex color with a non-hex digit (`'#1z2z3z'`) in `glaze.color()`, `glaze.fromHex()`, a color's `from`, or the `bg` / `fg` of `glaze.shadow()` | Read only the first digit of each pair (`#010203`) |
|
|
366
|
-
| A color-function component that isn't a number (`'hsl(abc 50% 50%)'`, `'rgb(Infinity 0 0)'`) | `NaN` colors, or a silent gray |
|
|
367
|
-
| A value object with a negative `s`, `l`, `t`, or `c` (`{ l: 0.5, c: -0.05, h: 30 }`) | A plausible color: a negative chroma turned the hue around |
|
|
368
|
-
| A malformed `contrast`: a misspelled preset (`'aa'`, `{ apca: 'Body' }`), `NaN`, `{}`, both `wcag` and `apca`, or a pair without two entries | A `TypeError` from the warning code, or a color pinned to black or white; both keys used APCA, and a longer pair its first two entries |
|
|
369
|
-
| A color field that isn't a finite number (`tone: NaN`, `saturation: NaN`), a relative string that isn't `'+N'` / `'-N'` (`hue: 'abc'`, `tone: '+-5'`, `tone: '+5px'`), an `opacity` outside 0–1, or a non-finite mix `value` or shadow `intensity` | `NaN` colors, or an alpha outside 0–1; a trailing unit was read past (`'+5px'` as `'+5'`) |
|
|
370
|
-
| A theme seed whose hue or saturation isn't a finite number (`glaze({ hue: 280 })` without `saturation`, `glaze.fromRgb(NaN, 0, 0)`) | `NaN` colors |
|
|
371
|
-
| `null` for `contrastLevel` or `darkDesaturation` | Ignored: the current value stayed |
|
|
372
|
-
|
|
373
|
-
```text
|
|
374
|
-
glaze: lightTone lo (90) is above hi (20).
|
|
375
|
-
A window runs from its dark end to its light end: [lo, hi] with lo ≤ hi,
|
|
376
|
-
e.g. [20, 90].
|
|
377
|
-
|
|
378
|
-
glaze: color "a" has relative "tone" without "base".
|
|
379
|
-
|
|
380
|
-
glaze: invalid hex color "#1z2z3z".
|
|
381
|
-
|
|
382
|
-
glaze: color "text" has an invalid "contrast" "aa". Use a WCAG ratio or
|
|
383
|
-
'AA' / 'AAA' / 'AA-large' / 'AAA-large', { wcag: … }, { apca: … }, or a
|
|
384
|
-
[normal, highContrast] pair of these.
|
|
385
|
-
```
|
|
296
|
+
### 5. Trim what `extend()` doesn't need
|
|
386
297
|
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
output or `resolve()`, and so are a theme's colors. A theme or palette
|
|
391
|
-
snapshot that holds such a value still restores with `glaze.themeFrom()` /
|
|
392
|
-
`paletteFrom()` and throws on its first output, and so does a token snapshot
|
|
393
|
-
whose frozen config holds one. A token snapshot whose color value (its input,
|
|
394
|
-
or a raw `base`) 3.0 rejects throws in `glaze.colorFrom()` itself, as
|
|
395
|
-
`glaze.color()` does, and so does a theme snapshot whose seed does. Fix the
|
|
396
|
-
value in the JSON and export again.
|
|
397
|
-
|
|
398
|
-
The exported `parseHex()` / `parseHexAlpha()` return `null` for such hex, as
|
|
399
|
-
their type always allowed; 2.x read the first digit of each pair, and
|
|
400
|
-
`'#-1-2-3'` gave negative channels. Check for `null` before using the result.
|
|
401
|
-
|
|
402
|
-
Color strings also change in two ways that move colors instead of throwing. A
|
|
403
|
-
hue in `turn`, `rad`, or `grad` is converted (2.x read `hsl(0.5turn 50% 50%)`
|
|
404
|
-
as hue 0.5°, not 180°), and the CSS keyword `none` reads as 0. Out-of-range
|
|
405
|
-
color-function values clamp as CSS clamps them, which moves an `rgb()` channel
|
|
406
|
-
outside 0–255, an `okhsl()` / `okhst()` saturation outside 0–100%, a negative
|
|
407
|
-
`okhsl()` lightness (2.x gave `NaN` or a wrong tone), a negative `oklch()`
|
|
408
|
-
chroma (2.x turned its hue around), and an `oklch()` lightness below about
|
|
409
|
-
−0.37 (2.x emitted `NaN`). A saturation past 100% moves a token in dark, and
|
|
410
|
-
one outside 0–100% moves a theme color's `from` in every scheme: 2.x painted
|
|
411
|
-
its light variant out of gamut, which could turn the hue
|
|
412
|
-
(`'okhsl(200 -20% 50%)'` came out reddish), and colors solved, mixed, or lit
|
|
413
|
-
from it move with it. An `hsl()` or
|
|
414
|
-
`oklch()` lightness past its range already rendered clamped. A value object's
|
|
415
|
-
0–1 field between 1 and 1.5 clamps to 1 too, which moves a saturation there
|
|
416
|
-
the same way.
|
|
417
|
-
|
|
418
|
-
Two out-of-range values clamp instead, which can move output: window endpoints
|
|
419
|
-
clamp to 0–100 (2.x extended a `[-10, 120]` window past the range), and
|
|
420
|
-
`darkDesaturation` clamps to 0–1 (2.x let `-0.5` raise dark saturation). See
|
|
421
|
-
[Validation](./reference/configuration.md#validation).
|
|
422
|
-
|
|
423
|
-
### 3.0 — output options
|
|
424
|
-
|
|
425
|
-
Options an output method accepted but never read are gone from its type, so
|
|
426
|
-
TypeScript flags them. Delete them; the output doesn't change.
|
|
427
|
-
|
|
428
|
-
- `palette.json()` takes `GlazeJsonOptions` only: no `prefix`.
|
|
429
|
-
- `splitHue` is gone from `palette.tokens()`, `dtcg()`, `dtcgResolver()`, and
|
|
430
|
-
`tailwind()` (it left `GlazePaletteExportOptions`), and from `token.token()` /
|
|
431
|
-
`token.tasty()`.
|
|
432
|
-
- `theme.tasty()` takes the new `GlazeTastyOptions`, without `prefix`.
|
|
433
|
-
`GlazeTokenOptions` is now just `format`, `modes`, and `states`, as taken by
|
|
434
|
-
`token.token()` / `token.tasty()`.
|
|
435
|
-
- `palette.tasty()` and `palette.css()` take the new
|
|
436
|
-
`GlazePaletteTastyOptions` / `GlazePaletteCssOptions`, without `name`: their
|
|
437
|
-
hue vars are always named after each theme.
|
|
438
|
-
|
|
439
|
-
`splitHue` also stops failing silently. With a `format` other than `'oklch'`
|
|
440
|
-
it now throws instead of emitting inline colors, and a color that sets its own
|
|
441
|
-
hue under the theme hue var's name (a `brand` color with `name: 'brand'`, or a
|
|
442
|
-
color named after another theme in an unprefixed palette) throws instead of
|
|
443
|
-
rendering at the theme's hue, unless it is achromatic in light. In `css()`,
|
|
444
|
-
a color's value property that lands on a hue var (`suffix: '-hue'`, or
|
|
445
|
-
`suffix: ''` with a color named `*-hue`) throws the same way instead of
|
|
446
|
-
emitting a `var()` cycle. Hue values in its
|
|
447
|
-
declarations are rounded to 2 decimals, so a `from` color emits
|
|
448
|
-
`--logo-hue: 266.16` rather than `266.15797905637027`, and a color achromatic
|
|
449
|
-
in light no longer emits a dead `--*-hue` declaration in dark. See
|
|
450
|
-
[`splitHue`](./reference/output.md#hue-channel-splitting-splithue).
|
|
451
|
-
|
|
452
|
-
### 3.0 — contrast solver utilities
|
|
453
|
-
|
|
454
|
-
For code that calls the solver directly:
|
|
455
|
-
|
|
456
|
-
- `findValueForMixContrast()` no longer takes `targetLinearRgb`. It was
|
|
457
|
-
required in 2.x but never read: `luminanceAtValue` describes the mix. Delete
|
|
458
|
-
it from the options object; results don't change. TypeScript flags it as an
|
|
459
|
-
excess property and suggests `baseLinearRgb`, but the fix is to delete it,
|
|
460
|
-
not rename it.
|
|
461
|
-
- `findToneForContrast()` returns `branch: 'preferred'`, met, for a preferred
|
|
462
|
-
tone that clears the floor but not the 1% / 0.5 Lc margin whenever the
|
|
463
|
-
search can't improve on it: no searched side meets the floor, or the
|
|
464
|
-
starting side's only position is the preferred tone (it sits on that side's
|
|
465
|
-
bound). 2.x labelled it with the side it had searched, which could name a
|
|
466
|
-
side of the base it doesn't sit on. A WCAG search that started away from it
|
|
467
|
-
lost it to the far extreme: white at 7.24:1 against a tone-35 gray with a
|
|
468
|
-
7.2:1 floor came back as black at 2.9:1, unmet. With no room to search
|
|
469
|
-
(`toneRange`), it came back `met: false`.
|
|
470
|
-
- Results move with the solver fixes above. The WCAG gray seed is only the
|
|
471
|
-
first probe, so the [`findToneForContrast`
|
|
472
|
-
example](./reference/utilities.md#findtoneforcontrastoptions) now returns
|
|
473
|
-
tone 0.4846 at 4.55:1, not 0.4759 at 4.67:1. With no `initialDirection`, a
|
|
474
|
-
tie between the two ends' scores starts darker.
|
|
298
|
+
After migration, mark every default-only token (borders, shadows, disabled chip, code highlighting, etc.) `inherit: false`. Colored sibling themes only need the accent + tinted-surface chain — flagging the rest cuts the emitted token set per theme dramatically.
|
|
299
|
+
|
|
300
|
+
## Upgrading Glaze
|
|
475
301
|
|
|
476
302
|
### 2.0 — `format*` takes 0–1
|
|
477
303
|
|
|
478
304
|
The `format*` writers (`formatOkhsl`, `formatOkhst`, `formatRgb`, `formatHsl`,
|
|
479
|
-
`formatOklch`) used to take `s` / `l` / `t` on a 0–100 percentage scale
|
|
480
|
-
everything that
|
|
481
|
-
`srgbToOkhsl`, `oklabToOkhsl`, `okhslToSrgb`
|
|
482
|
-
the two, which is the obvious thing to do, was off by 100x and failed
|
|
483
|
-
|
|
484
|
-
|
|
305
|
+
`formatOklch`) used to take `s` / `l` / `t` on a 0–100 percentage scale while
|
|
306
|
+
everything that *produces* those values — `resolve()`, `variantToOkhsl`,
|
|
307
|
+
`srgbToOkhsl`, `oklabToOkhsl`, `okhslToSrgb` — returns them on 0–1. Composing
|
|
308
|
+
the two, which is the obvious thing to do, was off by 100x and failed silently:
|
|
309
|
+
`0.7` is a legal percentage, so you got a valid CSS string naming the wrong
|
|
310
|
+
(near-black) color.
|
|
485
311
|
|
|
486
312
|
The writers now take the 0–1 factors, so the whole library speaks one scale.
|
|
487
313
|
Drop the `* 100`:
|
|
@@ -495,49 +321,31 @@ Drop the `* 100`:
|
|
|
495
321
|
```
|
|
496
322
|
|
|
497
323
|
Nothing else moves: `h` was always 0–360, `alpha` was always 0–1, and every
|
|
498
|
-
export method (`css()
|
|
499
|
-
`tailwind()
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
the writers `console.warn` once per writer, and you get an obviously broken
|
|
508
|
-
string such as `okhsl(280 7040.68% 5000%)` instead of a plausible wrong color.
|
|
509
|
-
See [format writers](./reference/utilities.md#format-writers).
|
|
510
|
-
|
|
511
|
-
### 0.14 — `lightness` became `tone`
|
|
512
|
-
|
|
513
|
-
Colors used to be authored on OKHSL lightness. They are now authored on
|
|
514
|
-
**tone**, a contrast-uniform 0–100 axis (see [Tone and OKHST](./okhst.mdx)):
|
|
515
|
-
|
|
516
|
-
- The `lightness` prop is gone everywhere (theme colors, `glaze.color()`
|
|
517
|
-
structured input, tone deltas); use `tone`. Equal tone steps give equal
|
|
518
|
-
WCAG contrast, so numeric values don't map to the same OKHSL lightness as
|
|
519
|
-
before. Re-check absolute mid-range values.
|
|
520
|
-
- The config windows `lightLightness` / `darkLightness` became `lightTone` /
|
|
521
|
-
`darkTone`, and `darkCurve` was removed.
|
|
522
|
-
- `ResolvedColorVariant` stores `{ h, s, t, alpha }` instead of `{ h, s, l }`.
|
|
523
|
-
Use `variantToOkhsl()` to recover OKHSL lightness.
|
|
524
|
-
- Tone deltas that overshoot `[0, 100]` mirror to the other side of the base
|
|
525
|
-
by default instead of clamping. Set `autoFlip: false` on the color
|
|
526
|
-
(or globally) to clamp.
|
|
324
|
+
export method (`css()` / `tokens()` / `json()` / `tasty()` / `dtcg()` /
|
|
325
|
+
`tailwind()` / `glaze.format()`) emits the same colors — they were compensating
|
|
326
|
+
internally. Dropping the redundant `×100 ÷100` round-trip shifts float noise by
|
|
327
|
+
an ULP, which shows up nowhere except the (meaningless) hue term of a
|
|
328
|
+
fully-desaturated `hsl()` string.
|
|
329
|
+
|
|
330
|
+
A leftover `* 100` is not silent any more: a value above 1 cannot be a factor,
|
|
331
|
+
so the writers `console.warn` once per writer and you get an obviously-broken
|
|
332
|
+
`7040.68%` instead of a plausible wrong color.
|
|
527
333
|
|
|
528
334
|
## Common pitfalls
|
|
529
335
|
|
|
530
|
-
| Symptom
|
|
531
|
-
|
|
|
532
|
-
|
|
|
533
|
-
|
|
|
534
|
-
| Brand text washes out against the dark surface.
|
|
535
|
-
| Tokens look right in light
|
|
536
|
-
| A tone
|
|
537
|
-
| `palette.tokens()` emits unexpected unprefixed names.
|
|
538
|
-
| `
|
|
539
|
-
| `
|
|
540
|
-
| `
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
336
|
+
| Symptom | Cause | Fix |
|
|
337
|
+
| ------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
338
|
+
| Disabled state stops looking disabled in dark mode. | Alpha-tinted overlay on `surface-text` (which inverts), giving asymmetric perceived contrast. | Replace it with an adaptive color anchored to `surface`; use a tone delta for visual spacing or a contrast floor when required. See [Chips and disabled states](methodology.md#chips-and-disabled-states). |
|
|
339
|
+
| Brand color flips to its complement in dark mode. | Default `mode: 'auto'` inverts the tone. | Set `mode: 'fixed'` so the tone is remapped (not inverted). |
|
|
340
|
+
| Brand text washes out against the dark surface. | Foreground was anchored to `accent-surface` (the brand fill), so contrast was only enforced against that fill — not the actual surface. | Anchor `accent-text` etc. to `surface` with `mode: 'auto'`. |
|
|
341
|
+
| Tokens look right in light, broken in HC. | The HC pass bypasses the tone window — solver runs over the full `[0, 100]` range. | Add explicit `[normal, hc]` pairs to `tone` / `contrast` for the affected tokens. |
|
|
342
|
+
| A relative `tone` like `'+48'` lands on the _wrong_ (darker) side of its base. | Overshooting offsets now mirror to the other side of the base by default (`autoFlip` inherits `autoFlip`). | Set `autoFlip: false` on the color to clamp to the boundary instead, or use `tone: 'max'`/`'min'` to force the extreme. |
|
|
343
|
+
| `palette.tokens()` emits unexpected unprefixed names. | A `primary` was set on the palette (or per-call) and is duplicating the theme's tokens without prefix. | Pass `primary: false` to disable for that export, or rename `glaze.palette(themes, { primary })`. |
|
|
344
|
+
| `console.warn: token "foo" collides with theme "bar"`. | Two themes resolved to the same output key under your prefix config. | Adjust the prefix map so each token is unique, or accept the first-write-wins behavior. |
|
|
345
|
+
| `console.warn: formatOkhsl() got a value above 1`. | Pre-2.0 percentage-scale input to a `format*` writer (a leftover `* 100`). | Pass the 0–1 factors the converters return — see [2.0 — `format*` takes 0–1](#20--format-takes-01). |
|
|
346
|
+
| `console.warn: color "X" cannot meet contrast`. | The requested contrast target is physically unreachable for the color's hue/saturation against its base. | Lower the floor, change the base, or accept the closest passing variant. Use the `name` override on standalone colors to make the warning identifiable. |
|
|
347
|
+
|
|
348
|
+
## See also
|
|
349
|
+
|
|
350
|
+
- [methodology.md](methodology.md) — how to design the palette in the first place.
|
|
351
|
+
- [api.md](api.md) — full reference for every option mentioned here.
|