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

Use consistent line heights (nav, footer, CTAs, content) in old&new pages #15790

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
11 changes: 6 additions & 5 deletions media/css/m24/base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,18 @@ body {
background-color: $m24-color-white;
color: $m24-color-black;
font-family: var(--body-font-family);
font-variant-ligatures: none;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, why was font-variant-ligatures: none specified, and only for the m24-base pages, while all other use the typeface too, without that disabled?

@wen-2018 Would you know perhaps? Or was it when the typeface was "too BETA" and used to have issues with rendering ligatures? (So is it safe to remove now?)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's likely font-variant-ligatures was disabled for M24 when the font is still in beta.

@stephaniehobson Could you confirm this is the case and we could remove them in M24 base styles now?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Font ligatures are an accessibility concern. Changing the shape of the letters by combining them introduces problems for some readers. We should keep them disabled in the base styles.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, okay, I thought that a11y override would come from UA styles, if preferred.

I'll try to make that consistent between the old and the new pages then.
Thanks for the info, appreciate it.

line-height: 1.2;
}

h1, h2, h3, h4, h5 {
color: $m24-color-black;
font-family: var(--title-font-family);
font-variant-ligatures: none;
font-weight: 600;
letter-spacing: -0.01em;
line-height: 1.1;
line-height: 1;

main & {
letter-spacing: -0.01em;
}
}

strong {
Expand Down Expand Up @@ -91,7 +92,7 @@ a:link {
font-family: var(--title-font-family);
font-size: $text-button-lg;
font-weight: 600;
line-height: 1.1;
line-height: 1;
background-image:
linear-gradient(to right, $m24-color-black 0, $m24-color-black 33%,transparent 33%, transparent 66%, $m24-color-black 66%, $m24-color-black 100%);
background-repeat: no-repeat;
Expand Down
4 changes: 4 additions & 0 deletions media/css/m24/components/navigation-refresh.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ $margin-top: 54px; // top margin offset for mobile navigation menu
display: flex;
width: 100%;

* {
line-height: 1.1;
}

@media #{$mq-md} {
display: block;
}
Expand Down
2 changes: 1 addition & 1 deletion media/css/protocol/components/_sub-navigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
font-family: var(--body-font-family);
font-size: var(--text-body-md);
font-weight: bold;
line-height: 1.5;
line-height: 1.1;
margin-bottom: 0;

a:link,
Expand Down
18 changes: 9 additions & 9 deletions media/css/protocol/protocol-mozilla-2024.scss
Original file line number Diff line number Diff line change
Expand Up @@ -119,27 +119,27 @@ template {

// type scale
--title-2xl-size: 8rem;
--title-2xl-line-height: 1.1;
--title-2xl-line-height: 1;
--title-xl-size: 5rem;
--title-xl-line-height: 1.1;
--title-xl-line-height: 1;
--title-lg-size: 3rem;
--title-lg-line-height: 1.1;
--title-lg-line-height: 1;
--title-md-size: 2.5rem;
--title-md-line-height: 1.1;
--title-md-line-height: 1;
--title-sm-size: 2rem;
--title-sm-line-height: 1.1;
--title-sm-line-height: 1;
--title-xs-size: 1.75rem;
--title-xs-line-height: 1.1;
--title-xs-line-height: 1;
--title-2xs-size: 1.5rem;
--title-2xs-line-height: 1.1;
--title-2xs-line-height: 1;
--title-3xs-size: 1.25rem;
--title-3xs-line-height: 1.1;
--title-3xs-line-height: 1;
--body-xl-size: 1.313rem;
--body-lg-size: 1.125rem;
--body-md-size: 1rem;
--body-sm-size: 0.875rem;
--body-xs-size: 0.75rem;
--body-line-height: 1.4;
--body-line-height: 1.2;
}

.mzp-t-dark {
Expand Down
Loading