
Security News
New React Server Components Vulnerabilities: DoS and Source Code Exposure
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.
css-in-js with template strings. For React.
import React, {Component} from 'react'
import {render} from 'react-dom'
import suitup from 'suit-up'
// it works with CSS Modules syntax for globals
const style = `
:global .container {
color: red;
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
}
`
// local composes works too!
const buttonStyle = `
.base {
border: none;
border-radius: 4px;
cursor: pointer;
padding: 10px 20px;
}
.default {
composes: base;
background-color: lightgray;
color: black;
}
.primary {
composes: base;
background-color: blue;
color: white;
}
`
let Button = ({children, styles, primary, ...rest}) => {
return (
<button
className={primary ? styles.primary : styles.default}
{...rest}
>
{children}
</button>
)
}
Button = suitup(buttonStyle)(Button)
@suitup(style)
class App extends Component {
render () {
return (
<div className='container'>
<span>Red Text</span>
<Button>Default Button</Button>
<Button primary>Primary Button</Button>
</div>
)
}
}
render(<App />, document.getElementById('app'))
import React, {Component} from 'react'
import {render} from 'react-dom'
import suitup, {ThemeProvider} from 'suit-up'
const buttonStyle = theme => `
.base {
border: none;
border-radius: ${theme.sizes.borderRadius}px;
cursor: pointer;
padding: ${theme.sizes.verticalPadding}px ${theme.sizes.horizontalPadding}px;
}
.default {
composes: base;
background-color: ${theme.colors.default};
color: ${theme.colors.text};
}
.primary {
composes: base;
background-color: ${theme.colors.primary};
color: ${theme.colors.invertedText};
}
`
let Button = ({children, styles, primary, ...rest}) => {
return (
<button
className={primary ? styles.primary : styles.default}
{...rest}
>
{children}
</button>
)
}
Button = suitup(buttonStyle)(Button)
const someTheme = {
colors: {
default: 'lightgray',
primary: 'darkblue',
text: 'black',
invertedText: 'white',
},
sizes: {
borderRadius: 4,
verticalPadding: 10,
horizontalPadding: 20
}
}
class App extends Component {
render () {
return (
<ThemeProvider theme={someTheme}>
<div>
<Button>Default Button</Button>
<Button primary>Primary Button</Button>
</div>
</ThemeProvider>
)
}
}
render(<App />, document.getElementById('app'))
This is HIGHLY inspired by some amazing work:
FAQs
> css-in-js with template strings. For React.
We found that suit-up 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
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.

Security News
GitHub has revoked npm classic tokens for publishing; maintainers must migrate, but OpenJS warns OIDC trusted publishing still has risky gaps for critical projects.