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 type scale #1019

Merged
merged 25 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
51288db
Add 36 to type scale and swap headings to use it
edwardhorsford Jul 22, 2024
4cb8907
Update changelog
edwardhorsford Jul 22, 2024
3f8aefa
Fix linting issues
edwardhorsford Jul 22, 2024
3446484
Merge branch 'update-typography-scale' of https://github.com/nhsuk/nh…
anandamaryon1 Aug 1, 2024
c4f73ea
initial commit with new type scale and test page - test page to be re…
anandamaryon1 Aug 13, 2024
bae1ff5
tweaked line-heights
anandamaryon1 Aug 13, 2024
baecfb3
font size 64 line-height tweak
anandamaryon1 Aug 13, 2024
d18bb8f
Tweak heading caption sizes
anandamaryon1 Aug 14, 2024
8e1a674
add table caption size modifier classes
anandamaryon1 Aug 14, 2024
6b39289
added caption bottom to test page, for testing
anandamaryon1 Aug 14, 2024
59c44d9
print styles WIP
anandamaryon1 Aug 19, 2024
6be7713
print style tweaks following print out testing
anandamaryon1 Aug 27, 2024
b415c70
Merge remote-tracking branch 'origin' into typo-scale-test
anandamaryon1 Sep 10, 2024
a9f1055
adjust page wrapper padding on print
anandamaryon1 Sep 10, 2024
d1c9bb4
remove testing pages
anandamaryon1 Sep 10, 2024
3228e3d
changelog
anandamaryon1 Sep 16, 2024
998932a
remove code comment
anandamaryon1 Sep 16, 2024
d5320bd
Merge remote-tracking branch 'origin' into typo-scale-test
anandamaryon1 Sep 16, 2024
c5c6d67
Merge branch 'main' into typo-scale-test
anandamaryon1 Sep 16, 2024
8cf5daa
linting fixes
anandamaryon1 Sep 17, 2024
701adad
Merge remote-tracking branch 'refs/remotes/origin/typo-scale-test' in…
anandamaryon1 Sep 17, 2024
e734575
tweak action link icon position for new line-height
anandamaryon1 Sep 17, 2024
3d5d691
update backstops
anandamaryon1 Sep 17, 2024
00ef910
update backstops
anandamaryon1 Sep 17, 2024
a925151
Merge branch 'main' into typo-scale-test
anandamaryon1 Sep 17, 2024
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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

## Unreleased

:recycle: **Changes**

