Skip to content

Commit

Permalink
feat: support explicit column count tokens for print
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbert authored and Yolijn committed Oct 12, 2024
1 parent 17d9813 commit df443c2
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .changeset/eleven-comics-fail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@utrecht/column-layout-css": minor
---

Add two design tokens to support explicit column count for print, or a special `column-width` for print:

- `utrecht.column-layout.print.column-count`
- `utrecht.column-layout.print.column-width`
6 changes: 6 additions & 0 deletions components/column-layout/src/_mixin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ $utrecht-support-prince-xml: false !default;
}
}

@mixin utrecht-column-layout--print {
/* render two columns by default */
column-count: var(--utrecht-column-layout-print-column-count, 2);
column-width: var(--utrecht-column-layout-print-column-width, auto);
}

@mixin utrecht-column-layout--rule {
column-rule-color: var(--utrecht-column-layout-column-rule-color);
column-rule-style: solid;
Expand Down
4 changes: 4 additions & 0 deletions components/column-layout/src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

.utrecht-column-layout {
@include utrecht-column-layout;

@media print {
@include utrecht-column-layout--print;
}
}

.utrecht-column-layout--rule {
Expand Down
22 changes: 22 additions & 0 deletions components/column-layout/src/tokens.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,28 @@
"nl.nldesignsystem.figma.supports-token": false
},
"type": "spacing"
},
"print": {
"column-count": {
"$extensions": {
"nl.nldesignsystem.css.property": {
"syntax": "<number>",
"inherits": true
},
"nl.nldesignsystem.figma.supports-token": false
},
"type": "other"
},
"column-width": {
"$extensions": {
"nl.nldesignsystem.css.property": {
"syntax": "<length>",
"inherits": true
},
"nl.nldesignsystem.figma.supports-token": false
},
"type": "sizing"
}
}
}
}
Expand Down

0 comments on commit df443c2

Please sign in to comment.