
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
compose-css-classes
Advanced tools
A small utility function to make react components that use css modules to have extensible styles.
A small utility function to make react components that use css modules to have extensible styles.
/**
* Foo.tsx
**/
import * as css from './Foo.css'
import composeClasses from 'compose-css-classes'
type Props = {
css?: Partial<typeof css>
}
export const Foo = (props: Props) => {
const classes = composeClasses(css, props)
return <div {...classes('container')}></div>
}
/**
* Bar.tsx
**/
import * as css from './Bar.css'
export const Bar = () => {
// a div will be rendered that has both the container class
// from Foo.css and also the fooContaienr class from Bar.css
return <Foo css={{container: css.fooContainer}} />
}
/**
* Foo.css
**/
.container {
background: black;
}
/**
* Bar.css
**/
.fooContainer {
color: white;
}
Look at src/index.test.ts
for more examples.
FAQs
A small utility function to make react components that use css modules to have extensible styles.
The npm package compose-css-classes receives a total of 0 weekly downloads. As such, compose-css-classes popularity was classified as not popular.
We found that compose-css-classes 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
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.