Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
feat(lsg): add textColor property to headline
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexpeschel committed Dec 19, 2017
1 parent e6f38bf commit f75189a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lsg/patterns/headline/index.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
import { Color } from '../colors';
import { fonts } from '../fonts';
import * as React from 'react';
import styled, { css, StyledComponentClass } from 'styled-components';

export interface HeadlineProps {
className?: string;
textColor?: Color;
order?: 1 | 2 | 3;
tagName?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'div';
}

interface StyledHeadlineProps {
className?: string;
textColor?: Color;
order?: 1 | 2 | 3;
}

const StyledHeadline = styled.div`
margin-top: 0;
font-family: ${fonts().NORMAL_FONT};
font-weight: 500;
${(props: StyledHeadlineProps) =>
props.textColor ? `color: ${props.textColor.toString()};` : ''};
${(props: HeadlineProps) => {
switch (props.order) {
Expand Down Expand Up @@ -48,7 +53,7 @@ export const Headline: React.StatelessComponent<HeadlineProps> = props => {
> = StyledHeadline.withComponent(tagName);

return (
<Component className={props.className} order={props.order}>
<Component className={props.className} textColor={props.textColor} order={props.order}>
{props.children}
</Component>
);
Expand Down

0 comments on commit f75189a

Please sign in to comment.