Skip to content

Releases: tenphi/tasty

v2.2.0

22 Apr 08:26
8c535d9

Choose a tag to compare

Minor Changes

  • #156 552c522 Thanks @tenphi! - Pseudo-element and pseudo-class patterns in the $ selector affix now require an explicit & prefix to attach to the root selector. $: '::before' must be written as $: '&::before'. Without &, pseudo patterns are treated as descendant selectors.

Patch Changes

  • #154 b926d10 Thanks @tenphi! - Add explicit return type and narrow injectScript stage parameter in tastyIntegration.

  • #153 dbbe9b6 Thanks @tenphi! - Add #clear color token to the default configuration.

v2.1.2

21 Apr 12:46
12a1ce1

Choose a tag to compare

Patch Changes

  • #150 f8f0285 Thanks @tenphi! - Fix excessive CSS output for compound root states by canonicalizing @media order, removing redundant boolean selectors, improving negation subsumption, and pruning contradicted OR branches.

  • #152 856a7ba Thanks @tenphi! - Factor Cartesian-product :is() selector groups into independent per-dimension :is() groups for more compact CSS output.

v2.1.1

20 Apr 13:28
bf7ec5e

Choose a tag to compare

Patch Changes

  • #148 a6fffde Thanks @tenphi! - Fix $: '> SubElementName' selector affix syntax so that when the trailing element name matches the sub-element's own key it acts as a placeholder rather than triggering a duplicate key injection.

v2.1.0

15 Apr 12:16
7665601

Choose a tag to compare

Minor Changes

  • #139 025dd2c Thanks @tenphi! - Add Shadow DOM support: useStyles, useGlobalStyles, and computeStyles now accept a root option (Document | ShadowRoot) to inject styles into a specific shadow root. Styles are injected via adoptedStyleSheets when targeting a shadow root, with a shared ChunkSheetRegistry for deduplication across multiple shadow roots.

Patch Changes

  • #139 4b8bd9d Thanks @tenphi! - Use happy-dom for injector tests, removing mock CSSStyleSheet and adoptedStyleSheets shims

  • #139 8f6c8fe Thanks @tenphi! - Make SheetInfo.sheet nullable to accurately represent adopted mode where no HTMLStyleElement exists

v2.0.4

15 Apr 09:15
c497f75

Choose a tag to compare

Patch Changes

  • #137 0fcb9d9 Thanks @tenphi! - Switch from unbundled to bundled output, reducing publish size by ~74% (from 2.05 MB to ~530 KB) and file count from 313 to 63.

v2.0.3

13 Apr 14:47
6fdb08f

Choose a tag to compare

Patch Changes

  • #135 fa72fe1 Thanks @tenphi! - Internal pipeline cleanup: refactor processStyles into named per-stage helpers, split materialize.ts (types + contradiction detection extracted to materialize-types.ts and materialize-contradictions.ts), document the actual stage flow in docs/pipeline.md and the index.ts header (Stage 0 normalization, user-OR vs De Morgan-OR expansion, consensus rule, @starting-style cascade ordering), and add tests for container style query rendering, explicit boolean-algebra laws, multi-variable consensus, De Morgan with mixed @supports/@container, empty-styles, and a known simplification gap for conflicting @root(schema=…) attribute values. No behavior change.

v2.0.2

13 Apr 12:15
219e6e8

Choose a tag to compare

Patch Changes

  • #133 7cd9dbe Thanks @tenphi! - Fix missing state selectors when a non-default state maps to the same value as the default in a style map. Redundant compound state dimensions are now eliminated early in the pipeline.

v2.0.1

13 Apr 09:36
7271ba8

Choose a tag to compare

Patch Changes

  • bf19368 Thanks @tenphi! - Fix tastyDebug sorting of class names. The internal sortTastyClasses helper still parsed class names as decimal integers, which silently produced unsorted output for the 2.0.0 base36 hash format (e.g. t3a5f). It now sorts lexicographically, restoring stable ordering in tastyDebug.cache(), tastyDebug.summary(), and related outputs.

v2.0.0

08 Apr 15:11
f86bbab

Choose a tag to compare

Major Changes

  • #123 f26409e Thanks @tenphi! - Unified hash-based class names across RSC, SSR, and client. Same cache key now produces the same class name in all environments, enabling cross-environment style deduplication. Replaces the heavy SSRCacheState transfer with a lightweight class-name-list via window.__TASTY__.

    SSR/RSC fixes included:

    • Fix missing tokens on pages without RSC-rendered tasty components. The globalThis.__tasty_rsc_internals_emitted__ flag leaked across requests in the same Node.js process; internals (tokens, @property, @font-face, @counter-style) are now emitted exclusively by the SSR collector.
    • Fix duplicate global CSS when RSC and SSR paths both emit internals in Next.js App Router. The SSR collector now skips internals already emitted by the RSC inline-style path.
    • Fix CSS class name collisions during client-side navigation in Next.js App Router. RSC inline styles used sequential counters (r0, r1, …) that reset on every request; replaced with content-based hashing (djb2) so identical content always maps to the same name.
    • Auto-skip global CSS injection on client when <style data-tasty-ssr> is detected, eliminating the need for typeof window === 'undefined' guards in configure() calls.

    Internal SSR API changes (not part of the public API):

    • SSRCacheState type removed — replaced by plain string[] class lists.
    • ServerStyleCollector.getCacheState() replaced by getRenderedClassNames().
    • window.__TASTY_SSR_CACHE__ replaced by window.__TASTY__.
    • hydrateTastyCache() deprecated in favor of hydrateTastyClasses() (the old function still works as a compat shim).
    • Class name format changed from t{number} to t{base36hash}.

Minor Changes

  • #119 af8bf8a Thanks @tenphi! - Add presets and globalStyles options to configure(). presets is a shorthand for generateTypographyTokens() that merges generated tokens under explicit tokens. globalStyles is a Record<string, Styles> that applies Tasty styles to arbitrary CSS selectors across all rendering modes. Both options are also available in plugins and zero-runtime config. Typography preset fields now accept state maps for responsive/theme-aware values.

Patch Changes

  • #119 8a7a342 Thanks @tenphi! - Derive TastyZeroConfig from TastyConfig via Omit to keep the two types in sync automatically. This also widens TastyZeroConfig to accept colorSpace, properties, and boolean values in replaceTokens — options that were previously only available in the runtime config.

  • #123 841767c Thanks @tenphi! - Fix overlapping and duplicate CSS selectors produced by the condition simplifier.

    • Fix overlapping selectors when default and custom-state token values coincide but other state values differ.
    • Fix overlapping selectors for compound state tokens by adding consensus resolution and making inner OR branches exclusive during CSS materialization.
    • Fix complementary factoring for compound state conditions, eliminating duplicate selectors when token values match across state combinations.
    • Eliminate duplicate token CSS rules when multiple states map to the same value. Tokens now generate a single rule instead of redundant duplicates. Also fixes absorption law so A | (A & B) correctly simplifies to A regardless of condition complexity.
  • #119 a642337 Thanks @tenphi! - Change default letterSpacing in typography presets from '0' to 'normal'. The previous default could override inherited letter-spacing; 'normal' matches the browser default.

v1.5.4

07 Apr 15:36
649f419

Choose a tag to compare

Patch Changes

  • #117 186d305 Thanks @tenphi! - Fix SSR style loss in Next.js static export by using React context for collector discovery instead of globalThis