.block__element--modifier
, button button--state-success
)render(
<div>
<Button>Normal</Button>
<Button width="100">Primary</Button>
</div>
);
// λ§μ½ Button μ»΄ν¬λνΈμ μ λ¬λ props(width)κ° 200 λ―Έλ§(쑰건)μ΄λ©΄
// μΌνμ°μ°μ true : "palevioletred"
// μΌνμ°μ°μ false : "white"
const Button = styled.button`
background: ${props => props.width < 200 ? "palevioletred" : "white"};
color: ${props => props.primary ? "white" : "palevioletred"};
font-size: 1em;
margin: 1em;
padding: 0.25em 1em;
border: 2px solid palevioletred;
border-radius: 3px;
`;
# Nesting
```js
render(
<>
<Thing>Hello world!</Thing>
<Thing>How ya doing?</Thing>
<Thing className="something">
<span className="contents">The sun is shining...<span>
</Thing>
<div>Pretty nice day today.</div>
<Thing>Don't you think?</Thing>
<div className="something-else">
<Thing>Splendid.</Thing>
</div>
</>
)
const Thing = styled.div`
color: blue;
&:hover {
color: red;
}
#id {
div {
background: orange;
}
}
.something-else & {
border: 1px solid;
}
`