Skip to content

Commit 8e8e8f9

Browse files
BenOsodracIonitron
andauthored
fix(button): fix tokens usage on ionic theme (#30442)
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 new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - Review button min-width and size of icons inside. - Fixed test for ionic theme, with the correct medium size. ## 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. --> [Button Ionic theme](https://ionic-framework-git-rou-11968-button-v2-ionic1.vercel.app/src/components/button/test/theme-ionic) --------- Co-authored-by: ionitron <[email protected]>
1 parent a0d5ad7 commit 8e8e8f9

File tree

53 files changed

+17
-8
lines changed

Some content is hidden

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

53 files changed

+17
-8
lines changed

core/src/components/button/button.ionic.scss

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@
102102
--padding-end: #{globals.$ion-space-400};
103103

104104
@include globals.typography(globals.$ion-body-action-sm);
105+
min-width: globals.$ion-scale-1600;
105106

106107
min-height: #{globals.$ion-scale-1000};
107108
}
@@ -111,6 +112,7 @@
111112
--padding-end: #{globals.$ion-space-500};
112113

113114
@include globals.typography(globals.$ion-body-action-md);
115+
min-width: globals.$ion-scale-1800;
114116

115117
min-height: #{globals.$ion-scale-1200};
116118
}
@@ -120,6 +122,7 @@
120122
--padding-end: #{globals.$ion-space-700};
121123

122124
@include globals.typography(globals.$ion-body-action-lg);
125+
min-width: globals.$ion-scale-2000;
123126

124127
min-height: #{globals.$ion-scale-1400};
125128
}
@@ -128,22 +131,28 @@
128131
// -------------------------------------------------------------------------------
129132

130133
/* Button containing only an icon */
131-
::slotted(ion-icon[slot="start"]),
132-
::slotted(ion-icon[slot="end"]),
133-
::slotted(ion-icon[slot="icon-only"]) {
134-
font-size: globals.$ion-font-size-500;
134+
:host(.button-small),
135+
:host(.button-medium) {
136+
::slotted(ion-icon[slot="start"]),
137+
::slotted(ion-icon[slot="end"]),
138+
::slotted(ion-icon[slot="icon-only"]) {
139+
width: globals.$ion-scale-500;
140+
height: globals.$ion-scale-500;
141+
}
135142
}
136143

137144
:host(.button-large) {
138145
::slotted(ion-icon[slot="start"]),
139146
::slotted(ion-icon[slot="end"]),
140147
::slotted(ion-icon[slot="icon-only"]) {
141-
font-size: globals.$ion-font-size-600;
148+
width: globals.$ion-scale-600;
149+
height: globals.$ion-scale-600;
142150
}
143151
}
144152

145153
:host(.button-has-icon-only) {
146154
--padding-end: var(--padding-top);
155+
min-width: unset;
147156

148157
aspect-ratio: 1 / 1;
149158
}
@@ -158,8 +167,8 @@
158167
::slotted(ion-spinner[slot="start"]),
159168
::slotted(ion-spinner[slot="end"]),
160169
::slotted(ion-spinner[slot="icon-only"]) {
161-
width: globals.$ion-space-500;
162-
height: globals.$ion-space-500;
170+
width: globals.$ion-scale-500;
171+
height: globals.$ion-scale-500;
163172
}
164173

165174
// Button Shapes

core/src/components/button/test/theme-ionic/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ <h4>Preview options</h4>
3434

3535
<p>
3636
<ion-select id="select-size" justify="space-between" interface="alert" label="Size" placeholder="">
37-
<ion-select-option selected="true" value="">default</ion-select-option>
3837
<ion-select-option value="small">Small</ion-select-option>
38+
<ion-select-option selected="true" value="medium">Medium</ion-select-option>
3939
<ion-select-option value="large">Large</ion-select-option>
4040
</ion-select>
4141

-14 Bytes
-20 Bytes
-6 Bytes

0 commit comments

Comments
 (0)