Skip to content

Commit af6c2ca

Browse files
committed
remve xsmall and xlarge sizes
1 parent 957666f commit af6c2ca

File tree

4 files changed

+9
-57
lines changed

4 files changed

+9
-57
lines changed

core/src/components.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ export namespace Components {
589589
/**
590590
* Set to `"small"` for a button with less height and padding, to `"default"` for a button with the default height and padding, or to `"large"` for a button with more height and padding. By default the size is unset, unless the button is inside of an item, where the size is `"small"` by default. Set the size to `"default"` inside of an item to make it a standard size button.
591591
*/
592-
"size"?: 'xsmall' | 'small' | 'default' | 'large' | 'xlarge';
592+
"size"?: 'small' | 'default' | 'large';
593593
/**
594594
* If `true`, activates a button with a heavier font weight.
595595
*/
@@ -6070,7 +6070,7 @@ declare namespace LocalJSX {
60706070
/**
60716071
* Set to `"small"` for a button with less height and padding, to `"default"` for a button with the default height and padding, or to `"large"` for a button with more height and padding. By default the size is unset, unless the button is inside of an item, where the size is `"small"` by default. Set the size to `"default"` inside of an item to make it a standard size button.
60726072
*/
6073-
"size"?: 'xsmall' | 'small' | 'default' | 'large' | 'xlarge';
6073+
"size"?: 'small' | 'default' | 'large';
60746074
/**
60756075
* If `true`, activates a button with a heavier font weight.
60766076
*/

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

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,7 @@
102102
// -------------------------------------------------------------------------------
103103

104104
/* Small Button */
105-
/* Extra Small Button */
106-
:host(.button-small),
107-
:host(.button-xsmall) {
105+
:host(.button-small) {
108106
--padding-top: #{globals.$ion-space-200};
109107
--padding-end: #{globals.$ion-space-400};
110108

@@ -114,9 +112,7 @@
114112
}
115113

116114
/* Large Button */
117-
/* Extra Large Button */
118-
:host(.button-large),
119-
:host(.button-xlarge) {
115+
:host(.button-large) {
120116
--padding-top: #{globals.$ion-space-400};
121117
--padding-end: #{globals.$ion-space-600};
122118

@@ -135,10 +131,8 @@
135131
font-size: globals.$ion-font-size-400;
136132
}
137133

138-
:host(.button-xsmall),
139134
:host(.button-small),
140-
:host(.button-large),
141-
:host(.button-xlarge) {
135+
:host(.button-large) {
142136
::slotted(ion-icon[slot="start"]),
143137
::slotted(ion-icon[slot="end"]),
144138
::slotted(ion-icon[slot="icon-only"]) {
@@ -166,11 +160,6 @@
166160
height: globals.$ion-space-500;
167161
}
168162

169-
:host(.button-xlarge) ::slotted(ion-spinner) {
170-
width: globals.$ion-space-600;
171-
height: globals.$ion-space-600;
172-
}
173-
174163
// Button Shapes
175164
// -------------------------------------------------------------------------------
176165

@@ -181,7 +170,6 @@
181170
--border-radius: #{globals.$ion-border-radius-200};
182171
}
183172

184-
:host(.button-soft.button-xsmall),
185173
:host(.button-soft.button-small) {
186174
--border-radius: #{globals.$ion-border-radius-100};
187175
}
@@ -247,8 +235,6 @@
247235
font-size: globals.$ion-font-size-500;
248236
}
249237

250-
:host(.button-xsmall) ::slotted(ion-icon[slot="start"]),
251-
:host(.button-xsmall) ::slotted(ion-spinner[slot="start"]),
252238
:host(.button-small) ::slotted(ion-icon[slot="start"]),
253239
:host(.button-small) ::slotted(ion-spinner[slot="start"]) {
254240
@include globals.margin-horizontal(null, globals.$ion-space-200);
@@ -260,14 +246,10 @@
260246
}
261247

262248
:host(.button-large) ::slotted(ion-icon[slot="start"]),
263-
:host(.button-large) ::slotted(ion-spinner[slot="start"]),
264-
:host(.button-xlarge) ::slotted(ion-icon[slot="start"]),
265-
:host(.button-xlarge) ::slotted(ion-spinner[slot="start"]) {
249+
:host(.button-large) ::slotted(ion-spinner[slot="start"]) {
266250
@include globals.margin-horizontal(null, globals.$ion-space-300);
267251
}
268252

269-
:host(.button-xsmall) ::slotted(ion-icon[slot="end"]),
270-
:host(.button-xsmall) ::slotted(ion-spinner[slot="end"]),
271253
:host(.button-small) ::slotted(ion-icon[slot="end"]),
272254
:host(.button-small) ::slotted(ion-spinner[slot="end"]) {
273255
@include globals.margin-horizontal(globals.$ion-space-200, null);
@@ -279,9 +261,7 @@
279261
}
280262

281263
:host(.button-large) ::slotted(ion-icon[slot="end"]),
282-
:host(.button-large) ::slotted(ion-spinner[slot="end"]),
283-
:host(.button-xlarge) ::slotted(ion-icon[slot="end"]),
284-
:host(.button-xlarge) ::slotted(ion-spinner[slot="end"]) {
264+
:host(.button-large) ::slotted(ion-spinner[slot="end"]) {
285265
@include globals.margin-horizontal(globals.$ion-space-300, null);
286266
}
287267

core/src/components/button/button.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export class Button implements ComponentInterface, AnchorInterface, ButtonInterf
128128
* is inside of an item, where the size is `"small"` by default. Set the size to
129129
* `"default"` inside of an item to make it a standard size button.
130130
*/
131-
@Prop({ reflect: true }) size?: 'xsmall' | 'small' | 'default' | 'large' | 'xlarge';
131+
@Prop({ reflect: true }) size?: 'small' | 'default' | 'large';
132132

133133
/**
134134
* If `true`, activates a button with a heavier font weight.
@@ -233,20 +233,15 @@ export class Button implements ComponentInterface, AnchorInterface, ButtonInterf
233233
}
234234

235235
/**
236-
* Disable the "xsmall" and "xlarge" sizes if the theme is "ios" or "md"
236+
* Set the size based if the button is inside of an item, the default size is "small"
237237
*/
238238
private getSize(): string | undefined {
239-
const theme = getIonTheme(this);
240239
const { size } = this;
241240

242241
if (size === undefined && this.inItem) {
243242
return 'small';
244243
}
245244

246-
if ((theme === 'ios' || theme === 'md') && (size === 'xsmall' || size === 'xlarge')) {
247-
return undefined;
248-
}
249-
250245
return size;
251246
}
252247

core/src/components/button/test/size/button.e2e.ts

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -60,26 +60,3 @@ configs({ directions: ['ltr'], modes: ['ionic-md', 'md', 'ios'] }).forEach(({ ti
6060
});
6161
});
6262
});
63-
64-
/**
65-
* The following tests are specific to the Ionic theme and do not depend on the text direction.
66-
*/
67-
configs({ directions: ['ltr'], modes: ['ionic-md'] }).forEach(({ title, screenshot, config }) => {
68-
test.describe(title('button: size'), () => {
69-
test('should render xsmall buttons', async ({ page }) => {
70-
await page.setContent(`<ion-button size="xsmall" fill="solid">X-Small Button</ion-button>`, config);
71-
72-
const wrapper = page.locator('ion-button');
73-
74-
await expect(wrapper).toHaveScreenshot(screenshot(`button-size-x-small`));
75-
});
76-
77-
test('should render xlarge buttons', async ({ page }) => {
78-
await page.setContent(`<ion-button size="xlarge" fill="solid">X-Large Button</ion-button>`, config);
79-
80-
const wrapper = page.locator('ion-button');
81-
82-
await expect(wrapper).toHaveScreenshot(screenshot(`button-size-x-large`));
83-
});
84-
});
85-
});

0 commit comments

Comments
 (0)