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

Letter-spacing #1613

Merged
merged 22 commits into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
b5498e3
fix(css): first pass @ responsive letter-spacing for h1
machikoyasuda Aug 2, 2023
67c810b
feat(css): h2 - rename p-sm to h2-sm; apply responsive letter-spacing
machikoyasuda Aug 8, 2023
333149f
chore(css): make comment clearer
machikoyasuda Aug 3, 2023
edac160
fix(agency-modal): use .h1 instead of custom font declaration
machikoyasuda Aug 8, 2023
6ea1a92
fix(css): add .h1 to font fam declaration
machikoyasuda Aug 3, 2023
8a134e6
fix(css): h1, h2 - declare font sizes responsively up front
machikoyasuda Aug 3, 2023
0044f8d
fix(css): h1, h2 - declare font sizes responsively up front
machikoyasuda Aug 8, 2023
ea037c5
fix(css): replace p-sm with h2-sm, renamed class
machikoyasuda Aug 8, 2023
b631a85
fix(css): replace p-sm with h2-sm, renamed class
machikoyasuda Aug 8, 2023
29d6f03
fix(css): add l-s for h3, h4 responsive
machikoyasuda Aug 8, 2023
fabdfcc
fix(h4): flip the 3 and 5 perc
machikoyasuda Aug 8, 2023
c47bbaa
refactor(css): card title font size/letter-spacing should come f from h4
machikoyasuda Aug 8, 2023
ce8da3b
chore: remove unused vars
machikoyasuda Aug 8, 2023
fa3c6f0
feat(css): add new body letter-spacing
machikoyasuda Aug 8, 2023
c4506ef
feat(css): footer link letter-spacing
machikoyasuda Aug 8, 2023
51976f1
feat(css): letter-spacing for buttons
machikoyasuda Aug 8, 2023
ee2c2e5
feat(css): letter-spacing for ls-base, rest of links
machikoyasuda Aug 8, 2023
540c7a3
fix: remove this for now, use from Help PR
machikoyasuda Aug 8, 2023
958baa9
fix(h2): h2 only has 1 letter-spacing percent
machikoyasuda Aug 8, 2023
7c145d8
fix(h2): add letter-spacing for h2-sm
machikoyasuda Aug 8, 2023
5163dd1
chore: omit unneeded comment
machikoyasuda Aug 8, 2023
e3975e4
fix(landing): resolve merge conflict
machikoyasuda Aug 8, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

{% block modal-content %}
<div class="container text-center">
<h3 id="{{ aria_labelledby_id }}" class="modal-title">{% translate "Please choose your transit provider:" %}</h3>
<h3 id="{{ aria_labelledby_id }}" class="modal-title h1 p-0 text-center">
{% translate "Please choose your transit provider:" %}
</h3>
<div class="row gx-lg-5 mx-lg-1 d-flex flex-column flex-lg-row text-start text-lg-center">
{% for agency in active_agencies %}
<div class="col">
Expand Down
2 changes: 1 addition & 1 deletion benefits/core/templates/core/landing.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ <h1 class="text-left p-0 ">
{% block headline %}
{% endblock headline %}
</h1>
<h2 class="p-sm pt-1 pt-lg-5 pb-4 pb-lg-5 mb-lg-2">
<h2 class="h2-sm-p pt-1 pt-lg-5 pb-4 pb-lg-5 mb-lg-2">
{% translate "Cal-ITP Benefits connects your transit benefit to your contactless card" %}
</h2>
<span role="img" aria-label="{% translate "A person holds a contactless debit card next to a card reader on a bus." %}"></span>
Expand Down
2 changes: 1 addition & 1 deletion benefits/eligibility/templates/eligibility/start.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

{% block inner-content %}
<div class="col-12 col-sm-12 col-lg-8">
<h2 class="media-title p-sm">{% translate "You will need a few items to continue:" %}</h2>
<h2 class="media-title h2-sm-p">{% translate "You will need a few items to continue:" %}</h2>
<ul class="media-list mx-0 px-0 d-flex justify-content-center flex-column">
{% block media-item %}
{% endblock media-item %}
Expand Down
116 changes: 63 additions & 53 deletions benefits/static/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
--bs-body-line-height: 1.5; /* Displayed as 150% on Figma */
--heading-line-height: 1.3; /* Displayed as 130% on Figma */
--h4-line-height: 1.2; /* Displayed as 120% on Figma */
--body-letter-spacing: 0.05em;
--letter-spacing-2: 0.02; /* Displayed as 2% on Figma */
--letter-spacing-3: 0.03; /* Displayed as 3% on Figma */
--letter-spacing-5: 0.05; /* Displayed as 5% on Figma */
--dark-color: #212121;
--hover-color: #044869;
--error-color: #ea1010;
Expand All @@ -26,9 +28,7 @@
--bs-danger: var(--error-color);
--bs-danger-rgb: var(--error-color-rgb);
--standout-color: #323a45;
--h1-font-size: calc(24rem / 16);
--h1-text-align: left;
--h2-font-size: calc(24rem / 16);
--h3-font-size: calc(20rem / 16);
--font-size-24px: calc(24rem / 16);
--font-size-20px: calc(20rem / 16);
Expand All @@ -40,14 +40,6 @@
--border-radius: calc(3rem / 16);
}

