# Changelog

> Release notes for every cherry-styled-components version.

Source: https://docs.cherry.al/v1/code/changelog

> For the complete documentation index, see [llms.txt](https://docs.cherry.al/llms.txt).

# Changelog

Cherry Styled Components is currently at version `0.3.0`. The entries below are based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

<Update label="0.3.0" description="2026-11-23">

Light and dark mode now switch through CSS variables. The theme your components see is one object for both modes, whose colors and shadows are `var(--cherry-...)` references, and the mode is a `dark` class on `<html>`. A switch flips the class and the browser repaints: no styled component renders again (538 re-renders and 921 CSS transitions per toggle on the demo page before, none now), and the page changes at once instead of fading control by control. Every component looks exactly as in 0.2.24 in both modes. See [Dark Mode](/v1/code/dark-mode) and [Theming through CSS variables](/v1/code/theme#theming-through-css-variables).

<Badge color="green" size="sm">Added</Badge>

- `createThemeVariables(theme, themeDark?)`: builds the CSS-variable theme, the stylesheet behind it (light values on `:root`, dark ones on `:root.dark`) and both resolved palettes. The providers call it for you; it is server-safe, for rendering the stylesheet or reading the palettes in server code. See [Theme](/v1/code/theme#createthemevariables)
- `useColorMode()`: the mode in force, the visitor's preference (`"light"`, `"dark"` or `"system"`), `setPreference` and `toggleTheme`. Only components that call it render again when the mode switches. See [Hooks](/v1/code/hooks#usecolormode)
- `useResolvedTheme()`: the theme with real color values for the mode in force, plus `isDark`, for code that hands a theme color to something CSS does not style (a canvas, a JS color library, an editor theme). See [Hooks](/v1/code/hooks#useresolvedtheme)
- `modes()`: wraps a styled interpolation written against `theme.isDark` and emits CSS that follows the mode, so most existing `isDark` branches migrate by wrapping them: `${modes(({ theme }) => (theme.isDark ? theme.colors.gray : theme.colors.grayLight))}`. `modeValue(light, dark)` is the plain-CSS form. See [Dark Mode](/v1/code/dark-mode#styles-that-differ-by-mode)
- A "system" preference: visitors who never choose a mode follow the OS, live. An explicit choice is stored as `themePreference` in localStorage, and the mode in force is mirrored to the `theme` cookie
- `$mode` prop on both providers: pins a mode without storing anything (toggling does nothing while it is set)
- `colors.primaryFillHover`: an optional token for the hover shade of the solid primary fill
- `ThemeInitScriptOptions` type

<Badge color="blue" size="sm">Changed</Badge>

- **Breaking:** `Theme.isDark` is gone. Components receive one theme for both modes, so a style can no longer branch on the mode in JS; TypeScript now flags every `theme.isDark` read. Replace each one with a mode token (`accent`, `link`, `onFilled`, `primaryTint*`, `shadows.toast`), a `:root.dark &` rule, or `modes()`. Remove `isDark` from your own theme objects
- **Breaking:** theme colors and shadows are CSS variables inside styled components, so JS code that parses or computes with them (polished's `darken()`, `rgba()`, `readableColor()` and the like) gets `var(--cherry-color-primary)` instead of a hex value. Use the native `color-mix()` helpers `alpha`, `shade` and `tint`, or read real values from `useResolvedTheme()`
- **Breaking:** `ThemeContext` provides `{ toggleTheme, setPreference }`. `setTheme(themeObject)` is gone: call `setPreference("light" | "dark" | "system")`
- **Breaking:** `createThemeInitScript()` takes an options object, `{ themeColor?: { light, dark } | false }`, instead of `(darkBackground, darkThemeColor)`. The script now sets the `dark` class before the first paint on every load (not only the first visit), so it no longer hides the page or needs a background color. Keep rendering `themeInitScript` (or your own instance) in the document `<head>` of a server-rendered app
- `CherryThemeProvider` and `ClientThemeProvider` share one implementation and keep their props (`theme`, `themeDark`, `$themeColor`, `$globalStyles`). `$initial` now only sets the mode `useColorMode()` reports during the server render; the colors no longer depend on it. Without `themeDark` the page stays light
- The mode tokens (`accent`, `link`, `onFilled`, `primaryTintHover`, `primaryTintDrop`, `primaryTintActive`, `shadows.toast`) are always filled in per mode by the providers. `accentColor`, `linkColor`, `primaryTintColor` and `filledTextColor` read the tokens. See [Mixins](/v1/code/mixins#mode-token-helpers)
- The providers render the variables as a plain `<style data-cherry-theme>` element, outside styled-components, whose CSS preprocessor drops the empty custom properties `modeValue()` relies on
- A mode switch turns transitions off for the frame that paints it (`.theme-switching` on `<html>`), so colors change at once. The [ThemeToggle](/v1/code/theme-toggle) knob jumps instead of sliding for the same reason

<Badge color="red" size="sm">Removed</Badge>

- **Breaking:** `darkFilledTextRule` and `darkPrimaryTintRule`. The mode tokens they patched now always follow the mode: drop the calls and keep `filledTextColor` / `primaryTintColor`

<Badge color="purple" size="sm">Migrating from 0.2</Badge>

Your providers keep their `theme` and `themeDark` props. What changes is code that reads the mode or computes with theme colors:

1. Remove `isDark` from your own theme objects.
2. Replace every `theme.isDark` read in your styles with a mode token, a `:root.dark &` rule, or `modes()`:

```tsx
import styled from "styled-components";
import { modes } from "cherry-styled-components";

// Before: border-color: ${({ theme }) => (theme.isDark ? gray : grayLight)}
const Card = styled.div`
  border-color: ${modes(({ theme }) =>
    theme.isDark ? theme.colors.gray : theme.colors.grayLight,
  )};

  :root.dark & {
    outline: 1px solid ${({ theme }) => theme.colors.grayDark};
  }
`;
```

3. Replace JS color math on theme colors (`darken()`, `rgba()`, `readableColor()`) with `alpha`, `shade` and `tint`, or read real values from `useResolvedTheme()`.
4. Replace `setTheme(themeObject)` with `setPreference("light" | "dark" | "system")`.
5. Replace `createThemeInitScript(darkBackground, darkThemeColor)` with `createThemeInitScript({ themeColor: { light, dark } })`, or `{ themeColor: false }`. Keep the script in the `<head>` of a server-rendered app.
6. Drop `darkFilledTextRule` and `darkPrimaryTintRule` calls.
7. `$initial` now only affects `useColorMode()` during the server render. To force a mode, use `$mode`.

Visitors keep their choice: a `theme` entry in localStorage written by an earlier version counts as their explicit preference.

</Update>

<Update label="0.2.24" description="2026-11-18">

<Badge color="green" size="sm">Added</Badge>

- [Toast](/v1/code/toast): a redesigned card. A colored icon tile whose glyph draws itself in once the card lands, a bold title, an optional `description` line, an optional `action` button (a small Cherry [Button](/v1/code/button) that runs `onClick` and then dismisses) and a close badge on the corner that shows on hover or focus (always on touch screens)
- [Toast](/v1/code/toast): two more colors. `"default"` has no icon tile, for plain messages like "Message archived"; `"loading"` shows the [Spinner](/v1/code/spinner) and never hides itself
- [Toast](/v1/code/toast): a collapsed deck. The newest toast sits in front and older ones peek out behind it, smaller, with their content hidden. Hovering, focusing or tapping the stack fans it out and pauses auto-hide, which also pauses while the tab is hidden. Swipe a toast toward its edge or sideways to dismiss it, or press Escape while it has focus
- `ToastNotifications` props `$expand` (keep every toast fanned out, the old list look) and `$visibleToasts` (how many show at once, default `3`)
- `useToastNotifications()` returns `updateNotification(id, update)` to change a toast in place, `dismissNotification(id)` to remove one with its exit animation, and `promiseNotification(task, { loading, success, error }, config?)`, which shows a loading toast and swaps it to success or error when the promise settles (settled toasts hide after 4 seconds unless `autoHide` says otherwise)
- `ToastConfig` gains `description`, `action`, `dismissible` (close badge and swipe, default `true`) and `id` (reuse an id to replace that toast in place). New exported types: `ToastAction`, `ToastUpdate`, `ToastPromiseMessages`, `ToastNotification`
- `ThemedGlobalStyles`: Cherry's global styles as one component that reads the active theme from the `ThemeProvider`. See [Global Styles](/v1/code/global-styles)

<Badge color="blue" size="sm">Changed</Badge>

- `addNotification` returns the new toast's id
- A toast's text is typed `React.ReactNode` instead of `string`. Existing calls are unaffected
- The toast stack is a fixed-width column (`min(380px, 100vw - 40px)`) anchored by `$align` and `$bottom`, instead of a full-width strip of pills

<Badge color="orange" size="sm">Fixed</Badge>

- `CherryThemeProvider` and `ClientThemeProvider` no longer crash in development with "Rendered fewer hooks than expected". Since 0.2.23 they built the global style component inside `useMemo`, and styled-components' development build calls a hook whenever a styled component is created, which React rejects there. Both providers now render the module-level `ThemedGlobalStyles`. Production builds were not affected

</Update>

<Update label="0.2.23" description="2026-11-15">

<Badge color="green" size="sm">Added</Badge>

- Optional mode tokens in the theme, for a theme whose colors are CSS variables (one theme object for both modes, the mode switched by a `dark` class on `<html>` or a `data-theme` attribute, so a switch repaints without re-rendering): `colors.accent` (hover and emphasis text), `colors.link` (links in `GlobalStyles`), `colors.onFilled` (the label on a filled control), `colors.primaryTintHover`, `colors.primaryTintDrop` and `colors.primaryTintActive` (the primary tints behind a hovered or dragged-over [Dropzone](/v1/code/dropzone) and [AvatarDropzone](/v1/code/avatar-dropzone) and an active [IconButton](/v1/code/icon-button)) and `shadows.toast`. Each replaces a `theme.isDark` choice and falls back to it when unset, so themes without them render exactly as before. See [Theme](/v1/code/theme)
- `accentColor`, `linkColor`, `primaryTintColor` and `darkPrimaryTintRule` mixins, for the same choices in your own components. See [Mixins](/v1/code/mixins)

<Badge color="blue" size="sm">Changed</Badge>

- `isDark` is optional in the `Theme` type. Absent reads as light
- `darkFilledTextRule` returns an empty rule when the theme sets `onFilled`, whose value already follows the mode; the `:root.dark` tint rules of the dropzones, the active `IconButton` and the [ThemeToggle](/v1/code/theme-toggle) glyph are skipped the same way when the theme sets their token
- [Callout](/v1/code/callout) also follows a `data-theme="dark"` or `data-theme="light"` ancestor, so a section forced into one mode keeps that mode's tint

<Badge color="orange" size="sm">Fixed</Badge>

- `CherryThemeProvider` and `ClientThemeProvider` build their global styles once per theme instead of on every render, which re-injected the global sheet on each update. See [Global Styles](/v1/code/global-styles)

</Update>

<Update label="0.2.22" description="2026-11-14">

<Badge color="green" size="sm">Added</Badge>

- An optional `primaryFill` color in the theme: the fill of the solid primary surfaces (the primary [Button](/v1/code/button), the sent [ChatMessage](/v1/code/chat-messages) bubble, the primary [Avatar](/v1/code/avatar)), whose label is `onPrimary`. Set it when `primary` is too bright to carry a label but right for accents: the fills take the deeper shade and links, rings and outlines keep `primary`. The filled primary button's hover is a 10% shade of it. Themes without `primaryFill` render exactly as before. See [Theme](/v1/code/theme)
- `primaryFillColor` and `primaryFillHoverColor` mixins, for your own primary-filled surfaces. See [Mixins](/v1/code/mixins)

</Update>

<Update label="0.2.21" description="2026-11-14">

<Badge color="green" size="sm">Added</Badge>

- An optional `onPrimary` color in the theme: the label color for text on a `primary` fill. Set it when neither `light` nor `dark` reads on the theme's primary, such as a bright dark-mode primary that light text cannot sit on. See [Theme](/v1/code/theme)
- `filledTextColor` and `darkFilledTextRule` take an optional fill (`"primary"` or `"other"`, the default). On a primary fill they return the theme's `onPrimary` when it has one (in `darkFilledTextRule`, only for a dark theme object, which knows its dark value); otherwise the palette's contrasting end, as before. See [Mixins](/v1/code/mixins)

<Badge color="orange" size="sm">Fixed</Badge>

- The primary [Avatar](/v1/code/avatar), the sent [ChatMessage](/v1/code/chat-messages) bubble and the primary [Button](/v1/code/button) use the theme's `onPrimary` when it sets one. A theme whose dark-mode primary is a bright color (an orange, a yellow) showed light initials and text on it at about 2.5:1; it can now give a dark label that reads. Themes without `onPrimary` render exactly as before

</Update>

<Update label="0.2.20" description="2026-10-23">

<Badge color="green" size="sm">Added</Badge>

- [Modal](/v1/code/modal)s stack. A modal opened over an open one (a "confirm with a code" step over a form, say) no longer shows on top of it: the open modal's card sinks out first, then the new card rises in over the same backdrop, and closing the top one plays it backwards. The modal underneath stays mounted while it is covered, so whatever was typed in it is still there when it comes back, and it ignores <kbd>Esc</kbd> and clicks outside, which belong to the modal on top. Before, both cards showed at once, and a click inside the top modal counted as a click outside the one under it, which closed it
- `$stack` on `Modal` (default `true`). Pass `$stack={false}` to keep the previous behaviour for that modal: it neither hides the modals under it nor steps aside for the ones opened over it
- `useModalLayer(open)` puts a full-page layer that is not a `Modal` (an outage screen, a sign-in wall) on the same stack while `open`: an open modal fades away under it and comes back once it is gone. Returns whether another layer covers it. See [Hooks](/v1/code/hooks)

</Update>

<Update label="0.2.19" description="2026-10-22">

<Badge color="orange" size="sm">Fixed</Badge>

- [IconButton](/v1/code/icon-button) keeps its circle when a parent rule sets the width or height of the buttons inside it. A container with `& button { width: auto }` (a common way to stretch or reset an action row) overrode the fixed size and collapsed the button into a narrow oval around its glyph; `width: 100%` stretched it into a pill. The box is now pinned with matching `min-`/`max-` width and height, so only the `$size` prop decides it

</Update>

<Update label="0.2.18" description="2026-10-06">

<Badge color="orange" size="sm">Fixed</Badge>

- A [Toggle](/v1/code/toggle) that is both `disabled` and checked is grayed out like a disabled unchecked one. The checked fill rule outranked the disabled rule, so a locked-on switch (a "Necessary cookies, always on" row, for example) kept its primary fill under a gray knob and border and looked half broken. The disabled styles now match on `:disabled`, which also covers a toggle inside a disabled `<fieldset>`, and explicitly win over the checked state
- The demo's Toggle row shows the disabled off and disabled on states, so the case is visible at every size

</Update>

<Update label="0.2.17" description="2026-09-06">

<Badge color="green" size="sm">Added</Badge>

- `Icon` takes an `icon` prop: an imported Lucide component, `import { ArrowRight } from "lucide-react"` then `<Icon icon={ArrowRight} />`. It costs exactly that glyph, tree-shakes, and renders on the server. The prop is typed `IconComponent`, any component that accepts `IconGlyphProps` (`size`, `color`, `className` and the aria attributes), so a custom SVG component or another icon set works as well. See [Icon](/v1/code/icon)
- `cherry-styled-components/dynamic` subpath exporting `DynamicIcon`, for an icon chosen at runtime (CMS content, user settings): `<DynamicIcon name="arrow-right" />` resolves the name on demand through `lucide-react/dynamic`, accepts Lucide's PascalCase export name or kebab-case id, and renders nothing for an unknown name. The glyph appears after hydration and never in server-rendered HTML. Only apps that import the subpath carry Lucide's dynamic import map, which bundlers turn into one small chunk per icon; nothing on the main entry references it. Also exports `IconName`, the accepted names, and `DynamicIconProps`
- `IconSource` (`IconComponent | ReactElement`, what `$icon`-style props accept) and `renderIcon(source, props)` (renders one, for components that forward such a prop) are exported. [Avatar](/v1/code/avatar), [AvatarDropzone](/v1/code/avatar-dropzone) and [Dropzone](/v1/code/dropzone) (`$icon`), [Callout](/v1/code/callout) (`$icon`), [ChatPanel](/v1/code/chat-panel) (`$titleIcon`) and [Spinner](/v1/code/spinner) (`icon`) take an imported component, which they size, or a rendered element, used as given, so a runtime-chosen icon is `$icon={<DynamicIcon name={n} />}`

<Badge color="blue" size="sm">Changed</Badge>

- <Badge solid color="error" size="sm">Breaking</Badge> `<Icon name="...">` is gone from the main entry; `Icon` renders only an `icon` component. Move every call site to `icon={ImportedGlyph}`; for a name that comes from data, import `DynamicIcon` from `cherry-styled-components/dynamic`. The `$icon`-style props above no longer accept a string, and `Spinner` drops `name`. `IconProps` is now the props interface of `Icon`, as on every other component; the name union it used to be lives on as `IconName` in the `/dynamic` subpath
- <Badge solid color="error" size="sm">Breaking</Badge> `lucide-react` is a peer dependency instead of a dependency. Apps import glyphs from it themselves now, so install it alongside Cherry (see [Installation](/v1/code/installation)); one copy shared by the app and the library keeps every glyph bundled once
- Every internal component imports the glyphs it draws straight from `lucide-react`: `X` for Modal and Toast, `ChevronDown` for Select and Accordion, `Sun` and `MoonStar` for ThemeToggle, and so on. Until now the shared `Icon` did `icons[name]` over the full Lucide map, so mounting any Select, Modal, Toast, Input, Spinner or ThemeToggle shipped all 1,800 icons, roughly 500 KB (133 KB gzipped), on every page of every consumer whatever the app itself imported. The demo app's entry bundle drops from 864 KB to 355 KB
- `tsconfig.json` sets `module` to `ESNext` (was `ES6`); the published output is unchanged

</Update>

<Update label="0.2.16" description="2026-08-14">

<Badge color="blue" size="sm">Changed</Badge>

- <Badge solid color="error" size="sm">Breaking</Badge> `StyledComponentsRegistry` now ships from the `cherry-styled-components/next` subpath instead of the package root. Update the import in your Next.js `layout.tsx` to `import { StyledComponentsRegistry } from "cherry-styled-components/next";`. Every other export is unchanged and still comes from `cherry-styled-components`. The registry is the only export that imports `next/navigation`, and re-exporting it from the barrel forced every consumer to resolve Next just to import a `Button`: a plain Vite app importing nothing but `Button` failed to build with `Failed to resolve import "next/navigation"`, and `sideEffects: false` could not save it because resolution happens before tree-shaking. Vite, CRA, Remix, Astro, and plain Rollup consumers now need no Next install and no bundler externals. See [Installation](/v1/code/installation)
- Dependency bumps: `lucide-react` 1.28.0 → 1.31.0, `styled-components` 6.5.0 → 6.5.2, `vite` 8.2.0 → 8.2.1, `next` 16.3.0 → 16.3.1

<Badge color="orange" size="sm">Fixed</Badge>

- `useOnClickOutside` (and with it [Modal](/v1/code/modal)): a mousedown that no user press can account for is no longer read as a click outside while a native OS picker is engaged. iOS draws the pickers behind `<select>` and `<input type="date|datetime-local|month|time|week">` outside the web view, so the taps that drive them never reach the DOM; when the picker resolves, WebKit still emits a stray mousedown whose target sits outside the component, which dismissed the entire dialog the moment a user set a date inside a `Modal` on iPhone. The hook now records genuine presses (`pointerdown`/`touchstart`, capture phase, one shared listener set for all instances) and ignores events that arrive with no press behind them while such a control holds focus or gave it up within the last 400ms. Backdrop taps, the close button, <kbd>Esc</kbd>, and clicks inside behave exactly as before

</Update>

<Update label="0.2.15" description="2026-08-04">

<Badge color="orange" size="sm">Fixed</Badge>

- `createThemeInitScript`: the first-visit dark branch now also rewrites `<meta name="theme-color">` (updating the existing tag or creating one, and pruning media-scoped duplicates, mirroring `ClientThemeProvider`'s sync), so browser chrome that tints from it — the Safari tab bar, Android Chrome's toolbar — no longer holds the light server-rendered color until hydration on a cookieless dark-OS visit from browsers without `Sec-CH-Prefers-Color-Scheme`. The window is the whole load on a slow connection, and neither the server (no cookie to resolve) nor the provider's post-hydration effect can close it. A new optional second parameter `darkThemeColor` (defaults to `darkBackground`, so existing calls keep tracking the page background like the provider's default `$themeColor: "light"`) sets the value written; pass your dark theme's token value when the provider uses a non-default `$themeColor`, e.g. `createThemeInitScript(themeDark.colors.light, themeDark.colors.primary)` for `$themeColor="primary"`. See [Dark Mode](/v1/code/dark-mode)

<Badge color="blue" size="sm">Changed</Badge>

- Dependency bumps: `styled-components` 6.4.4 → 6.5.0

</Update>

<Update label="0.2.14" description="2026-08-04">

<Badge color="blue" size="sm">Changed</Badge>

- [ChatLauncher](/v1/code/chat-launcher): the button is now pinned to the 30px compact header-control tier (`box-sizing: border-box; height: 30px`, inner row `height: 100%`) instead of hugging its content, so its height cannot drift with platform font metrics and always matches neighboring header controls like the docs search button; rendered output is unchanged in browsers where the content already resolved to 30px

<Badge color="orange" size="sm">Fixed</Badge>

- `ChatProvider`: opening the panel (launcher click, <kbd>Command</kbd> + <kbd>I</kbd> / <kbd>Ctrl</kbd> + <kbd>I</kbd>, or `ask()` from a search modal) now commits the open with `flushSync` and focuses the composer synchronously inside the triggering gesture. iOS Safari ignores `focus()` (and never raises the keyboard) once the tap gesture has passed, so the previous deferred-only focus opened the panel with an unfocused input on iPads and iPhones; the deferred focus remains as a fallback for lazily mounted composers
- [Prose](/v1/code/prose): a top-level `.code-wrapper` block (an app's framed code component) now carries the block rhythm (`10px` in `$compact`, `20px` otherwise); previously only its inner `pre` was addressed, so framed code blocks sat flush against neighboring elements
- `ChatSources`: the chip row now separates itself from preceding content with a 10px top margin (the answer body trims its own trailing margin, so the chips sat flush against the last line); standalone first-child usage stays margin-free

</Update>

<Update label="0.2.13" description="2026-08-03">

<Badge color="green" size="sm">Added</Badge>

- Chat kit: a complete, transport-agnostic chat UI (`ChatProvider`/`useChat`, `ChatPanel`, `ChatMessageList`, `ChatMessage`, `ChatInput`, `ChatLauncher`, `ChatTyping`, `ChatSources`). The provider is headless: it owns panel open/close state with focus capture and restore, the transcript, and streaming bookkeeping via an `onSend(question, { signal, history, setAssistant })` contract supplied by the app, so Cherry never fetches. `ChatPanel` renders as a drawer, inline surface, or fullscreen, with dialog semantics below the `lg` breakpoint (focus trap, inert siblings, Escape to close, body scroll lock), and <kbd>Command</kbd> + <kbd>I</kbd> (<kbd>Ctrl</kbd> + <kbd>I</kbd> on Windows) toggles the panel. See [Chat](/v1/code/chat)
- Opt-in `$showcase` demo mode on `ChatProvider`: commands (`help`, `list`, `callout`, `avatar`, `prose`, `sources`, `typing`) are answered locally with live rendered element demos, no backend required
- Opt-in `$glow` treatment on [ChatInput](/v1/code/chat-input) and [ChatLauncher](/v1/code/chat-launcher): rotating rainbow border, inside-out focus/active rings matching Cherry's input state mechanics, ambient radiating glow, and sparkles
- `Spinner` component: a rotating lucide icon (default `LoaderCircle`) with a 1s linear spin, disabled under `prefers-reduced-motion`. Its default color resolves from `theme.colors.dark` rather than inheritance, so it stays visible when the theme flips; an explicit `color` prop still wins. The chat send button now renders it in place of its local spin implementation. See [Spinner](/v1/code/spinner)
- Supporting components [Avatar](/v1/code/avatar), [Callout](/v1/code/callout), and [Prose](/v1/code/prose)
- `useLockBodyScroll`, `useMediaQuery`, and `useBelowBreakpoint` hooks, exported from the package root. See [Hooks](/v1/code/hooks)
- `thinScrollbar` mixin for slim internal scroll areas; `filledTextColor` and `darkFilledTextRule` extracted from `Button` into the shared mixins. See [Mixins](/v1/code/mixins)

<Badge color="orange" size="sm">Fixed</Badge>

- Chat drawer auto-scroll always lands on the last message: it re-arms with an instant jump whenever the panel opens or reopens, and follow re-engages on the rising edge of loading (a send) even if the reader had scrolled up
- `ChatLauncher` glow transitions no longer shake: the rainbow accent is now three fixed-geometry gradient layers (1px hover, 2px pressed, 4px focus) sharing one conic gradient and cross-fading opacity, instead of a single band animating its geometry every frame
- Chat polish: message avatars center on a one-line message and ride the visible bottom edge of replies taller than the scrollport; the composer receives focus each time an overlay panel opens; `Prose` headings use Cherry's typography mixins (shifted down two steps in `$compact` mode) instead of the browser's em-relative UA sizes

<Badge color="blue" size="sm">Changed</Badge>

- Dependency bumps: `vite` 8.1.5 → 8.2.0, `playwright-core` 1.62.0 → 1.62.1, `@types/react` 19.2.17 → 19.2.18, `@types/react-dom` 19.2.3 → 19.2.4

</Update>

<Update label="0.2.12" description="2026-07-30">

<Badge color="green" size="sm">Added</Badge>

- New `alpha(color, percent)`, `shade(color, percent)`, and `tint(color, percent)` color helpers, exported from the package root. `alpha` fades a color to `percent` opacity, `shade` darkens it `percent` toward black, and `tint` lightens it `percent` toward white. They return a native CSS `color-mix(in srgb, ...)` string rather than a computed hex, so the input can be any valid CSS color, including a `var(--token)` reference that only the browser can resolve. See [Mixins](/v1/code/mixins)

<Badge color="red" size="sm">Removed</Badge>

- The `polished` dependency. `Button`, `IconButton`, `AvatarDropzone`, `Dropzone`, `Modal`, `Tabs`, `ThemeToggle`, and the `errorInteractiveStyles` mixin now derive their shades with the new `alpha` / `shade` / `tint` helpers instead of `lighten` / `darken` / `rgba`, and `polished` is no longer listed as a build external. If your own code imported `polished` by way of Cherry's transitive dependency, install it directly

<Badge color="orange" size="sm">Fixed</Badge>

- `Button`, `IconButton`, `AvatarDropzone`, `Dropzone`, and `ThemeToggle` gained `:root.dark` selector fallbacks, so dark styling applies immediately from the pre-hydration `dark` class on `<html>` instead of waiting for the theme object to swap
- `ClientThemeProvider`: the html `dark` class is no longer toggled before mount reconciliation has decided the real mode. `themeInitScript` may already have set the class from the cookie for the first paint, and syncing it against the not-yet-reconciled server theme stripped it for a frame
- `ClientThemeProvider`: `$themeColor` now resolves CSS custom properties before writing the `theme-color` meta tag. Apps that theme through custom properties store `var(--token)` in the theme object, and a meta tag cannot resolve that value itself

<Badge color="blue" size="sm">Changed</Badge>

- Dependency bumps: `lucide-react` 1.27.0 → 1.28.0, `@vitejs/plugin-react-swc` 4.3.2 → 4.3.3

</Update>

<Update label="0.2.11" description="2026-07-12">

<Badge color="green" size="sm">Added</Badge>

- `ThemeToggle`: new `$shortcut` prop that binds the <kbd>Command</kbd> + <kbd>Shift</kbd> + <kbd>L</kbd> (<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>L</kbd> on Windows) keyboard shortcut while the toggle is mounted, flipping between the light and dark theme without a click. Off by default, so existing toggles are unaffected. Like the button's click handler it calls `toggleTheme` from `ThemeContext`, and it stays a no-op until a `themeDark` is passed to the provider. The listener is bound to `window` and removed on unmount; it requires Shift and forbids Alt so it stays clear of the browser's <kbd>Command</kbd> + <kbd>L</kbd> (<kbd>Ctrl</kbd> + <kbd>L</kbd> on Windows) address-bar shortcut

</Update>

<Update label="0.2.10" description="2026-07-08">

<Badge color="red" size="sm">Removed</Badge>

- <Badge solid color="error" size="sm">Breaking</Badge> removed the custom `IconCheck`, `IconArrow`, and `IconCalendar` exports. They were hand-rolled SVGs duplicating existing Lucide glyphs. The form controls that used them now render the built-in `Icon` component instead: the checkbox check mark uses `Check`, the `Select` dropdown arrow uses `ChevronDown`, and the date/time calendar glyph uses `CalendarDays`. These icons now take their color from `currentColor` (the theme's primary color, applied via CSS) rather than a hard-coded stroke. The checkbox check mark renders with a 6px stroke, and the `Select` arrow now sizes to 24px to match the date/time calendar glyph. Replace any direct usage with `<Icon name="Check" />`, `<Icon name="ChevronDown" />`, or `<Icon name="CalendarDays" />`

</Update>

<Update label="0.2.9" description="2026-07-06">

<Badge color="green" size="sm">Added</Badge>

- AI assistant skill in `skills/cherry-design-system/`: a [Claude Agent Skill](https://docs.claude.com/en/docs/claude-code/skills) (`SKILL.md` plus `references/` covering setup, theme tokens, the full component API, and recipes) that teaches LLMs to build with Cherry correctly, always using Cherry components for buttons and form controls, reading design values from the theme, and wiring the provider. Includes a portable `AGENTS.md` for other agents and points at the live docs (`cherry.al/llms.txt` and per-page `.md`). Documentation only, not part of the published npm package; install with `npx skills add cherry-design-system/styled-components`

<Badge color="blue" size="sm">Changed</Badge>

- `Accordion`: the clickable title is now a native `<button type="button">` (with a button reset) instead of an `<h3 role="button">`, so it is keyboard-focusable and Enter/Space-activatable natively; `aria-expanded` is preserved, and a `:focus-visible` outline in the primary color was added for keyboard users
- `Tabs`: tab labels bumped to `font-weight: 700` (was 600); the `:focus-visible` ring was retuned (corner `radius.xs` → `radius.lg`, inset `-4px` → `-2px`)
- `Input`: removed the unused `children` prop from `InputProps`. `Input` renders a void `<input>`, so any children were silently ignored; dropping it from the type turns that into a compile-time error

</Update>

<Update label="0.2.8" description="2026-07-04">

<Badge color="orange" size="sm">Fixed</Badge>

- `Input`: small-size date and time inputs now render the calendar icon at 18px instead of the default 24px, with the native `::-webkit-calendar-picker-indicator` click target repositioned to stay aligned with the visible icon

</Update>

<Update label="0.2.7" description="2026-07-04">

<Badge color="orange" size="sm">Fixed</Badge>

- `Dropzone` / `AvatarDropzone`: text now inherits the surrounding font family instead of pinning the theme's `fonts.text`, matching the `font-family: inherit` convention used by Button, Input, Select, and Textarea. The root `<button>` elements set `font-family: inherit` explicitly, since buttons don't inherit fonts by default

</Update>

<Update label="0.2.6" description="2026-07-04">

<Badge color="orange" size="sm">Fixed</Badge>

- `Toast`: centered stacks no longer wrap their text prematurely. The notifications list is now a full-width strip (20px side margins) for every alignment instead of being anchored at `left: 50%`, which capped its shrink-to-fit width at about half the viewport, most visibly on mobile
- `Toast`: the notification strip and rows no longer swallow clicks on page content beside them; `pointer-events` is re-enabled only on the visible pill itself

</Update>

<Update label="0.2.5" description="2026-07-03">

<Badge color="blue" size="sm">Changed</Badge>

- Hover styles apply on all devices again: removed the `@media (hover: hover)` guards around `&:hover` rules in `interactiveStyles`, `errorInteractiveStyles`, `Dropzone`, `AvatarDropzone`, `Tabs`, and `ThemeToggle`

</Update>

<Update label="0.2.4" description="2026-07-03">

<Badge color="green" size="sm">Added</Badge>

- `Tabs` / `TabContent`: new tabbed-panels component with tablist/tab/tabpanel ARIA semantics, roving-tabindex arrow-key navigation (ArrowLeft/ArrowRight cycle, Home/End jump), and optional controlled selection via `activeTab` + `onTabChange` (`defaultActiveTab` for uncontrolled use)
- `IconButton`: `$active` prop for a toggle-like "on" state (primary border, translucent primary background); reflected as `aria-pressed` when set

<Badge color="blue" size="sm">Changed</Badge>

- `ThemeToggle`: swapped the scale hover/press effects for the shared `interactiveStyles` hover border + focus ring, and aligned the sun/moon icons exactly with the sliding knob

</Update>

<Update label="0.2.3" description="2026-07-03">

<Badge color="green" size="sm">Added</Badge>

- `Modal`: `style` passthrough on the overlay root, complementing `className` for app-level restyling

<Badge color="orange" size="sm">Fixed</Badge>

- `Modal`: corrected the restyling guidance in the prop docs. `styled(Modal)` cannot forward the `$`-props API, since styled-components strips transient props before they reach the wrapped component; restyle by passing a `className` and targeting the class hooks instead

</Update>

<Update label="0.2.2" description="2026-07-03">

<Badge color="green" size="sm">Added</Badge>

- `Modal`: `$hideCloseButton` prop to omit the built-in close button
- `Modal`: `className` passthrough on the overlay root for app-level restyling; inner parts expose stable class hooks (`.modal-inner`, `.modal-close`, `.modal-title`, `.modal-content`)
- `Modal`: `role="dialog"`, `aria-modal="true"`, and `aria-label` (from `$title`) on the dialog surface

<Badge color="blue" size="sm">Changed</Badge>

- <Badge solid color="warning" size="sm">Breaking-ish</Badge> `Modal` now unmounts its children once the exit animation finishes instead of keeping them mounted (hidden) while closed. Children such as forms reset their state between openings. The enter/exit motion is unchanged visually (fade + 40px rise) but is now driven by keyframes instead of transitions
- `useOnClickOutside` subscribes its document listener once per mount (latest-ref pattern) instead of re-subscribing whenever callers pass inline ref arrays or callbacks

<Badge color="orange" size="sm">Fixed</Badge>

- `useOnClickOutside` ignores unattached (null) refs instead of suppressing the callback entirely when any ref in the array is not mounted

</Update>

<Update label="0.2.1" description="2026-07-03">

<Badge color="green" size="sm">Added</Badge>

- `removeNotification(id)` on the toast context, returned by `useToastNotifications` alongside `addNotification`; each toast in `notifications` now carries a unique `id`
- Toast stack is an `aria-live="polite"` region, so screen readers announce new toasts

<Badge color="blue" size="sm">Changed</Badge>

- Toast internals reworked: state and variants are typed `$` props on a new `StyledNotificationItem` instead of className strings, each toast manages its own enter/exit lifecycle, and the space collapse animates the toast's real height via `grid-template-rows` instead of a `max-height` guess, so entering and exiting toasts glide instead of snapping
- Bottom-anchored toasts (`$bottom`) slide up from below instead of dropping down from above

<Badge color="orange" size="sm">Fixed</Badge>

- Dismissed and auto-hidden toasts are removed from state and the DOM after their exit animation instead of accumulating invisibly forever

</Update>

<Update label="0.2.0" description="2026-07-03">

<Badge color="green" size="sm">Added</Badge>

- `ThemeToggle` component: a pill-shaped sun/moon switch for light and dark mode
- `ClientThemeProvider`: SSR-aware theme provider with flash-free dark mode. Renders the server-resolved theme on first paint, reconciles against the `theme` cookie and OS preference on mount, persists changes to cookie and localStorage (no API route needed), migrates legacy localStorage-only preferences, and keeps the html `dark` class and `theme-color` meta tag in sync. Supports `$initial`, `$themeColor`, and `$globalStyles` props
- `themeInitScript` and `createThemeInitScript(darkBackground)`: blocking head script that seeds the `theme` cookie and prevents the dark-mode flash in browsers without color-scheme client hints (Safari, Firefox). Exported from a server-safe module so it can be used in server components
- `resolveTheme(cookieValue, theme, themeDark)` helper for resolving the `theme` cookie to a theme object in server code
- `toggleTheme()` on `ThemeContext`, provided by both theme providers
- `interactiveStyles` and `errorInteractiveStyles` mixins: hover/focus/active border + focus ring treatment for interactive surfaces, in the primary color and the error red respectively

</Update>

<Update label="0.1.19" description="2026-07-02">

<Badge color="green" size="sm">Added</Badge>

- `IconButton` component for icon-only actions
- `Password` component with visibility toggle
- `Modal` component
- `Toast` component with theme-aware shadows
- `Accordion` component
- `Dropzone` and `AvatarDropzone` components for file uploads

</Update>

<Update label="0.1.18" description="2026-06-28">

<Badge color="green" size="sm">Added</Badge>

- Responsive `$alignItems`, `$alignContent`, and per-breakpoint `$direction` props on `Flex`, backed by new `generateAlignItemsStyles`, `generateAlignContentStyles`, and `generateDirectionStyles` mixins

</Update>

# 0.1.17 and earlier

Changes prior to 0.1.18 were not tracked in this changelog. See the [git history](https://github.com/cherry-design-system/styled-components/commits/main) for details.

<Button href="https://github.com/cherry-design-system/styled-components/blob/main/CHANGELOG.md" icon="code" iconPosition="left">
  View on GitHub
</Button>
