Skip to content

Instantly share code, notes, and snippets.

@Remownz
Created October 5, 2017 14:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Remownz/57fa39f86847c45929db31760221baec to your computer and use it in GitHub Desktop.
Save Remownz/57fa39f86847c45929db31760221baec to your computer and use it in GitHub Desktop.
Usage of withAsyncFonts with styled-components and semantic-ui-react
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