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

Update small screen font-sizes, remove some unnecessary stuff #4740

Merged
merged 3 commits into from
Apr 19, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
30 changes: 15 additions & 15 deletions scss/_base_typography-definitions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
margin-bottom: map-get($sp-after, h2-mobile) - map-get($nudges, h2-mobile);
margin-top: 0;
max-width: $text-max-width;
padding-top: map-get($nudges, h2-mobile) + map-get($browser-rounding-compensations, h2);
padding-top: map-get($nudges, h2-mobile);

@media (min-width: $breakpoint-heading-threshold) {
font-size: #{map-get($font-sizes, h2)}rem;
line-height: map-get($line-heights, h2);
margin-bottom: map-get($sp-after, h2) - map-get($nudges, h2);
padding-top: map-get($nudges, h2) + map-get($browser-rounding-compensations, h2);
padding-top: map-get($nudges, h2);
}

&.u-no-margin--bottom {
Expand All @@ -41,7 +41,7 @@
font-size: #{map-get($font-sizes, h3)}rem;
line-height: map-get($line-heights, h3);
margin-bottom: map-get($sp-after, h3) - map-get($nudges, h3);
padding-top: map-get($nudges, h3) + map-get($browser-rounding-compensations, h3);
padding-top: map-get($nudges, h3);
}

