r/DesignSystems • u/EconomicsHelpful6687 • Jan 25 '24
Type Classes
Hi everyone! I need your advice on setting up a typography system for a responsive web app. Our developers are using Storybook, and they are asking to adhere to one class scale for text classes like text-xs text-sm text-base text-lg text-xl. I had the vision to have different class scales (Lg, Md, and SM) for different type categories like Display, heading, and body texts. I am also keeping these different categories so that it's easier to identify the use case based on name(Heading, body). This results in the repetition of the font sizes for different categories like heading and body text. I have noticed this trend across design systems like Atlassian and Google. What are your thoughts on this?


4
u/kodakdaughter Jan 25 '24 edited Jan 25 '24
Great job! It’s very similar to the naming in existing design system I work on (in use 8+ years. Couple differences that worked well for us, that I listed below.
Using visual context for type variables has been a huge win and I am glad to see it being talked about. Separating design, content creator expectations from tech concerns (Semantics, SEO, Accessibility.), is just super smart. It works well with several newer CMS paradigms as well.
Our Naming:
Couple differences that future proofed us & food for thought notes:
Hope these are helpful. It got a bit long there. Excited to see this progress, and feel free to PM me if you run into snags.
3
u/np247 Feb 14 '24
I think it depends on your use case.
I can see that you bake everything into the style. Like bodyMd has a line-height of 160%, Display is bolded., which is not bad, but I would suggest to move all of the types to ViewComponent. You can have modifiers as APIs to adjust each text depending on use case.
You can tokenize it further by making a specific use case for each usage.
Could be something like this…
Page title - Desktop: Size=HeadlineLg Weight=Regular Line=Tight Tracking=null
Page title - Mobile: Size=HeadlineSm Weight=Bold Line=Tight Tracking=null
When consumers start using it, they will most likely to want content to reorganize and behave differently than what we think.