chakra-ui / panda

🐼 Universal, Type-Safe, CSS-in-JS Framework for Product Teams ⚡️
https://panda-css.com
MIT License
5.23k stars 236 forks source link

Docs ambiguity: can textStyles be defined without extends? #1926

Closed JoshuaKGoldberg closed 10 months ago

JoshuaKGoldberg commented 10 months ago

Subject

textStyles

Description

Right now, the guide in https://panda-css.com/docs/theming/text-styles suggests creating a separate text-styles.ts file and using theme.extends.textStyles in panda.config.ts. That seems unclear to me on a few points:

Whatever the answers to all these questions, requesting they be placed in the docs please. 🙂

astahmer commented 10 months ago

quickly answering in the meantime:

can textStyles be defined without extends

yes, the extend keyword just means that you want to deep merge your config with the presets (both built-ins & customs), if you're omitting it that means you'll erase everything else but your own config

Is there a reason a separate text-styles.ts file is being recommended rather than doing it inline in panda.config.ts

no, do as you wish

If we can do it in panda.config.ts, would directly setting it in the config be ok

yes

If directly setting it in the config is ok, can we bypass defineTextStyles

yes, those functions from @pandacss/dev are just type helpers, they don't do anything at runtime