Skip to content

Commit

Permalink
feat: add h5 and fix line-heights when using em
Browse files Browse the repository at this point in the history
  • Loading branch information
satazor committed Sep 10, 2018
1 parent 094e856 commit 6198f0e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
14 changes: 10 additions & 4 deletions src/styles/imports/mixins/typography.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,31 @@
@define-mixin typography-h1 $unit {
@mixin _heading;
font-size: 6$(unit);
line-height: 8$(unit);
line-height: calc(8.00001em / 6);
}

@define-mixin typography-h2 $unit {
@mixin _heading;
font-size: 4$(unit);
line-height: 5.4$(unit);
line-height: calc(5.4em / 4);
}

@define-mixin typography-h3 $unit {
@mixin _heading;
font-size: 3$(unit);
line-height: 4$(unit);
line-height: calc(4.00001em / 3);
}

@define-mixin typography-h4 $unit {
@mixin _heading;
font-size: 2$(unit);
line-height: 3.2$(unit);
line-height: calc(3.2em / 2);
}

@define-mixin typography-h5 $unit {
@mixin _heading;
font-size: 1.8$(unit);
line-height: calc(2.60001em / 1.8);
}

/* ==========================================================================
Expand Down
8 changes: 6 additions & 2 deletions stories/base/typography.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,15 @@
@mixin typography-h4 rem;
}

.body-1 {
.h5 {
@mixin typography-h5 rem;
}

.body1 {
@mixin typography-body-1 rem;
}

.body-2 {
.body2 {
@mixin typography-body-2 rem;
}

Expand Down
1 change: 1 addition & 0 deletions stories/base/typography.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ You may use the typography CSS mixins like so:
<div className={ styles.h2 }>h2 - Some cool title</div>
<div className={ styles.h3 }>h3 - Some cool title</div>
<div className={ styles.h4 }>h4 - Some cool title</div>
<div className={ styles.h5 }>h5 - Some cool title</div>
<div className={ styles.body1 }>body-1 (default) - The quick brown-fox jumps over the lazy dog.</div>
<div className={ styles.body2 }>body-2 - The quick brown-fox jumps over the lazy dog.</div>
<div className={ styles.caption }>caption - The quick brown-fox jumps over the lazy dog.</div>
Expand Down

0 comments on commit 6198f0e

Please sign in to comment.