New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

birch-css-utils

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package version was removed
This package version has been unpublished, mostly likely due to security reasons
Malware was recently detected in this package.

Affected versions:

0.0.0-stage0.0.1-security1.0.01.1.01.2.2
+1 more

birch-css-utils

Tiny ESM utility for blending CSS custom-property token maps into var() declarations.

unpublished
npmnpm
Version
1.2.2
Version published
Weekly downloads
1.1K
Maintainers
1
Weekly downloads
 
Created
Source

birch-css-utils

Tiny ESM utility for blending CSS custom-property token maps into var() declarations. Zero dependencies, no build step, works in Node 18+ and modern browsers.

Usage

import { blendTokens, cssVars } from 'birch-css-utils';

const base = { bg: '#111827', fg: '#f9fafb', accent: 'var(--brand)' };
const dark = blendTokens(base, { bg: '#000000' });

// "--app-bg: #000000; --app-fg: #f9fafb; --app-accent: var(--brand);"
const decl = cssVars(dark, 'app');

API

blendTokens(base, override)

Shallow-merges two token maps (override wins per key) and memoizes the result, so repeated calls with the same maps return the same object.

cssVars(map, prefix)

Renders a token map as a CSS custom-property block body. The optional prefix is joined with - (e.g. cssVars({bg: 'red'}, 'app') → --app-bg: red;).

memoSize()

Returns the number of memoized results — handy in tests.

License

MIT

Keywords

css

FAQs

Package last updated on 25 Oct 2026

Related posts