Skip to content

Commit

Permalink
Merge pull request #371 from dcos-labs/mp/fix/text-line-height
Browse files Browse the repository at this point in the history
Add line-height to Text component
  • Loading branch information
mperrotti authored Jul 11, 2019
2 parents d0b1b1e + 5a823c2 commit f490433
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions packages/styleUtils/typography/components/Text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
fontWeightNormal,
themeTextColorPrimary
} from "../../../design-tokens/build/js/designTokens";
import { textBase } from "../style";

export interface TextProps extends BasicTextProps {
/**
Expand All @@ -29,6 +30,7 @@ const Text = (props: TextProps) => {
<TextTag
className={cx(
className,
textBase,
textWeight(weight as FontWeights),
textSize(size),
tintContent(color),
Expand Down
4 changes: 1 addition & 3 deletions packages/styleUtils/typography/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ import { css } from "emotion";
import {
fontLineHeightS,
fontLineHeightM,
fontLineHeightDefault,
fontSizeM
fontLineHeightDefault
} from "../../design-tokens/build/js/designTokens";

export const textBase = css`
font-size: ${fontSizeM};
line-height: ${fontLineHeightDefault};
`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ exports[`Typography SuccessText renders all props 1`] = `

exports[`Typography Text renders all props 1`] = `
.emotion-0 {
line-height: 1.4;
font-weight: 500;
font-size: 12px;
color: black;
Expand All @@ -151,6 +152,7 @@ exports[`Typography Text renders all props 1`] = `

exports[`Typography Text renders all wrap variants 1`] = `
.emotion-0 {
line-height: 1.4;
font-weight: 400;
font-size: 14px;
color: black;
Expand All @@ -172,6 +174,7 @@ exports[`Typography Text renders all wrap variants 1`] = `

exports[`Typography Text renders all wrap variants 2`] = `
.emotion-0 {
line-height: 1.4;
font-weight: 400;
font-size: 14px;
color: black;
Expand All @@ -190,6 +193,7 @@ exports[`Typography Text renders all wrap variants 2`] = `

exports[`Typography Text renders all wrap variants 3`] = `
.emotion-0 {
line-height: 1.4;
font-weight: 400;
font-size: 14px;
color: black;
Expand Down Expand Up @@ -220,6 +224,7 @@ exports[`Typography WarningText renders all props 1`] = `

exports[`Typography renders all default 1`] = `
.emotion-0 {
line-height: 1.4;
font-size: 14px;
color: var(--themeTextColorPrimary,#1B2029);
fill: var(--themeTextColorPrimary,#1B2029);
Expand Down

0 comments on commit f490433

Please sign in to comment.