Created
October 5, 2017 14:53
-
-
Save Remownz/57fa39f86847c45929db31760221baec to your computer and use it in GitHub Desktop.
Usage of withAsyncFonts with styled-components and semantic-ui-react
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const StyledTab = styled(({ baseFont, headingFont, textFont, iconsFont, ...rest }) => <SemanticTab {...rest} />)` | |
&&& .tabular.menu { | |
display: flex; | |
font-family: ${props => props.baseFont.styles.fontFamily}; | |
&>.item { | |
display: inline-block; | |
font-weight: normal; | |
text-align: center; | |
flex-grow: 1; | |
flex-basis: 0; | |
color: ${colors.menus.tab.color}; | |
padding: 1.375rem 1rem; | |
background: ${colors.menus.tab.inactive.background}; | |
border-radius: 0 !important; | |
&.active { | |
border-top: 4px solid ${colors.menus.tab.border}; | |
background: ${colors.menus.tab.active.background}; | |
} | |
} | |
} | |
`; | |
const StyledTabWithAsyncFonts = withAsyncFonts(fonts)(StyledTab); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment