nuxt-themes / typography

Beautifully customizable Prose components for Nuxt Content.
https://typography.nuxt.space
MIT License
164 stars 7 forks source link

Update tokens structure #20

Closed bdrtsky closed 1 year ago

bdrtsky commented 1 year ago

Current tokens structure have few limitations. For example links (and all other elements using typography.color) are not automatically inheriting color from app. There's few questions I like to discuss

  1. Simplest thing could be done is moving tokens from typography.color to color, so app colors applying without any user action. But there's a chance that user might want to have separate colors for his typography. For example, we has blue as his color.primary but he wants lightblue palette to be applied on typography.
  2. What about purely typography tokens, like typography.fontSize, typography.letterSpacing, typography.fontWeight, typography.lead? Currently they also scoped to typography. Which means that if user installs Typography, possibly could have 2 separate typography tokens, because he could have fontSize, letterSpacing, fontWeight, lead already. Does it make sense to enforce Typography tokens if user decide to install package?
  3. I would rename lead to lineHeight

I've started PR here, but then those questions appeared - https://github.com/nuxt-themes/typography/pull/19

bdrtsky commented 1 year ago

What you think @Tahul @Atinux

atinux commented 1 year ago

One solution would be to inherit typography.color.primary from color.primary so the user can customise the typography color if needed.

What do you think @bdrtsky ?

bdrtsky commented 1 year ago

Great suggestion, I've pushed it https://github.com/nuxt-themes/typography/pull/19/commits/863c5da5bec38f8e12ae066e49e7f4178294dfff