[WIP] Adds paragraph sizes
This commit is contained in:
@@ -19,25 +19,11 @@ interface ParagraphProps extends BaseTextInterface {
|
||||
isMuted?: boolean | number;
|
||||
}
|
||||
|
||||
interface ParagraphSizes {
|
||||
default: string;
|
||||
medium: string;
|
||||
large: string;
|
||||
[key: string]: string;
|
||||
}
|
||||
|
||||
const PARAGRAPH_SIZES: ParagraphSizes = {
|
||||
default: '18px',
|
||||
small: '14px',
|
||||
medium: '22px',
|
||||
large: '28px',
|
||||
};
|
||||
|
||||
const StyledHeading = styled.h1<HeadingProps>`
|
||||
color: ${props => props.color || props.theme.textColor};
|
||||
font-size: ${props => `var(--${props.size}Heading)`};
|
||||
font-size: ${props => `var(--${props.size || 'default'}Heading)`};
|
||||
padding: ${props => props.padding && getCSSPadding(props.padding)};
|
||||
line-height: ${props => `var(--${props.size}HeadingHeight)`};
|
||||
line-height: ${props => `var(--${props.size || 'default'}HeadingHeight)`};
|
||||
margin-bottom: ${props => !props.isNoMargin && '30px'};
|
||||
text-align: ${props => props.isCentered && 'center'};
|
||||
font-weight: 300;
|
||||
@@ -57,7 +43,7 @@ export const Heading: React.StatelessComponent<HeadingProps> = props => {
|
||||
// and be more generic. e.g. <Text /> with a props asElement so we can use it
|
||||
// for literally anything =
|
||||
export const Paragraph = styled.p<ParagraphProps>`
|
||||
font-size: ${props => PARAGRAPH_SIZES[props.size || 'default']};
|
||||
font-size: ${props => `var(--${props.size || 'default'}Paragraph)`};
|
||||
margin-bottom: ${props => !props.isNoMargin && '30px'};
|
||||
padding: ${props => props.padding && getCSSPadding(props.padding)};
|
||||
color: ${props => props.color || props.theme.textColor};
|
||||
|
@@ -40,6 +40,10 @@ const GlobalStyles = withTheme(createGlobalStyle<GlobalStyle> `
|
||||
--defaultHeadingHeight: 1.357142857em;
|
||||
--mediumHeadingHeight: 1.16em;
|
||||
--largeHeadingHeight: 1em;
|
||||
--smallParagraph: 14px;
|
||||
--defaultParagraph: 18px;
|
||||
--mediumParagraph: 22px;
|
||||
--largeParagraph: 28px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,6 +57,10 @@ const GlobalStyles = withTheme(createGlobalStyle<GlobalStyle> `
|
||||
--defaultHeadingHeight: 1.357142857em; // TO DO
|
||||
--mediumHeadingHeight: 1.16em; // TO DO
|
||||
--largeHeadingHeight: 1em; // TO DO
|
||||
--smallParagraph: 14px; // TO DO
|
||||
--defaultParagraph: 18px; // TO DO
|
||||
--mediumParagraph: 22px; // TO DO
|
||||
--largeParagraph: 28px; // TO DO
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user