
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@slimr/styled
Advanced tools
A tiny (~2kb) React css-in-js library inspired by chakra-ui, emotion, and styled-components libs
A tiny (~2kb) React css-in-js library inspired by chakra-ui, emotion, and styled-components libs
Demo: CodeSandbox
Features:
Div or A for profit@slimr is a set of slim React (hence '@slimr') libs. Check them all out on github!
npm i @slimr/styled
See npm for more info.
import {addCSs, createClass, css} from '@slimr/styled'
addCss('.foo { color: purple }')
c1 = createClass('c: red;')
c4 = css`c: red;`
<div className={css`c: red;`} /> // will resolve to 's0' like above
c6 = css`w: [100%, null, 400px]` // width = 100% on mobile and table, 400px on desktop
Props to help style based on CSS state
import {styled} from '@slimr/styled'
const MyDiv = styled.div`
_zx={{color: 'blue}} // applies color = blue
_active={{color: 'blue'}} // applied on :active
_dark={{color: 'blue'}} // applied when browser prefers dark modes
_focus={{color: 'blue'}} // applied on :focus
_focusVisible={{color: 'blue'}} // applied on :focusVisible
_focusWithin={{color: 'blue'}} // applied on :focusWithin
_hover={{color: 'blue'}} // applied on :hover
_light={{color: 'blue'}} // applied on :light
_target={{color: 'blue'}} // applied on :target
_visited={{color: 'blue'}} // applied on :visited
`
Some styles are available as shorthand -- all of them here.
import {styled} from '@slimr/styled'
const MyDiv = styled.div`
_bgColor="blue"
_c="green"
_p={18}
_pos="absolute"
_w={100}
Specify responsive styles as arrays, similar to chakra-ui
Default breakpoints are [30em, 48em, 62em, 80em, 96em] and can be overridden by setting css.breakpoints
import {styled} from '@slimr/styled'
const MyDiv = styled.div`
_w=[100%, null, 200px] // width = 100% on mobile, tablet. 200px on > tablet
_zx={{w: ['100%', null, '200px']}} // is equivalent to _w
Import pre-enhanced HTML Elements like Div or A for profit. With a few exceptions, most elements
accept ANY CSS style as a prop when prefixed by '_'
import {Div, A} from '@slimr/styled'
<Div _p=[8, null, 18]> // a div with responsive padding
<P _fontSize={30} _lineHeight="1rem"> // style props
<A _active={{ scale: 1.5 }} _hover={{ c: 'green' }}> // stateful styles
I grow during keypress and am green on hover
</A>
</Div>
Pros
Cons
Pros
Cons
Pros
Cons
Pros:
Cons:
FAQs
A tiny (~2kb) React css-in-js library inspired by chakra-ui, emotion, and styled-components libs
We found that @slimr/styled demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.