@media (min-width: 992px) {
:root {
--h1-font-size: var(--font-size-35px);
--h1-text-align: center;
--font-size-35px: calc(35rem / 16);
}
}

@font-face {
font-family: "Public Sans";
font-weight: var(--bold-font-weight);
Expand All @@ -63,6 +55,7 @@ body {
}

h1,
.h1,
h2,
.h2,
h3,
Expand Down Expand Up @@ -90,22 +83,11 @@ span,
li {
font-size: var(--bs-body-font-size);
font-weight: var(--bs-body-font-weight);
letter-spacing: var(--body-letter-spacing);
letter-spacing: calc(var(--bs-body-font-size) * var(--letter-spacing-5));
line-height: var(--bs-body-line-height);
margin: 0;
}

@media (max-width: 992px) {
/* Paragraph: Body Text, up to Small width */
.p-sm {
font-size: var(--bs-body-font-size);
font-weight: var(--bs-body-font-weight);
letter-spacing: var(--body-letter-spacing);
line-height: var(--bs-body-line-height);
margin: 0;
}
}

@media (min-width: 992px) {
/* Utility Class: Padding bottom 64px on Desktop */
/* Pair with pb-4 on Form pages to get 24px on Mobile, 64px on Desktop */
Expand All @@ -127,7 +109,7 @@ li {
}

.ls-base {
letter-spacing: var(--body-letter-spacing);
letter-spacing: calc(var(--bs-body-font-size) * var(--letter-spacing-5));
}

/* Links */
Expand Down Expand Up @@ -170,41 +152,69 @@ a[target="_blank"]::after {
/* Headlines */
/* All headlines */
h1,
.h1,
h2,
.h2,
h3,
.h3,
h4 {
font-weight: var(--bold-font-weight);
letter-spacing: var(--body-letter-spacing);
margin: 0;
}

/* H1 */
/* Mobile first: Screen width up to 992px - 24px (24rem/16 = 1.5rem) and left */
/* Screen width above 992px - 35px (35rem/16 = 2.1875rem) and centered */
/* Does not have a class. Do not apply to non-headline elements. */
h1 {
:root {
--h1-font-size: var(--font-size-24px);
--h1-letter-spacing-percent: var(--letter-spacing-3);
}

@media (min-width: 992px) {
:root {
--h1-font-size: var(--font-size-35px);
--h1-text-align: center;
--h1-letter-spacing-percent: var(--letter-spacing-5);
--font-size-35px: 2.1875rem;
}
}

h1,
.h1 {
font-size: var(--h1-font-size);
text-align: var(--h1-text-align);
padding-top: calc(70rem / 16);
line-height: var(--heading-line-height);
letter-spacing: calc(var(--h1-font-size) * var(--h1-letter-spacing-percent));
}

/* H2 */
/* Same sizes for all screen widths: 24px (24rem/16 = 1.5rem) */
/* Also has a class which can be applied to non-headline elements */
h2,
.h2 {
font-size: var(--h2-font-size);
font-size: var(--font-size-24px);
line-height: var(--heading-line-height);
letter-spacing: calc(var(--font-size-24px) * var(--letter-spacing-3));
}

@media (max-width: 992px) {
/* H2: 20px, up to Small width */
/* Only used on Help Pages */
.h2-sm {
font-size: var(--font-size-20px);
line-height: var(--heading-line-height);
letter-spacing: calc(var(--font-size-20px) * var(--letter-spacing-5));
}

/* H2: 18px, up to Small width */
/* Only used on Landing Page, Eligibility Start */
.h2-sm-p {
font-size: var(--bs-body-font-size);
font-weight: var(--bs-body-font-weight);
line-height: var(--heading-line-height);
letter-spacing: calc(var(--bs-body-font-size) * var(--letter-spacing-5));
margin: 0;
}
}

Expand All @@ -215,11 +225,26 @@ h3,
.h3 {
font-size: var(--h3-font-size);
line-height: var(--heading-line-height);
letter-spacing: calc(var(--h3-font-size) * var(--letter-spacing-5));
}

/* H4 */
/* Desktop only: Used for Agency Selector card, agency name */
/* Used for Agency Selector card, agency name */
:root {
--h4-font-size: var(--font-size-18px);
--h4-letter-spacing-percent: var(--letter-spacing-3);
}

@media (min-width: 992px) {
:root {
--h4-font-size: var(--font-size-20px);
--h4-letter-spacing-percent: var(--letter-spacing-5);
}
}

h4 {
font-size: var(--h4-font-size);
letter-spacing: calc(var(--h4-font-size) * var(--h4-letter-spacing-percent));
line-height: var(--h4-line-height);
}

Expand Down Expand Up @@ -274,7 +299,7 @@ footer .footer-links li a {
font-weight: var(--footer-link-font-weight);
font-size: var(--bs-body-font-size);
text-decoration: underline;
letter-spacing: var(--body-letter-spacing);
letter-spacing: calc(var(--bs-body-font-size) * var(--letter-spacing-5));
line-height: 50px;
}

Expand Down Expand Up @@ -334,17 +359,17 @@ footer .footer-links li a:visited {

.btn.btn-lg.btn-primary {
border-width: 2px;
letter-spacing: 0.02em;
font-weight: var(--medium-font-weight);
font-size: calc(20rem / 16);
font-size: var(--font-size-20px);
letter-spacing: calc(var(--font-size-20px) * var(--letter-spacing-2));
width: 100%;
padding: var(--primary-button-padding);
}

.btn-text {
letter-spacing: 0.02em;
font-weight: var(--medium-font-weight);
font-size: calc(20rem / 16);
font-size: var(--font-size-20px);
letter-spacing: calc(var(--font-size-20px) * var(--letter-spacing-2));
}

/* A button that actually is a text link */
Expand Down Expand Up @@ -461,7 +486,7 @@ footer .footer-links li a:visited {
padding: 2px 4px;
border-radius: var(--border-radius);
border: var(--border-width) solid var(--primary-color);
letter-spacing: 0.02em;
letter-spacing: calc(var(--bs-body-font-size) * var(--letter-spacing-2));
font-weight: 500 !important;
text-decoration: none !important;
}
Expand All @@ -471,7 +496,7 @@ footer .footer-links li a:visited {
.signout-link:visited {
font-size: var(--font-size-12px);
text-decoration: underline !important;
letter-spacing: var(--body-letter-spacing);
letter-spacing: calc(var(--font-size-12px) * var(--letter-spacing-5));
border: none;
}
}
Expand All @@ -483,7 +508,7 @@ footer .footer-links li a:visited {
color: var(--text-primary-color);
font-weight: var(--medium-font-weight);
font-size: var(--font-size-14px);
letter-spacing: var(--body-letter-spacing);
letter-spacing: calc(var(--font-size-14px) * var(--letter-spacing-5));
padding: 3.5px 2.35px; /* button dimensions are 130 x 32 */
}

Expand Down Expand Up @@ -520,7 +545,7 @@ footer .footer-links li a:visited {
.form-container .form-control-label {
font-size: var(--bs-body-font-size);
font-weight: var(--medium-font-weight);
letter-spacing: var(--body-letter-spacing);
letter-spacing: calc(var(--bs-body-font-size) * var(--letter-spacing-5));
padding-bottom: calc(12rem / 16);
}

Expand Down Expand Up @@ -632,8 +657,6 @@ h1 + .media-list, /* A .media-list immediately following the h1: Enrollment Succ
/* Cards */

:root {
--card-title-font-size: var(--font-size-18px);
--card-title-letter-spacing: 0.03em;
--card-x-padding: calc(10rem / 16);
--card-body-x-padding: 0;
--card-body-y-padding: 0.75rem;
Expand All @@ -644,8 +667,6 @@ h1 + .media-list, /* A .media-list immediately following the h1: Enrollment Succ

@media (min-width: 992px) {
:root {
--card-title-font-size: var(--font-size-20px);
--card-title-letter-spacing: 0.05rem;
--card-x-padding: calc(35rem / 16);
--card-body-x-padding: calc(40rem / 16);
--card-body-y-padding: 0;
Expand Down Expand Up @@ -677,19 +698,13 @@ a.card:focus-visible {
border-top: solid var(--card-border-width) var(--hover-color);
}

.card .card-title {
font-size: var(--card-title-font-size);
letter-spacing: var(--card-title-letter-spacing);
}

.card .card-body {
padding: 0 var(--card-body-x-padding) !important;
}

/* Modal Dialogs */

:root {
--modal-title-font-size: var(--font-size-24px);
--modal-border-radius: 8px;
--modal-body-top: -36px;
}
Expand All @@ -702,7 +717,6 @@ a.card:focus-visible {

@media (min-width: 992px) {
:root {
--modal-title-font-size: var(--font-size-35px);
--modal-border-radius: 4px;
}
}
Expand Down Expand Up @@ -737,10 +751,6 @@ a.card:focus-visible {
color: var(--text-primary-color);
}

.modal-title {
font-size: var(--modal-title-font-size);
}

.modal-info .modal-header {
z-index: 1057;
}
Expand Down