Skip to content

Commit

Permalink
fix: update letter spacing output (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
ianlnf authored Jun 4, 2024
1 parent 92909f0 commit 61e5e7d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { FontTable } from './font-table';

export function FontWeightTable() {
return (
<FontTable<string>
<FontTable<number>
name="font-weight"
tokens={meta.light.resolved.primitive.font.size}
tokens={meta.light.resolved.primitive.font.weight}
renderValue={(value) => value}
renderExample={(value) => (
<span style={{ fontWeight: value }}>Sample text</span>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
import { meta } from '@govie-ds/theme-govie';
import { FontTable } from './font-table';

function remToEm(value: string) {
return value.replace('rem', 'em');
}

export function LetterSpacingTable() {
return (
<FontTable<string>
name="letter-spacing"
tokens={meta.light.resolved.primitive.font.letterSpacing}
renderValue={(value) => value}
renderValue={(value) => remToEm(value)}
renderExample={(value) => (
<span style={{ letterSpacing: value }}>Sample text</span>
<span style={{ letterSpacing: remToEm(value) }}>Sample text</span>
)}
/>
);
Expand Down

0 comments on commit 61e5e7d

Please sign in to comment.