Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 1.x] [Next Theme] Set base font size to 18px #1226

Merged
merged 1 commit into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/suggest/_suggest_item.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@

.ouiSuggestItem__label {
@include ouiTextTruncate;
font-family: var(--oui-code-font-family);
@include ouiCodeFont;
overflow: hidden;
text-overflow: ellipsis;
padding: $ouiSizeXS $ouiSizeS;
Expand Down
5 changes: 3 additions & 2 deletions src/themes/oui-next/global_styling/mixins/_typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
@mixin ouiCodeFont {
font-family: var(--oui-code-font-family);
letter-spacing: normal;
line-height: 1.5;
}

@mixin ouiText {
Expand Down Expand Up @@ -84,7 +85,7 @@
#{$property}: $value;
}
}
line-height: 1.25;
line-height: 1.111111;
}

@mixin ouiFontSizeXXL {
Expand All @@ -95,7 +96,7 @@
#{$property}: $value;
}
}
line-height: 1.25;
line-height: 1.111111;
}

@mixin ouiTextBreakWord {
Expand Down
2 changes: 2 additions & 0 deletions src/themes/oui-next/global_styling/reset/_reset.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ time, mark, audio, video {

code, pre, kbd, samp {
font-family: var(--oui-code-font-family);
font-size: 16px;
line-height: 1.5;
}

h1, h2, h3, h4, h5, h6, p {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@
// EX: A proper line-height for text is 1.5 times the font-size.
// If our base font size (ouiFontSize) 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.
// To maintain v7 line-heights, $ouiFontSize is replaced with 16px
@function lineHeightFromBaseline($multiplier: 3) {
@return convertToRem(calc($ouiFontSize/2)*$multiplier);
@return convertToRem(calc(16px/2)*$multiplier);
//@return convertToRem(calc($ouiFontSize/2)*$multiplier);
}
@mixin lineHeightFromBaseline($multiplier: 3) {
line-height: lineHeightFromBaseline($multiplier);
Expand All @@ -47,7 +49,7 @@ $ouiFontFeatureSettings: 'calt' 1, 'kern' 1, 'liga' 1 !default;
// Font sizes -- scale is loosely based on Major Third (1.250)
$ouiTextScale: 2.25, 1.75, 1.25, 1.125, 1, .875, .75 !default;

$ouiFontSize: $ouiSize !default; // 5th position in scale
$ouiFontSize: 18px !default; // 5th position in scale
$ouiFontSizeXS: $ouiFontSize * nth($ouiTextScale, 7) !default; // 12px
$ouiFontSizeS: $ouiFontSize * nth($ouiTextScale, 6) !default; // 14px
$ouiFontSizeM: $ouiFontSize * nth($ouiTextScale, 4) !default; // 18px
Expand All @@ -56,7 +58,7 @@ $ouiFontSizeXL: $ouiFontSize * nth($ouiTextScale, 2) !default; // 28px
$ouiFontSizeXXL: $ouiFontSize * nth($ouiTextScale, 1) !default; // 36px

// Line height
$ouiLineHeight: 1.5 !default;
$ouiLineHeight: 1.333333 !default;
$ouiBodyLineHeight: 1 !default;

// Font weights
Expand Down
Loading