-
Notifications
You must be signed in to change notification settings - Fork 13.4k
feat(button): add support for badge #30303
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 60 commits
4b38f4a
2ea2c3a
53e64e6
293d49c
15d96fd
380c3df
82d587e
49e2e3b
715bb99
f4e4813
35bca0a
08c9a58
a93fcc7
1061f8b
1608e3e
1252527
78b5905
9a50f62
2cd81fd
bff2834
f7c2378
def8fb9
85bfa52
ac8f03f
30a3dfa
ffcade7
9e841b1
d50c383
d8ff3ac
ff966dd
4946f13
4a0b391
19671b7
3fa1864
2695132
51af9f6
d9ac8e9
065bb26
3e13b38
5827770
6346aa7
9a876f7
5954d03
762efec
06ee460
512732a
a2666e2
aa6cadc
5e0b248
a143b8b
0863a0f
6867820
1552104
823e9f1
32e9bdd
3f805a0
21a4e65
d8dee22
b7cfd97
ab9acac
ae4187c
ea679a0
518a4de
3d7ec25
6837e3e
bd8e625
379b77e
01d47c3
dc4ec1d
0f6400d
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 |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| @use "../../themes/ionic/ionic.globals.scss" as globals; | ||
| @use "../../themes/functions.color" as color; | ||
| @import "../../themes/mixins"; | ||
| @import "./badge.common.vars"; | ||
|
|
@@ -48,6 +49,14 @@ | |
| color: #{color.current-color(contrast)}; | ||
| } | ||
|
|
||
| :host(:not(.in-tab-button).badge-vertical-top) { | ||
| top: 0; | ||
| } | ||
|
|
||
| :host(:not(.in-tab-button).badge-vertical-bottom) { | ||
| bottom: 0; | ||
| } | ||
thetaPC marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| // Badge Empty (hint) | ||
| // -------------------------------------------------- | ||
|
|
||
|
|
@@ -56,10 +65,24 @@ | |
| position: absolute; | ||
| } | ||
|
|
||
| :host(:not(.in-tab-button):empty.badge-vertical-top) { | ||
| top: 0; | ||
| // Badge in Button | ||
| // -------------------------------------------------- | ||
|
|
||
| :host([vertical]:not(.in-tab-button).in-button) { | ||
| // stylelint-disable-next-line property-disallowed-list | ||
| right: globals.$ion-space-050; | ||
| } | ||
|
|
||
| :host(:not(.in-tab-button):empty.badge-vertical-bottom) { | ||
| bottom: 0; | ||
| :host(:not(:empty).in-button) { | ||
|
||
| min-width: globals.$ion-scale-400; | ||
| height: globals.$ion-scale-400; | ||
|
|
||
| font-size: globals.$ion-font-size-300; | ||
|
|
||
| line-height: globals.$ion-font-line-height-500; | ||
|
|
||
| ::slotted(ion-icon) { | ||
| width: globals.$ion-scale-300; | ||
| height: globals.$ion-scale-300; | ||
| } | ||
thetaPC marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| @use "../../themes/ionic/ionic.globals.scss" as globals; | ||
thetaPC marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| @import "./button.vars"; | ||
|
|
||
| // Button | ||
|
|
@@ -306,3 +307,25 @@ ion-ripple-effect { | |
| background: #{var(--ion-toolbar-color, var(--background))}; | ||
| color: #{var(--ion-toolbar-background, var(--color))}; | ||
| } | ||
|
|
||
| // Button Badge | ||
| // -------------------------------------------------- | ||
|
|
||
| // This rule only works in Chrome | ||
| :has(ion-badge) .button-native { | ||
| overflow: visible; | ||
| } | ||
|
|
||
| // This rule only works in Safari | ||
| :host(:has(ion-badge)) .button-native { | ||
| overflow: visible; | ||
| } | ||
thetaPC marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| :host ::slotted(ion-badge[vertical]:not(:empty)) { | ||
| @include globals.padding(globals.$ion-scale-050); | ||
|
|
||
| display: flex; | ||
|
|
||
| align-items: center; | ||
| justify-content: center; | ||
| } | ||
thetaPC marked this conversation as resolved.
Show resolved
Hide resolved
|
thetaPC marked this conversation as resolved.
Show resolved
Hide resolved
|
Uh oh!
There was an error while loading. Please reload this page.