Back to Explore

asamuzaK/cssColor

GitHub
6 updates · last 90 days1 watchersOpen source

Last release:

A modern JavaScript library that resolves, parses, and converts CSS color strings, including modern Color Module Level 4 and 5 features like color-mix(), color(), advanced color spaces, var(), and calc(). It is useful for turning CSS color and gradient values into computed or specified results, and for converting between formats like HEX, RGB, HSL, LAB, LCH, and OKLCH. It also exposes utilities for validating colors and gradients.

Project status

  • Actively maintained, with upstream and GitHub activity within days (last upstream push 2026-08-16, and updates as recent as 2026-08-16, 2026-08-08), indicating an ongoing development cycle rather than a dormant period.
  • Apparent update cadence is fairly steady and recent, with multiple updates across August 2026 (v7.0.0 on 2026-08-16, then v6.0.7 to v6.0.5 between 2026-08-08 and 2026-07-12).

AI summary generated

AI-generated from public sources. May be inaccurate. Report

Recent updates

  • v7.0.0

    v7.0.0 mainly updates the project tooling setup by removing pnpm usage and adjusting CI to build with npm, and it expands/changes the supported Node.js versions. The code diff also includes multiple internal behavior adjustments in color resolution and calc term sorting, plus a significant Vite build configuration change that can affect the published bundle.

  • v6.0.7

    v6.0.7 adds a new exported helper, sortMathFnTerms, intended to sort math function terms within calc-related expressions. While the release notes mention only the new function, the actual code change also updates the core calc resolution path to use this sorter instead of a simpler minus-handling regex.

    Features
  • v6.0.6

    v6.0.6 focuses on correcting how calc() expressions are parsed and sorted when they appear inside math-like functions such as min(), max(), and clamp(). The implementation also changes serialization details for comma-separated arguments and how calc() is unwrapped and normalized in these contexts.

  • v6.0.5

    v6.0.5 replaces the internal cache implementation based on GenerationalCache with an LRUCache, and increases the configured cache size. The release notes only call out this cache swap, but the code diff also shows an exported cache symbol rename and other build and tooling changes.

    Breaking
  • v6.0.4

    Release v6.0.4 contains a small internal change to the caching configuration, plus a set of dependency/tooling bumps. The provided release notes do not enumerate any specific functional changes or breaking changes.

  • v6.0.3

    v6.0.3 makes substantial internal changes to caching behavior and upgrades several dependencies. The release notes contain only a changelog link and do not document any of the behavioral or API-relevant changes present in the code diff.

  • v6.0.2

    v6.0.2 focuses on refactoring the internal null handling and reorganizing CSS calc and var resolution logic. It removes the NullObject sentinel type, consolidates css-calc and css-var into a single module, and moves the isColor helper. A new resolver pathway is also introduced to support resolving relative colors more flexibly.

    BreakingFeatures
  • v6.0.1

    v6.0.1 does not include any source code changes in the provided diff, but it bumps the dependency @asamuzakjp/generational-cache from 1.0.1 to 2.0.1 and updates the lockfile accordingly. The release notes are effectively empty (only a comparison link), so the dependency change is likely the main content of this release.

  • v6.0.0

    v6.0.0 removes support for Node.js v20.x and updates the package/tooling versions used for build and tests. The code also removes some exported utility functions from the public API and changes how the library converts the CSS length unit 'vb' inside resolveLengthInPixels.

    Breaking
  • v5.1.11

    Release v5.1.11 switches the project to use the external @asamuzakjp/generational-cache implementation instead of the previously in-repo GenerationalCache class. It also increases the configured cache size used by the shared cache instance.

  • v5.1.10

    v5.1.10 is described as a refactor of the caching layer and general code cleanup. While the release notes are brief, the code diff shows broader internal rewrites across color parsing, cache key generation, calc serialization, gradients validation, CSS variable resolution, and relative color handling.

  • v5.1.9

    v5.1.9 updates the internal GenerationalCache implementation and adjusts how cache sizing works. Release notes only mention “Update GenerationalCache and expose”, but the actual diff shows multiple behavioral changes in caching logic and default sizing.

  • v5.1.8

    v5.1.8 makes changes to the caching layer, including updates to cache handling and cache key generation. It also bumps a few dev tool dependencies (vite/vitest coverage) and updates the test expectations for the cache key format.

  • v5.1.6

    v5.1.6 replaces the previous `lru-cache` usage with a custom generational cache implementation. The public change in the release notes is limited to removing `lru-cache`, but the code diff shows additional API surface and behavior changes in the cache module.

  • v5.1.5

    Release v5.1.5 is described as a refactor focused on cache key generation, token iteration patterns, and some utility logic. The release notes do not mention any public API removals or behavioral changes, but the code diff shows multiple functional logic changes beyond simple refactoring.

  • v5.1.4

    Release v5.1.4 includes a change to the isAbsoluteFontSize() utility. The release notes only mention this update, but the code diff also shows dependency/tooling bumps and a behavior change in how absolute font sizes are parsed.

    Security