Repository navigation
docs(themes): add recipe conventions - #31727
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
ShaneK
left a comment
There was a problem hiding this comment.
Looks good to me, this'll be really handy to point at during migrations! Just a few small non-blocking things, mostly spots where the examples drift from the code.
Co-authored-by: Shane <[email protected]>
Co-authored-by: Shane <[email protected]>
Co-authored-by: Shane <[email protected]>
ShaneK
left a comment
There was a problem hiding this comment.
Still looks good to me! Just a few more small things I noticed on a second pass.
|
|
||
| - Back each prop union with a `const` array, such as `ION_CHIP_SIZES`, so tests can loop over every value. | ||
|
|
||
| Refer to [Recipe Conventions](./recipes.md) for how to name and structure a recipe's keys and set its values. |
There was a problem hiding this comment.
The recipes doc says the @prop comments go in a _my-component.docs.scss partial, but the file tree just above still lists four files and calls my-component.scss the single stylesheet. Could you add the partial to the tree so anyone scaffolding from it picks it up?
Right now only backdrop has one on ionic-modular, and badge and chip still keep their @prop comments in the main stylesheet. If those aren't moving yet, I think the recipes doc should say the partial is for new migrations.
There was a problem hiding this comment.
Added the partial to the tree and noted that it's for new migrations in 3e7a464.
| ## Types and files | ||
|
|
||
| - Put the recipe and config types in the component's singular `.interface.ts` file, and add both to `themes.interfaces.ts`. | ||
| - Back each prop union with a `const` array, such as `ION_CHIP_SIZES`, so tests can loop over every value. |
There was a problem hiding this comment.
| - Back each prop union with a `const` array, such as `ION_CHIP_SIZES`, so tests can loop over every value. |
This is the same as the bullet in the README right above the link to this doc. I'd keep just the README one so the two don't drift apart, but it's just a nit.
Co-authored-by: Shane <[email protected]>
Co-authored-by: Shane <[email protected]>
Issue number: internal
What is the current behavior?
Recipe conventions only live in past PR reviews, so they get reopened on each new migration.
What is the new behavior?
docs/themes/recipes.md, covering how recipe keys are named and structured, how theme values are set, how parents style children, and the file and type conventionsdocs/themes/README.mdDoes this introduce a breaking change?
Other information
The "Parents and children" section and the
_my-component.docs.scsspartial describe the patterns from the button migration (#31628), which isn't onionic-modularyet.