Skip to content

Commit

Permalink
Hyphenation mixin and deleted lines rule
Browse files Browse the repository at this point in the history
  • Loading branch information
dlnr committed Jan 26, 2024
1 parent 95423b2 commit ff88525
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 5 deletions.
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: 12 8 4;
hyphens: auto;
overflow-wrap: break-word;
word-break: break-word;
}
8 changes: 3 additions & 5 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 @@ -15,12 +17,8 @@
color: var(--amsterdam-heading-color);
font-family: var(--amsterdam-heading-font-family);
font-weight: var(--amsterdam-heading-font-weight);
hyphenate-limit-chars: 12 8 4;
hyphenate-limit-lines: 2;
hyphens: auto;
overflow-wrap: break-word;
word-break: break-word;

@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
3 changes: 3 additions & 0 deletions packages/css/src/components/top-task-link/top-task-link.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";

.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;
@include reset;
}

Expand Down
11 changes: 11 additions & 0 deletions proprietary/tokens/src/common/amsterdam/hyphenation.tokens.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"amsterdam": {
"hyphenation": {
"hyphenate-limit-chars": { "value": "12 8 4" },
"hyphenate-limit-lines": { "value": "2" },
"hyphens": { "value": "auto" },
"overflow-wrap": { "value": "break-word" },
"word-break": { "value": "break-word" }
}
}
}

0 comments on commit ff88525

Please sign in to comment.