Skip to content

Commit a314950

Browse files
feat(badge): add icon sizes for ionic theme (#30203)
Issue number: internal --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the current behavior? Icons inside badges don't have any specific styling. ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> According to the design, for the ionic theme, the size of icons inside badges have specific values. To accommodate those: - Added new rules for the badge sizes - Adding a new testing page and screenshot tests ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change: 1. Describe the impact and migration path for existing applications below. 2. Update the BREAKING.md file with the breaking change. 3. Add "BREAKING CHANGE: [...]" to the commit description when merging. See https://github.com/ionic-team/ionic-framework/blob/main/docs/CONTRIBUTING.md#footer for more information. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> --------- Co-authored-by: Brandy Smith <[email protected]>
1 parent d73faf5 commit a314950

File tree

56 files changed

+289
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+289
-0
lines changed

core/src/components/badge/badge.ionic.scss

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@
6060
line-height: globals.$ion-font-line-height-400;
6161
}
6262

63+
:host(.badge-xxsmall) ::slotted(ion-icon) {
64+
width: globals.$ion-scale-300;
65+
height: globals.$ion-scale-300;
66+
}
67+
6368
/* Extra Small Badge */
6469
:host(.badge-xsmall) {
6570
--padding-start: #{globals.$ion-space-100};
@@ -73,6 +78,11 @@
7378
line-height: globals.$ion-font-line-height-600;
7479
}
7580

81+
:host(.badge-xsmall) ::slotted(ion-icon) {
82+
width: globals.$ion-scale-400;
83+
height: globals.$ion-scale-400;
84+
}
85+
7686
/* Small Badge */
7787
:host(.badge-small) {
7888
--padding-start: #{globals.$ion-space-100};
@@ -86,6 +96,11 @@
8696
line-height: globals.$ion-font-line-height-600;
8797
}
8898

99+
:host(.badge-small) ::slotted(ion-icon) {
100+
width: globals.$ion-scale-500;
101+
height: globals.$ion-scale-500;
102+
}
103+
89104
/* Medium Badge */
90105
:host(.badge-medium) {
91106
min-width: globals.$ion-scale-1000;
@@ -96,6 +111,11 @@
96111
line-height: globals.$ion-font-line-height-700;
97112
}
98113

114+
:host(.badge-medium) ::slotted(ion-icon) {
115+
width: globals.$ion-scale-600;
116+
height: globals.$ion-scale-600;
117+
}
118+
99119
/* Large Badge */
100120
:host(.badge-large) {
101121
min-width: globals.$ion-scale-1200;
@@ -106,6 +126,11 @@
106126
line-height: globals.$ion-font-line-height-700;
107127
}
108128

129+
:host(.badge-large) ::slotted(ion-icon) {
130+
width: globals.$ion-scale-800;
131+
height: globals.$ion-scale-800;
132+
}
133+
109134
/* Extra Large Badge */
110135
:host(.badge-xlarge) {
111136
min-width: globals.$ion-scale-1400;
@@ -115,3 +140,8 @@
115140

116141
line-height: globals.$ion-font-line-height-700;
117142
}
143+
144+
:host(.badge-xlarge) ::slotted(ion-icon) {
145+
width: globals.$ion-scale-1000;
146+
height: globals.$ion-scale-1000;
147+
}
14.5 KB
Loading
15.8 KB
Loading
13.5 KB
Loading
14.6 KB
Loading
16.2 KB
Loading
13.6 KB
Loading
14.6 KB
Loading
14.6 KB
Loading
14.8 KB
Loading

0 commit comments

Comments
 (0)