Skip to content

docs(themes): add recipe conventions - #31727

Merged
thetaPC merged 9 commits into
ionic-modularfrom
recipe-conventions-doc
Nov 12, 2026
Merged

thetaPC merged 9 commits into
ionic-modularfrom
recipe-conventions-doc

Conversation

@thetaPC

@thetaPC thetaPC commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

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?

  • Adds 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 conventions
  • Links it from docs/themes/README.md

Does this introduce a breaking change?

  • Yes
  • No

Other information

The "Parents and children" section and the _my-component.docs.scss partial describe the patterns from the button migration (#31628), which isn't on ionic-modular yet.

@thetaPC
thetaPC requested a review from a team as a code owner November 10, 2026 23:31
@thetaPC
thetaPC requested a review from ShaneK November 10, 2026 23:31
@vercel

vercel Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ionic-framework Ready Ready Preview Nov 12, 2026 10:33pm UTC

Request Review

@ShaneK ShaneK left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread docs/themes/recipes.md Resolved
Comment thread docs/themes/recipes.md Resolved
Comment thread docs/themes/recipes.md Resolved
Comment thread docs/themes/recipes.md Resolved

@ShaneK ShaneK left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still looks good to me! Just a few more small things I noticed on a second pass.

Comment thread docs/themes/README.md

- 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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the partial to the tree and noted that it's for new migrations in 3e7a464.

Comment thread docs/themes/recipes.md Outdated
## 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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- 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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in f3e53fa.

@thetaPC
thetaPC merged commit a017090 into ionic-modular Nov 12, 2026
54 checks passed
@thetaPC
thetaPC deleted the recipe-conventions-doc branch November 12, 2026 22:48

This branch was successfully deployed

1 active deployment
Preview — 1b03b9dc Deployed Nov 12, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants