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

feat: Hyphenate headings and other large text components #1056

Merged
merged 15 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
6 changes: 6 additions & 0 deletions packages/css/src/common/hyphenation.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@mixin hyphenation {
hyphenate-limit-chars: var(--amsterdam-hyphenation-hyphenate-limit-chars);
hyphens: var(--amsterdam-hyphenation-hyphens);
overflow-wrap: var(--amsterdam-hyphenation-overflow-wrap);
word-break: var(--amsterdam-hyphenation-word-break);
}
3 changes: 3 additions & 0 deletions packages/css/src/components/blockquote/blockquote.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* Copyright (c) 2023 Gemeente Amsterdam
*/

@import "../../common/hyphenation";

@mixin reset {
box-sizing: border-box;
margin-block: 0;
Expand Down Expand Up @@ -32,6 +34,7 @@
line-height: var(--amsterdam-blockquote-spacious-line-height);
}

@include hyphenation;
@include reset;
}

Expand Down
3 changes: 3 additions & 0 deletions packages/css/src/components/heading/heading.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* Copyright (c) 2023 Gemeente Amsterdam
*/

@import "../../common/hyphenation";

@mixin reset {
box-sizing: border-box;
margin-block: 0;
Expand All @@ -16,6 +18,7 @@
font-family: var(--amsterdam-heading-font-family);
font-weight: var(--amsterdam-heading-font-weight);

@include hyphenation;
@include reset;
}

Expand Down
3 changes: 3 additions & 0 deletions packages/css/src/components/page-heading/page-heading.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* Copyright (c) 2023 Gemeente Amsterdam
*/

@import "../../common/hyphenation";

@mixin reset {
box-sizing: border-box;
margin-block: 0;
Expand All @@ -18,6 +20,7 @@
font-weight: var(--amsterdam-page-heading-font-weight);
line-height: var(--amsterdam-page-heading-spacious-line-height);

@include hyphenation;
@include reset;

.amsterdam-theme--compact & {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* Copyright (c) 2023 Gemeente Amsterdam
*/

@import "../../common/hyphenation";

.amsterdam-top-task-link {
break-inside: avoid;
display: flex;
Expand Down Expand Up @@ -32,6 +34,7 @@
line-height: var(--amsterdam-top-task-link-label-compact-line-height);
}

@include hyphenation;
alimpens marked this conversation as resolved.
Show resolved Hide resolved
@include reset;
}

Expand Down
10 changes: 10 additions & 0 deletions proprietary/tokens/src/common/amsterdam/hyphenation.tokens.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"amsterdam": {
"hyphenation": {
"hyphenate-limit-chars": { "value": "12 8 4" },
"hyphens": { "value": "auto" },
"overflow-wrap": { "value": "break-word" },
VincentSmedinga marked this conversation as resolved.
Show resolved Hide resolved
"word-break": { "value": "auto-phrase" }
alimpens marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
Loading