stylelint-processor-styled-components
Version:
A stylelint processor for styled-components
43 lines (30 loc) • 563 B
JavaScript
import styled, { css } from 'styled-components'
const interpolatedStyle = css`
background-color: gray;
color: gray;
`
// Interpolation of chunk
const Div = styled.div`
${interpolatedStyle}
`
// Conditional interpolation of chunk
const Button = styled.button`
${props => props.isHovering && interpolatedStyle}
`
// #110
const Bla = styled.div`
${Button} {
${something}: blue;
}
background: ${bla};
${someValue}
`
// Multi-line interpolations
const MultiLineDiv = styled.div`
color: ${
'red'
};
${
'long values'
}
`;