Skip to content

Commit

Permalink
updating lineheight mixin name
Browse files Browse the repository at this point in the history
  • Loading branch information
cchaos committed Apr 5, 2018
1 parent 855c65a commit ff492f5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
14 changes: 7 additions & 7 deletions src/global_styling/mixins/_typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,28 @@
@if $size == "xxxs" {
@include euiFontSizeXS;
font-weight: $euiFontWeightBold;
@include lineHeight(3);
@include lineHeightFromBaseline(3);
} @else if $size == "xxs" {
@include euiFontSizeS;
font-weight: $euiFontWeightBold;
@include lineHeight(3);
@include lineHeightFromBaseline(3);
} @else if $size == "xs" {
@include euiFontSize;
font-weight: $euiFontWeightMedium;
@include lineHeight(3);
@include lineHeightFromBaseline(3);
} @else if $size == "s" {
@include euiFontSizeL;
font-weight: $euiFontWeightMedium;
@include lineHeight(4);
@include lineHeightFromBaseline(4);
} @else if $size == "m" {
@include euiFontSizeXL;
@include lineHeight(5);
@include lineHeightFromBaseline(5);
} @else if $size == "l" {
@include euiFontSizeXXL;
@include lineHeight(6);
@include lineHeightFromBaseline(6);
} @else {
@include fontSize($size);
@include lineHeight(3);
@include lineHeightFromBaseline(3);
}
}

Expand Down
8 changes: 5 additions & 3 deletions src/global_styling/variables/_typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
}

// Our base gridline is at 1/2 the font-size, ensure line-heights stay on that gridline.

@mixin lineHeight($multiplier: 3) {
// EX: A proper line-height for text is 1.5 times the font-size.
// If our base font size (euiFontSize) is 16, our baseline is 8 (16*1.5 / 3). To ensure the
// text stays on the baseline, we pass a multiplier to calculate a line-height in rems.
@mixin lineHeightFromBaseline($multiplier: 3) {
line-height: convertToRem(($euiFontSize/2)*$multiplier);
}

Expand All @@ -29,7 +31,7 @@ $euiFontFamily: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial,
$euiCodeFontFamily: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace !default;

// Font sizes -- scale is loosely based on Major Third (1.250)
$euiTextScale: 2.25, 1.75, 1.25, 1.125, 1, .875, .75;
$euiTextScale: 2.25, 1.75, 1.25, 1.125, 1, .875, .75;

$euiFontSize: $euiSize !default; // 5th position in scale

Expand Down

0 comments on commit ff492f5

Please sign in to comment.