- Large headings, legends and labels updated to use 36px rather than 32px. ([PR 989](https://github.com/nhsuk/nhsuk-frontend/pull/989))
- Medium headings, legends and labels updated to use 26px rather than 24px. ([Issue 445](https://github.com/nhsuk/nhsuk-service-manual-community-backlog/issues/445))
- Add sizing classes for table caption
- Reduce heading caption sizes
- Adjust print styles, making headings and body type smaller
- Fix Sass deprecation on `mix` function (passing a number without unit) ([PR 995](https://github.com/nhsuk/nhsuk-frontend/pull/995))
- Add nhsukAttributes macro, copied from GOV.UK ([PR 998](https://github.com/nhsuk/nhsuk-frontend/pull/998))
- Hide header's navigation links on print ([PR 1001](https://github.com/nhsuk/nhsuk-frontend/pull/1001))
Expand Down
6 changes: 1 addition & 5 deletions app/pages/examples.njk
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,7 @@
<li><a href="../components/warning-callout/index.html">Warning callout</a></li>
<li><a href="../components/warning-callout/custom-heading.html">Warning callout with custom heading</a></li>
</ul>

<h2>Styles</h2>
<ul class="nhsuk-list">
<li><a href="../styles/lists.html">Lists</a></li>
</ul>

{% endblock %}

{% block footer %}
Expand Down
101 changes: 0 additions & 101 deletions app/styles/lists.njk

This file was deleted.

4 changes: 2 additions & 2 deletions packages/components/action-link/_action-link.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@
height: 36px;
left: -3px;
position: absolute;
top: -2px;
top: -3px;
width: 36px;

@include mq($until: tablet) {
height: 24px;
left: -2px;
margin-bottom: 0;
top: 2px;
top: 1px;
width: 24px;
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/components/card/card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ $card-border-hover-color: $color_nhsuk-grey-3;
}

.nhsuk-card--care__heading {
@include nhsuk-font(24, $weight: bold);
@include nhsuk-font(26, $weight: bold);
@include print-color($nhsuk-print-text-color);

margin: 0;
Expand Down
2 changes: 1 addition & 1 deletion packages/components/error-summary/_error-summary.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
}

.nhsuk-error-summary__title {
@include nhsuk-font(24, $weight: bold);
@include nhsuk-font(26, $weight: bold);

margin-top: 0;
@include nhsuk-responsive-margin(4, "bottom");
Expand Down
4 changes: 2 additions & 2 deletions packages/components/fieldset/_fieldset.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@
}

.nhsuk-fieldset__legend--l {
@include nhsuk-font($size: 32, $weight: bold);
@include nhsuk-font($size: 36, $weight: bold);
margin-bottom: nhsuk-spacing(3);
}

.nhsuk-fieldset__legend--m {
@include nhsuk-font($size: 24, $weight: bold);
@include nhsuk-font($size: 26, $weight: bold);
margin-bottom: nhsuk-spacing(3);
}

Expand Down
4 changes: 2 additions & 2 deletions packages/components/label/_label.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
}

.nhsuk-label--l {
@include nhsuk-typography-responsive(32);
@include nhsuk-typography-responsive(36);
}

.nhsuk-label--m {
@include nhsuk-typography-responsive(24);
@include nhsuk-typography-responsive(26);
}

.nhsuk-label--s {
Expand Down
2 changes: 1 addition & 1 deletion packages/components/tables/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ The table Nunjucks macro takes the following arguments:
| **tableClasses** | string | No | Optional additional classes to add to the table. Separate each class with a space. |
| **attributes** | object | No | Any extra HTML attributes (for example data attributes) to add to the table. |
| **caption** | string | No | Optional caption for the table. |
| **captionClasses** | string | No | Optional additional classes to add to the table caption. Separate each class with a space. |
| **captionClasses** | string | No | Optional additional classes to add to the table caption, for example `nhsuk-table__caption--l`. Separate each class with a space. |
| **head** | array | No | Optional array of table head cells. |
| **head.[].text or head.[].html** | array | No | Optional array of table head cells. If `html` is specified, the `text` argument will be ignored. |
| **head.[].colspan** | number | No | Specify how many columns a cell extends. |
Expand Down
19 changes: 19 additions & 0 deletions packages/components/tables/_tables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Table container is used to ensure the table does not break the container.
*
* 1. Margin is removed so there isn't double spacing.
* 2. XS size not added because it matches the table header, so it'd be bad for hierarchy
*/

.nhsuk-table-container {
Expand All @@ -22,6 +23,24 @@
}
}

.nhsuk-table__caption--xl {
@include nhsuk-typography-responsive(48);
}

.nhsuk-table__caption--l {
@include nhsuk-typography-responsive(36);
}

.nhsuk-table__caption--m {
@include nhsuk-typography-responsive(26);
}

.nhsuk-table__caption--s {
@include nhsuk-typography-responsive(22);
}

/* [2] */

/* Table row hover
========================================================================== */

Expand Down
2 changes: 1 addition & 1 deletion packages/core/elements/_links.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ a {
&:after {
color: $color_nhsuk-black;
content: " (Link: " attr(href) ")"; /* [1] */
font-size: 14pt; /* [2] */
font-size: inherit; /* [2] */
}
}
}
Expand Down
66 changes: 40 additions & 26 deletions packages/core/settings/_typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,43 +32,57 @@ $nhsuk-typography-scale: (
64: (
null: (
font-size: 48px,
line-height: 56px
line-height: 54px
),
tablet: (
font-size: 64px,
line-height: 72px
line-height: 70px
),
print: (
font-size: 53pt,
font-size: 34pt,
line-height: 1.1
)
),
48: (
null: (
font-size: 32px,
line-height: 40px
line-height: 38px
),
tablet: (
font-size: 48px,
line-height: 56px
line-height: 54px
),
print: (
font-size: 32pt,
font-size: 26pt,
line-height: 1.15
)
),
32: (
36: (
null: (
font-size: 24px,
line-height: 32px
font-size: 27px,
line-height: 33px
),
tablet: (
font-size: 32px,
line-height: 40px
font-size: 36px,
line-height: 42px
),
print: (
font-size: 24pt,
line-height: 1.05
font-size: 20pt,
line-height: 1.2
)
),
26: (
null: (
font-size: 22px,
line-height: 29px
),
tablet: (
font-size: 26px,
line-height: 32px
),
print: (
font-size: 17pt,
line-height: 1.25
)
),
24: (
Expand All @@ -78,25 +92,25 @@ $nhsuk-typography-scale: (
),
tablet: (
font-size: 24px,
line-height: 32px
line-height: 31px
),
print: (
font-size: 18pt,
line-height: 1.15
font-size: 16pt,
line-height: 1.25
)
),
22: (
null: (
font-size: 18px,
line-height: 28px
font-size: 19px,
line-height: 27px
),
tablet: (
font-size: 22px,
line-height: 32px
line-height: 30px
),
print: (
font-size: 18pt,
line-height: 1.15
font-size: 15pt,
line-height: 1.25
)
),
19: (
Expand All @@ -109,8 +123,8 @@ $nhsuk-typography-scale: (
line-height: 28px
),
print: (
font-size: 14pt,
line-height: 1.15
font-size: 13pt,
line-height: 1.25
)
),
16: (
Expand All @@ -123,8 +137,8 @@ $nhsuk-typography-scale: (
line-height: 24px
),
print: (
font-size: 14pt,
line-height: 1.2
font-size: 12pt,
line-height: 1.3
)
),
14: (
Expand All @@ -138,7 +152,7 @@ $nhsuk-typography-scale: (
),
print: (
font-size: 12pt,
line-height: 1.2
line-height: 1.3
)
)
) !default;
Expand Down
Loading
Loading