
Security News
Meet Socket at Black Hat Europe and BSides London 2025
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.
@ds-pack/theme-to-css-vars
Advanced tools
_Note: looking for a better package name, if you have ideas see [#1](https://github.com/ds-pack/theme-to-css-vars/issues/1)_
@ds-pack/theme-to-css-varsNote: looking for a better package name, if you have ideas see #1
A utility package for transforming a css-in-js theme object from raw values to CSS custom properties (CSS variables).
yarn add @ds-pack/theme-to-css-vars
import themeToCSSVars from '@ds-pack/theme-to-css-vars'
let baseTheme = {
colors: {
blue: ['cadetblue', 'steelblue', 'cornflowerblue'],
get primary() {
return this.blue[2]
},
},
}
let cssVariables = themeToCSSVars(baseTheme)
// cssVariables ===
// [
// ['--colors-blue-0', 'cadetblue' ],
// ['--colors-blue-1', 'steelblue' ],
// ['--colors-blue-2', 'cornflowerblue' ],
// ]
The utility function will return an array of tuples representing the CSS Variables for the theme.
FAQs
_Note: looking for a better package name, if you have ideas see [#1](https://github.com/ds-pack/theme-to-css-vars/issues/1)_
We found that @ds-pack/theme-to-css-vars demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.