
Security News
Open Source Maintainers Feeling the Weight of the EU’s Cyber Resilience Act
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
@css-system/use-css
Advanced tools
A react hook for building versatile design primitives.
import React, {createContext, useContext} from "react"
import ReactDOM from "react-dom"
import {useCss} from "@css-system/use-css"
const theme = {
breakpoints: ["40em", "52em", "64em"],
colors: {
background: "#ffffff",
text: "#000000",
primary: "#ff0000",
},
space: [0, 4, 8, 16, 32],
fontSizes: [0, 12, 14, 16, 20, 24, 32, 48, 64, 72],
}
const ThemeContext = createContext(theme)
const View = ({as: Component = "div", css, ...props}) => {
const theme = useContext(ThemeContext)
const className = useCss(
{
display: "flex",
minWidth: 0,
minHeight: 0,
flex: "none",
alignSelf: "auto",
alignItems: "stretch",
flexDirection: "column",
justifyContent: "flex-start",
...css,
},
theme
)
return <Component className={className} {...props} />
}
const Text = ({as: Component = "span", css, ...props}) => {
const theme = useContext(ThemeContext)
const className = useCss(
{
display: "inline-flex",
minWidth: 0,
minHeight: 0,
flex: "none",
alignSelf: "auto",
alignItems: "stretch",
flexDirection: "row",
justifyContent: "flex-start",
...css,
},
theme
)
return <Component className={className} {...props} />
}
const App = () => {
return (
<View
css={{
p: [1, 2, 3],
"&:hover": {
bg: "text",
color: "background",
},
}}
>
<Text css={{fontSize: [1, 2, 3]}}>Hello world !</Text>
</View>
)
}
FAQs
A react hook for building versatile design primitives. It follow the (theme ui specifications)[https://github.com/system-ui/theme-specification].
The npm package @css-system/use-css receives a total of 4 weekly downloads. As such, @css-system/use-css popularity was classified as not popular.
We found that @css-system/use-css demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.