Skip to content

Commit

Permalink
Transform text tokens to rem in CSS variables (#1944)
Browse files Browse the repository at this point in the history
* Tokens: Transform text tokens to rem

* Create healthy-dragons-bathe.md
  • Loading branch information
splashdust authored Jan 24, 2025
1 parent 4933535 commit 33788ef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/healthy-dragons-bathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sebgroup/green-core': minor
---

**Text:** Font-sizes are now defined as rem units
9 changes: 3 additions & 6 deletions libs/tokens/src/formats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ const formats: Record<string, Format> = {
.replace('typography-', 'text-')
return Object.assign({}, token, {
name: adjustedName,
value: `${token.value}px`,
original: { value: `${token.value}px` },
value: `${token.value / 16}rem`,
original: { value: `${token.value / 16}rem` },
})
} else if (
token.path[0] === 'sys' &&
Expand Down Expand Up @@ -378,10 +378,7 @@ const formats: Record<string, Format> = {
name: 'scss/variables',
formatter: function (args) {
const dictionary = Object.assign({}, args.dictionary)
const options = Object.assign(
{ colorScheme: 'light' },
args.options,
)
const options = Object.assign({ colorScheme: 'light' }, args.options)

const { colorScheme, name, outputReferences } = options

Expand Down

0 comments on commit 33788ef

Please sign in to comment.