5.1.5 • Published 4 years ago
@styled-system/should-forward-prop v5.1.5
@styled-system/should-forward-prop
Utility for filtering Styled System props with Emotion's shouldForwardProp option
npm i @styled-system/should-forward-prop
import styled from '@emotion/styled'
import {
space,
color,
typography
} from 'styled-system'
import shouldForwardProp from '@styled-system/should-forward-prop'
const Box = styled('div', { shouldForwardProp })(
space,
color,
typography
)
Custom Props
To exclude other custom props not included in Styled System, use the createShouldForwardProp
utility.
import styled from '@emotion/styled'
import { space, color } from 'styled-system'
import { createShouldForwardProp, props } from '@styled-system/should-forward-prop'
const shouldForwardProp = createShouldForwardProp([
...props,
'd',
'x'
])
const Box = styled('div', {
shouldForwardProp
})(props => ({
display: props.d,
fontWeight: props.x ? 'bold' : null,
}),
space,
color
)
MIT License
5.1.5
4 years ago
5.1.4
4 years ago
5.1.2
5 years ago
5.1.1
5 years ago
5.1.0
5 years ago
5.0.23
5 years ago
5.0.21
5 years ago
5.0.20
5 years ago
5.0.18
5 years ago
5.0.16
5 years ago
5.0.15
5 years ago
5.0.14
5 years ago
5.0.12
5 years ago
5.0.10
5 years ago
5.0.7
5 years ago
5.0.6
5 years ago
5.0.5
5 years ago
5.0.4
5 years ago
5.0.3
5 years ago
5.0.2
5 years ago
5.0.1
5 years ago
5.0.0
5 years ago
5.0.0-12
5 years ago
5.0.0-11
5 years ago
1.0.0
5 years ago