&.u-no-margin--bottom {
Expand All @@ -57,19 +57,19 @@
margin-bottom: map-get($sp-after, h4-mobile) - map-get($nudges, h4-mobile);
margin-top: 0;
max-width: $text-max-width;
padding-top: map-get($nudges, h4-mobile) + map-get($browser-rounding-compensations, h4);
padding-top: map-get($nudges, h4-mobile);

@media (min-width: $breakpoint-heading-threshold) {
font-size: #{map-get($font-sizes, h4)}rem;
line-height: map-get($line-heights, h4);
margin-bottom: map-get($sp-after, h4) - map-get($nudges, h4);
padding-top: map-get($nudges, h4) + map-get($browser-rounding-compensations, h4);
padding-top: map-get($nudges, h4);
}

@if ($increase-font-size-on-larger-screens) {
@media (min-width: $breakpoint-x-large) {
margin-bottom: map-get($sp-after, h4) - map-get($nudges, h4-large);
padding-top: map-get($nudges, h4-large) + map-get($browser-rounding-compensations, h4);
padding-top: map-get($nudges, h4-large);
}
}

Expand All @@ -86,7 +86,7 @@
margin-bottom: map-get($sp-after, p) - map-get($nudges, p);
margin-top: 0;
max-width: $text-max-width;
padding-top: map-get($nudges, p) + map-get($browser-rounding-compensations, h5);
padding-top: map-get($nudges, p);

&.u-no-margin--bottom {
@extend %u-no-margin--bottom--default-text;
Expand All @@ -101,11 +101,11 @@
margin-bottom: map-get($sp-after, p) - map-get($nudges, p);
margin-top: 0;
max-width: $text-max-width;
padding-top: map-get($nudges, h6) + map-get($browser-rounding-compensations, h6);
padding-top: map-get($nudges, h6);

@if ($increase-font-size-on-larger-screens) {
@media (min-width: $breakpoint-x-large) {
padding-top: map-get($nudges, h6-large) + map-get($browser-rounding-compensations, h6);
padding-top: map-get($nudges, h6-large);
}
}

Expand All @@ -117,7 +117,7 @@
%common-default-text-properties {
line-height: map-get($line-heights, default-text);
margin-top: 0;
padding-top: map-get($nudges, p) + map-get($browser-rounding-compensations, p);
padding-top: map-get($nudges, p);
}

%default-text {
Expand Down Expand Up @@ -146,11 +146,11 @@
font-size: #{map-get($font-sizes, small)}rem;
line-height: map-get($line-heights, small);
margin-bottom: map-get($sp-after, small) - map-get($nudges, small);
padding-top: map-get($nudges, small) + map-get($browser-rounding-compensations, small);
padding-top: map-get($nudges, small);

@if ($increase-font-size-on-larger-screens) {
@media (min-width: $breakpoint-x-large) {
padding-top: map-get($nudges, small) + map-get($browser-rounding-compensations, small-largescreen);
padding-top: map-get($nudges, small);
}
}

Expand All @@ -164,11 +164,11 @@
font-weight: $font-weight-bold;
line-height: map-get($line-heights, x-small);
margin-bottom: map-get($sp-after, x-small) - map-get($nudges, x-small);
padding-top: map-get($nudges, x-small) + map-get($browser-rounding-compensations, small);
padding-top: map-get($nudges, x-small);

@if ($increase-font-size-on-larger-screens) {
@media (min-width: $breakpoint-x-large) {
padding-top: map-get($nudges, x-small) + map-get($browser-rounding-compensations, small-largescreen);
padding-top: map-get($nudges, x-small);
}
}

Expand Down Expand Up @@ -196,7 +196,7 @@
// but now it's implemented with default text size not requiring any compensations,
// so we need to reset the padding-top to the default value
&.u-align-text--x-small-to-default {
padding-top: map-get($nudges, p) + map-get($browser-rounding-compensations, p);
padding-top: map-get($nudges, p);
}
}

Expand Down
11 changes: 11 additions & 0 deletions scss/_settings_font.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ $font-weight-thin: 300 !default;
$font-weight-regular-text: 400 !default;
$font-weight-bold: 550 !default;

$font-weights: (
bartaz marked this conversation as resolved.
Show resolved Hide resolved
h1: 550,
h2: 180,
h3: 550,
h4: 275,
h5: 500,
default-text: 400,
small: 400,
x-small: 400,
) !default;

// Ubuntu Font metrics
$baseline-position: 0.932em !default; // HHead Ascent from the font file's metrics. Viewable in Fontforge Font Information>OS/2
$cap-height: 0.693em !default;
Expand Down
31 changes: 16 additions & 15 deletions scss/_settings_spacing.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ $sp-unit: 1rem * $sp-unit-ratio !default;

$font-sizes: (
h1: 2.5,
h1-mobile: 2.5,
h1-mobile: 2,
h2: 2.5,
h2-mobile: 2.5,
h2-mobile: 2,
h3: 1.5,
h3-mobile: 1.5,
h4: 1.5,
h4-mobile: 1.5,
small: pow($ms-ratio, -1),
x-small: pow($ms-ratio, -2),
small: .875,
x-small: .75,
) !default;

$line-heights: (
h1: 6 * $sp-unit,
h1-mobile: 6 * $sp-unit,
h1-mobile: 5 * $sp-unit,
h2: 6 * $sp-unit,
h2-mobile: 6 * $sp-unit,
h2-mobile: 5 * $sp-unit,
h3: 4 * $sp-unit,
h3-mobile: 4 * $sp-unit,
h4: 4 * $sp-unit,
Expand All @@ -36,28 +36,29 @@ $line-heights: (

// baseline nudges for type scale ratio of (16/14)^2
$nudges: (
h1-large: 0.5rem,
h1-mobile: 0.5rem,
h1: 0.5rem,
h2: 0.5rem,
h2-mobile: 0.5rem,
h1-large: 0.55rem,
h1-mobile: 0.55rem,
h1: 0.55rem,
h2: 0.55rem,
h2-mobile: 0.55rem,
h3: 0.45rem,
h3-mobile: 0.45rem,
h4-large: 0.45rem,
h4: 0.45rem,
h4-mobile: 0.45rem,
h6: 0.338rem,
h6-large: 0.345rem,
h5: 0.4rem,
h6: 0.4rem,
h6-large: 0.4rem,
p: 0.4rem,
p-ubuntumono: 0.45rem,
small: 0.05rem,
x-small: 0.25rem,
) !default;

// Correct baseline drift due to browser rounding. (Visible in text > 1000 lines)
// It is applied only to padding-top.
// It is applied only to padding-top. DEPRECATED
bartaz marked this conversation as resolved.
Show resolved Hide resolved
$browser-rounding-compensations: (
h1: 0.001rem,
h1: 0.000rem,
h2: 0.001rem,
h3: 0.001rem,
h4: 0.001rem,
Expand Down