-
Notifications
You must be signed in to change notification settings - Fork 10
Tailwind Getting Started Guide
Entkenntnis edited this page Jun 1, 2021
·
7 revisions
before:
<StyledDiv></StyledDiv>
const StyledDiv = styled.div`
display: flex;
`
after:
<div className="flex"></div>
styled.div`
margin: 24px 12px 6px;
`
=> mx-3 mt-6 mb-1.5
styled.div`
color: ${(props) => props.theme.colors.brand};
`
=> text-brand
styled.div`
@media (min-width: ${(props) => props.theme.breakpoints.sm}) {
margin-bottom: 20px;
}
`
=> sm:mb-5
styled.div`
&:hover {
text-decoration: underline;
}
`
=> hover:underline
before:
<div className="mx-2 mt-4 mb-0.5 text-lg text-brand bg-white hover:bg-brand"></div>
after:
<div
className={clsx(
'mx-2 mt-4 mb-0.5 text-lg text-brand',
'bg-white hover:bg-brand'
)}
></div>
(not more than 5 classes per line)
makeMargin
=> mx-side
makePrimaryButton
=> serlo-button serlo-make-interactive-primary
before:
<LinkSection full={isFull}/>
const LinkSection = styled.div<{ full?: boolean }>`
margin-bottom: ${(props) => props.full && '1.5rem'};
margin-top: ${(props) => (!props.full ? '20px' : '8px')};
`
after:
<LinkSection className={clsx(isFull ? 'mb-6 mt-2' : 'mt-5')}