-
Notifications
You must be signed in to change notification settings - Fork 13.4k
feat(item-divider): add recipe and tokens #31009
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 15 commits
20a4a33
8295819
38145a3
e2cf0e4
4b170f0
c66561e
fda52f5
eac584c
87e6443
d9db79f
6260629
fd9f0b5
77e50df
3336859
89bcfb4
fc0b992
226beaa
88bfce3
a9f991b
be24a41
8595353
bd9f016
ac44338
02515ef
fd73b43
1c72a1e
b9c7961
e7233e1
6266f82
5a07815
6ed2661
05092db
5b54221
a4443a5
9af22f8
02f96ba
f2b6393
8a9a4b4
918ecbe
fc978e8
6e66739
ed648e0
057bb0e
faf287a
d676a91
36eb167
d001758
ad76d36
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,199 @@ | ||
| import type { IonPadding, IonMargin } from '../../themes/themes.interfaces'; | ||
|
|
||
| export type IonItemDividerRecipe = { | ||
| background?: string; | ||
| color?: string; | ||
| minHeight?: string; | ||
|
|
||
| padding?: IonPadding; | ||
|
|
||
| inner?: { | ||
| padding?: IonPadding; | ||
| }; | ||
|
|
||
| border?: { | ||
| bottom?: string; | ||
| }; | ||
|
|
||
| font?: { | ||
| size?: string; | ||
| weight?: string; | ||
| }; | ||
|
|
||
| leading?: { | ||
| // Targets `:host([slot="start"])` | ||
| anchor?: { | ||
| margin?: IonMargin; | ||
| }; | ||
|
|
||
| // Targets `::slotted([slot="start"])` | ||
| edge?: { | ||
| margin?: IonMargin; | ||
| }; | ||
| }; | ||
|
|
||
| trailing?: { | ||
| // Targets `::slotted([slot="end"])` | ||
| edge?: { | ||
| margin?: IonMargin; | ||
| }; | ||
| }; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Naming Convention: Anchors & EdgesTo maintain consistency with the Ionic Modular architecture established in
Why this matters:
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The change between
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The naming for this was a difficult process as I tried to distinguish terms based on function and position. I'm open to any suggestions! The sooner we clarify this the sooner we can set up the structure for the other components.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm kind of confused why this rule exists: // Item Divider Slots
// --------------------------------------------------
:host([slot="start"]) {
@include mixins.margin(
var(--ion-item-divider-leading-anchor-margin-top, revert-layer),
var(--ion-item-divider-leading-anchor-margin-end, revert-layer),
var(--ion-item-divider-leading-anchor-margin-bottom, revert-layer),
var(--ion-item-divider-leading-anchor-margin-start, revert-layer)
);
}This is only applied when the item-divider itself is in the <ion-item>
<ion-item-divider slot="start">
Item Divider in Start slot
</ion-item-divider>
<ion-label>Item</ion-label>
</ion-item>I searched and did not see any examples of this. Besides that, I was mostly just thinking In the cases of slots, I think we need to rethink these names. The naming should probably apply more to what it is actually being applied to. Like this: start?: {
// Targets `:host([slot="start"])`
host?: {
margin?: IonMargin;
};
// Targets `::slotted([slot="start"])`
slotted?: {
margin?: IonMargin;
};
};
end?: {
// Targets `:host([slot="end"])`
host?: {
margin?: IonMargin;
};
// Targets `::slotted([slot="end"])`
slotted?: {
margin?: IonMargin;
};
};which becomes: // Item Divider Slots
// --------------------------------------------------
:host([slot="start"]) {
@include mixins.margin(
var(--ion-item-divider-start-host-margin-top, revert-layer),
var(--ion-item-divider-start-host-margin-end, revert-layer),
var(--ion-item-divider-start-host-margin-bottom, revert-layer),
var(--ion-item-divider-start-host-margin-start, revert-layer)
);
}
// Item Divider Slotted Elements
// ---------------------------------------------
// Slotted Start
::slotted([slot="start"]) {
@include mixins.margin-horizontal(
var(--ion-item-divider-start-slotted-margin-start, revert-layer),
var(--ion-item-divider-start-slotted-margin-end, revert-layer)
);
}
// Slotted End
::slotted([slot="end"]) {
@include mixins.margin-horizontal(
var(--ion-item-divider-end-slotted-margin-start, revert-layer),
var(--ion-item-divider-end-slotted-margin-end, revert-layer)
);
}Updating start?: {
// Targets `:host([slot="start"])`
host?: {
margin?: IonMargin;
};
// Targets `::slotted([slot="start"])`
slotted?: {
margin?: IonMargin;
};
};
end?: {
// Targets `::slotted([slot="end"])`
slotted?: {
margin?: IonMargin;
};
};
icon?: {
font?: {
size?: string;
};
start?: {
// Targets `::slotted([slot="start"])`
slotted?: {
margin?: IonMargin;
};
};
end?: {
// Targets `::slotted([slot="end"])`
slotted?: {
margin?: IonMargin;
};
};Or we could use
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| label?: { | ||
| margin?: IonMargin; | ||
| }; | ||
|
|
||
| icon?: { | ||
| font?: { | ||
| size?: string; | ||
| }; | ||
|
|
||
| leading?: { | ||
| // Targets `::slotted([slot="start"])` | ||
| edge?: { | ||
| margin?: IonMargin; | ||
| }; | ||
| }; | ||
|
|
||
| trailing?: { | ||
| // Targets `::slotted([slot="end"])` | ||
| edge?: { | ||
| margin?: IonMargin; | ||
| }; | ||
| }; | ||
|
|
||
| default?: { | ||
| color?: string; | ||
| }; | ||
|
|
||
| semantic?: { | ||
| default?: { | ||
| color?: string; | ||
| }; | ||
| }; | ||
|
Comment on lines
+67
to
+76
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This follows the same structure established in chip when it came to default vs semantic colors. |
||
| }; | ||
|
|
||
| note?: { | ||
| align?: { | ||
| self?: string; | ||
| }; | ||
|
|
||
| font?: { | ||
| size?: string; | ||
| }; | ||
|
|
||
| margin?: IonMargin; | ||
| padding?: IonPadding; | ||
| }; | ||
|
|
||
| avatar?: { | ||
| height?: string; | ||
| width?: string; | ||
|
|
||
| margin?: IonMargin; | ||
|
|
||
| leading?: { | ||
| // Targets `::slotted([slot="start"])` | ||
| edge?: { | ||
| margin?: IonMargin; | ||
| }; | ||
| }; | ||
|
|
||
| trailing?: { | ||
| // Targets `::slotted([slot="end"])` | ||
| edge?: { | ||
| margin?: IonMargin; | ||
| }; | ||
| }; | ||
| }; | ||
|
|
||
| thumbnail?: { | ||
| height?: string; | ||
| width?: string; | ||
|
|
||
| margin?: IonMargin; | ||
|
|
||
| leading?: { | ||
| // Targets `::slotted([slot="start"])` | ||
| edge?: { | ||
| margin?: IonMargin; | ||
| }; | ||
| }; | ||
|
|
||
| trailing?: { | ||
| // Targets `::slotted([slot="end"])` | ||
| edge?: { | ||
| margin?: IonMargin; | ||
| }; | ||
| }; | ||
| }; | ||
|
|
||
| header1?: { | ||
| margin?: IonMargin; | ||
| }; | ||
|
|
||
| header2?: { | ||
| margin?: IonMargin; | ||
|
|
||
| // Targets `:last-child` | ||
| trailing?: { | ||
| margin?: IonMargin; | ||
| }; | ||
| }; | ||
|
|
||
| header3?: { | ||
| margin?: IonMargin; | ||
|
|
||
| // Targets `:last-child` | ||
| trailing?: { | ||
| margin?: IonMargin; | ||
| }; | ||
| }; | ||
|
|
||
| header4?: { | ||
| margin?: IonMargin; | ||
|
|
||
| // Targets `:last-child` | ||
| trailing?: { | ||
| margin?: IonMargin; | ||
| }; | ||
| }; | ||
|
|
||
| header5?: { | ||
| margin?: IonMargin; | ||
|
|
||
| // Targets `:last-child` | ||
| trailing?: { | ||
| margin?: IonMargin; | ||
| }; | ||
| }; | ||
|
|
||
| header6?: { | ||
| margin?: IonMargin; | ||
|
|
||
| // Targets `:last-child` | ||
| trailing?: { | ||
| margin?: IonMargin; | ||
| }; | ||
| }; | ||
|
|
||
| paragraph?: { | ||
| color?: string; | ||
| overflow?: string; | ||
|
|
||
| margin?: IonMargin; | ||
|
|
||
| font?: { | ||
| size?: string; | ||
| }; | ||
|
|
||
| text?: { | ||
| overflow?: string; | ||
| }; | ||
|
|
||
| // Targets `:last-child` | ||
| trailing?: { | ||
| margin?: IonMargin; | ||
| }; | ||
| }; | ||
| }; | ||
This file was deleted.
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.