Skip to content

Commit 8bb8d45

Browse files
authored
docs(themes): name the part before its position in recipes (#31760)
Issue number: internal
1 parent d11e129 commit 8bb8d45

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎docs/themes/recipes.md‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,17 @@ line: { height? } // not lineHeight
2727
2828
Use camel case only when no other CSS property shares the first word, such as `letterSpacing` and `zIndex`. The generated variable is the same either way (`--ion-chip-min-height`), so this only changes the TypeScript shape.
2929
30+
### Name the part first, then its position
31+
32+
A child or slotted part comes first, then `leading` or `trailing`, then the property, so everything about one part sits under one key:
33+
34+
```ts
35+
icon: { leading: { margin? }, trailing: { margin? } } // not leading: { icon: { margin? } }
36+
```
37+
38+
- `leading` is the part at the inline start (a `start` slot or `:first-child`), and `trailing` is the part at the inline end.
39+
- A position only qualifies its part. Put a value under `leading` or `trailing` only when the part's two positions need different values, and keep shared values on the part itself, like `IonChip.icon.font.size`.
40+
3041
### Use the shared spacing types
3142
3243
`padding` and `margin` use `IonPadding` and `IonMargin` from `themes.interfaces.ts`, which have `top`, `end`, `bottom` and `start` keys. Logical names keep the tokens correct in right-to-left layouts.

0 commit comments

Comments
 (0)