Skip to content

Commit a17958d

Browse files
committed
added medium size
1 parent b55e6ca commit a17958d

File tree

3 files changed

+19
-14
lines changed

3 files changed

+19
-14
lines changed

core/src/components.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -587,9 +587,9 @@ export namespace Components {
587587
*/
588588
"shape"?: 'soft' | 'round' | 'rectangular';
589589
/**
590-
* 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.
590+
* Set to `"small"` for a button with less height and padding, to `"medium"` for a button with the medium 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"?: 'small' | 'default' | 'large';
592+
"size"?: 'small' | 'default' | 'medium' | 'large';
593593
/**
594594
* If `true`, activates a button with a heavier font weight.
595595
*/
@@ -6068,9 +6068,9 @@ declare namespace LocalJSX {
60686068
*/
60696069
"shape"?: 'soft' | 'round' | 'rectangular';
60706070
/**
6071-
* 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.
6071+
* Set to `"small"` for a button with less height and padding, to `"medium"` for a button with the medium 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"?: 'small' | 'default' | 'large';
6073+
"size"?: 'small' | 'default' | 'medium' | 'large';
60746074
/**
60756075
* If `true`, activates a button with a heavier font weight.
60766076
*/

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

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,14 @@
55
// -------------------------------------------------------------------------------
66
:host {
77
--padding-top: #{globals.$ion-space-0};
8-
--padding-end: #{globals.$ion-space-500};
8+
--padding-end: #{globals.$ion-space-0};
99
--padding-bottom: var(--padding-top);
1010
--padding-start: var(--padding-end);
1111
--focus-ring-color: #{globals.$ion-border-focus-default};
1212
--focus-ring-width: #{globals.$ion-border-size-050};
1313

14-
@include globals.typography(globals.$ion-body-action-md);
15-
1614
position: relative;
1715

18-
min-height: globals.$ion-scale-1200;
19-
2016
// Target area
2117
&::after {
2218
@include globals.position(50%, 0, null, 0);
@@ -110,6 +106,15 @@
110106
min-height: #{globals.$ion-scale-1000};
111107
}
112108

109+
/* Medium Button */
110+
:host(.button-medium) {
111+
--padding-end: #{globals.$ion-space-500};
112+
113+
@include globals.typography(globals.$ion-body-action-md);
114+
115+
min-height: #{globals.$ion-scale-1200};
116+
}
117+
113118
/* Large Button */
114119
:host(.button-large) {
115120
--padding-end: #{globals.$ion-space-600};

core/src/components/button/button.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,13 @@ export class Button implements ComponentInterface, AnchorInterface, ButtonInterf
122122
@Prop({ reflect: true }) shape?: 'soft' | 'round' | 'rectangular';
123123

124124
/**
125-
* Set to `"small"` for a button with less height and padding, to `"default"`
126-
* for a button with the default height and padding, or to `"large"` for a button
125+
* Set to `"small"` for a button with less height and padding, to `"medium"`
126+
* for a button with the medium height and padding, or to `"large"` for a button
127127
* with more height and padding. By default the size is unset, unless the button
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?: 'small' | 'default' | 'large';
131+
@Prop({ reflect: true }) size?: 'small' | 'default' | 'medium' | 'large';
132132

133133
/**
134134
* If `true`, activates a button with a heavier font weight.
@@ -239,8 +239,8 @@ export class Button implements ComponentInterface, AnchorInterface, ButtonInterf
239239
private getSize(): string | undefined {
240240
const { size } = this;
241241

242-
if (size === undefined && this.inItem) {
243-
return 'small';
242+
if (size === undefined) {
243+
return this.inItem ? 'small' : 'medium';
244244
}
245245

246246
return size;

0 commit comments

Comments
 (0)