doc: add recommendation to use compound typography component (#31715)

* doc: add recommendation to use compound typograpghy component

* Update code_style.md

Co-authored-by: R Midhun Suresh <hi@midhun.dev>

---------

Co-authored-by: R Midhun Suresh <hi@midhun.dev>
This commit is contained in:
Florian Duros 2026-01-14 12:07:37 +01:00 committed by GitHub
parent 9640c330e5
commit bdee36ca7c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -272,6 +272,8 @@ Inheriting all the rules of TypeScript, the following additionally apply:
18. Components should serve a single, or near-single, purpose.
19. Prefer to derive information from component properties rather than establish state.
20. Do not use `React.Component::forceUpdate`.
21. Prefer to use [compound typography components](https://compound.element.io/?path=/docs/compound-web_typography--docs) instead of raw HTML elements for text. This ensures consistent font usage and letter spacing across the app.
22. If you can't use 21, don't forget to apply the correct CSS classes for font and letter spacing.
## Stylesheets (\*.pcss = PostCSS + Plugins)