feat(button): allow button to increase in height when text wraps (#27547)
Issue number: N/A - this does not completely resolve an issue but it enables users to opt-in to having text wrap in a button by setting a minimum height --------- ## What is the current behavior? The current behavior when text is really long in a button is: - Default buttons expand in width until part of the text (and button) is off the screen and not in the visible viewport - Block and full buttons horizontally align the text in the center and overflow it on both sides (but the overflow is not visible so the text is cut off at the beginning and end) ## What is the new behavior? Allow the button height to increase when text wraps and add some padding so that buttons with wrapped text still look nice. This does **NOT** wrap the text in a button by default. That will be done in FW-4599. - Removed `text-overflow: ellipsis` since this does not have any effect - Changes `height` setting to `min-height` on all button types (small, large, default) and buttons inside of an item, toolbar or list header - Increases `padding-top` and `padding-bottom` on the buttons so that overflowing buttons have padding around them - Changes `.button-native` display property from `block` to `flex` in order for anchor tags (`<ion-button href="#">` to align their text vertically - Sets `flex-shrink: 0` on slotted `start`/`end` elements to prevent icons (and other elements) from shrinking to make room for the text - Adds e2e test for button wrapping including the different types of buttons that were changed by this PR - Adds `ion-text-wrap` to the `ion-button` elements used in this test to verify the height / padding changes are working as desired (to be removed with FW-4599) - Screenshot diffs are in the following PR: https://github.com/ionic-team/ionic-framework/pull/27561 ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change, please describe the impact and migration path for existing applications below. --> ## Other information This does **NOT** wrap the text in a button by default. It only enables buttons to look nicer and auto adjust their height/padding when the text is wrapping. After internal discussion we decided that automatically making the text wrap inside of a button may have undesired effects on existing apps. For example, if someone has a button inside of a list header with a long label, the button will now wrap if it has a space or dash in the text content. Developers should set `ion-text-wrap` on the `ion-button` to opt-in to text wrapping in a button, and this will become the default as part of FW-4599 (the next major release). --------- Co-authored-by: ionitron <hi@ionicframework.com> Co-authored-by: Liam DeBeasi <liamdebeasi@users.noreply.github.com>
@ -16,7 +16,7 @@
|
||||
|
||||
@include margin($button-ios-margin-top, $button-ios-margin-end, $button-ios-margin-bottom, $button-ios-margin-start);
|
||||
|
||||
height: #{$button-ios-height};
|
||||
min-height: #{$button-ios-min-height};
|
||||
|
||||
font-size: #{$button-ios-font-size};
|
||||
font-weight: #{$button-ios-font-weight};
|
||||
@ -92,7 +92,7 @@
|
||||
--padding-end: #{$button-ios-large-padding-end};
|
||||
--padding-bottom: #{$button-ios-large-padding-bottom};
|
||||
|
||||
height: #{$button-ios-large-height};
|
||||
min-height: #{$button-ios-large-min-height};
|
||||
|
||||
font-size: #{$button-ios-large-font-size};
|
||||
}
|
||||
@ -104,11 +104,16 @@
|
||||
--padding-end: #{$button-ios-small-padding-end};
|
||||
--padding-bottom: #{$button-ios-small-padding-bottom};
|
||||
|
||||
height: #{$button-ios-small-height};
|
||||
min-height: #{$button-ios-small-min-height};
|
||||
|
||||
font-size: #{$button-ios-small-font-size};
|
||||
}
|
||||
|
||||
:host(.button-has-icon-only) {
|
||||
--padding-top: 0;
|
||||
--padding-bottom: 0;
|
||||
}
|
||||
|
||||
|
||||
// iOS Round Button
|
||||
// --------------------------------------------------
|
||||
|
||||
@ -16,7 +16,7 @@ $button-ios-margin-bottom: 4px !default;
|
||||
$button-ios-margin-start: 2px !default;
|
||||
|
||||
/// @prop - Padding top of the button
|
||||
$button-ios-padding-top: 0 !default;
|
||||
$button-ios-padding-top: 13px !default;
|
||||
|
||||
/// @prop - Padding end of the button
|
||||
$button-ios-padding-end: 1em !default;
|
||||
@ -27,8 +27,8 @@ $button-ios-padding-bottom: $button-ios-padding-top !d
|
||||
/// @prop - Padding start of the button
|
||||
$button-ios-padding-start: $button-ios-padding-end !default;
|
||||
|
||||
/// @prop - Height of the button
|
||||
$button-ios-height: 3.1em !default;
|
||||
/// @prop - Minimum height of the button
|
||||
$button-ios-min-height: 3.1em !default;
|
||||
|
||||
/// @prop - Border radius of the button
|
||||
$button-ios-border-radius: 14px !default;
|
||||
@ -65,7 +65,7 @@ $button-ios-opacity-disabled: .5 !default;
|
||||
// --------------------------------------------------
|
||||
|
||||
/// @prop - Padding top of the large button
|
||||
$button-ios-large-padding-top: 0 !default;
|
||||
$button-ios-large-padding-top: 17px !default;
|
||||
|
||||
/// @prop - Padding end of the large button
|
||||
$button-ios-large-padding-end: 1em !default;
|
||||
@ -76,8 +76,8 @@ $button-ios-large-padding-bottom: $button-ios-large-padding-
|
||||
/// @prop - Padding start of the large button
|
||||
$button-ios-large-padding-start: $button-ios-large-padding-end !default;
|
||||
|
||||
/// @prop - Height of the large button
|
||||
$button-ios-large-height: 3.1em !default;
|
||||
/// @prop - Minimum height of the large button
|
||||
$button-ios-large-min-height: 3.1em !default;
|
||||
|
||||
/// @prop - Border radius of the large button
|
||||
$button-ios-large-border-radius: 16px !default;
|
||||
@ -90,7 +90,7 @@ $button-ios-large-font-size: 20px !default;
|
||||
// --------------------------------------------------
|
||||
|
||||
/// @prop - Padding top of the small button
|
||||
$button-ios-small-padding-top: 0 !default;
|
||||
$button-ios-small-padding-top: 4px !default;
|
||||
|
||||
/// @prop - Padding end of the small button
|
||||
$button-ios-small-padding-end: .9em !default;
|
||||
@ -101,8 +101,8 @@ $button-ios-small-padding-bottom: $button-ios-small-padding-
|
||||
/// @prop - Padding start of the small button
|
||||
$button-ios-small-padding-start: $button-ios-small-padding-end !default;
|
||||
|
||||
/// @prop - Height of the small button
|
||||
$button-ios-small-height: 2.1em !default;
|
||||
/// @prop - Minimum height of the small button
|
||||
$button-ios-small-min-height: 2.1em !default;
|
||||
|
||||
/// @prop - Border radius of the small button
|
||||
$button-ios-small-border-radius: 6px !default;
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
@include margin($button-md-margin-top, $button-md-margin-end, $button-md-margin-bottom, $button-md-margin-start);
|
||||
|
||||
height: #{$button-md-height};
|
||||
min-height: #{$button-md-min-height};
|
||||
|
||||
font-size: #{$button-md-font-size};
|
||||
font-weight: #{$button-md-font-weight};
|
||||
@ -97,7 +97,7 @@
|
||||
--padding-end: #{$button-md-large-padding-end};
|
||||
--padding-bottom: #{$button-md-large-padding-bottom};
|
||||
|
||||
height: #{$button-md-large-height};
|
||||
min-height: #{$button-md-large-min-height};
|
||||
|
||||
font-size: #{$button-md-large-font-size};
|
||||
}
|
||||
@ -108,11 +108,16 @@
|
||||
--padding-end: #{$button-md-small-padding-end};
|
||||
--padding-bottom: #{$button-md-small-padding-bottom};
|
||||
|
||||
height: #{$button-md-small-height};
|
||||
min-height: #{$button-md-small-min-height};
|
||||
|
||||
font-size: #{$button-md-small-font-size};
|
||||
}
|
||||
|
||||
:host(.button-has-icon-only) {
|
||||
--padding-top: 0;
|
||||
--padding-bottom: 0;
|
||||
}
|
||||
|
||||
|
||||
// MD strong Button
|
||||
// --------------------------------------------------
|
||||
|
||||
@ -16,19 +16,19 @@ $button-md-margin-bottom: 4px !default;
|
||||
$button-md-margin-start: 2px !default;
|
||||
|
||||
/// @prop - Padding top of the button
|
||||
$button-md-padding-top: 0 !default;
|
||||
$button-md-padding-top: 8px !default;
|
||||
|
||||
/// @prop - Padding end of the button
|
||||
$button-md-padding-end: 1.1em !default;
|
||||
|
||||
/// @prop - Padding bottom of the button
|
||||
$button-md-padding-bottom: 0 !default;
|
||||
$button-md-padding-bottom: $button-md-padding-top !default;
|
||||
|
||||
/// @prop - Padding start of the button
|
||||
$button-md-padding-start: 1.1em !default;
|
||||
|
||||
/// @prop - Height of the button
|
||||
$button-md-height: 36px !default;
|
||||
/// @prop - Minimum height of the button
|
||||
$button-md-min-height: 36px !default;
|
||||
|
||||
/// @prop - Border radius of the button
|
||||
$button-md-border-radius: 4px !default;
|
||||
@ -63,7 +63,7 @@ $button-md-opacity-disabled: .5 !default;
|
||||
// --------------------------------------------------
|
||||
|
||||
/// @prop - Padding top of the large button
|
||||
$button-md-large-padding-top: 0 !default;
|
||||
$button-md-large-padding-top: 14px !default;
|
||||
|
||||
/// @prop - Padding end of the large button
|
||||
$button-md-large-padding-end: 1em !default;
|
||||
@ -74,8 +74,8 @@ $button-md-large-padding-bottom: $button-md-large-padding
|
||||
/// @prop - Padding start of the large button
|
||||
$button-md-large-padding-start: $button-md-large-padding-end !default;
|
||||
|
||||
/// @prop - Height of the large button
|
||||
$button-md-large-height: 2.8em !default;
|
||||
/// @prop - Minimum height of the large button
|
||||
$button-md-large-min-height: 2.8em !default;
|
||||
|
||||
/// @prop - Font size of the large button
|
||||
$button-md-large-font-size: 20px !default;
|
||||
@ -85,7 +85,7 @@ $button-md-large-font-size: 20px !default;
|
||||
// --------------------------------------------------
|
||||
|
||||
/// @prop - Padding top of the small button
|
||||
$button-md-small-padding-top: 0 !default;
|
||||
$button-md-small-padding-top: 4px !default;
|
||||
|
||||
/// @prop - Padding end of the small button
|
||||
$button-md-small-padding-end: .9em !default;
|
||||
@ -96,8 +96,8 @@ $button-md-small-padding-bottom: $button-md-small-padding
|
||||
/// @prop - Padding start of the small button
|
||||
$button-md-small-padding-start: $button-md-small-padding-end !default;
|
||||
|
||||
/// @prop - Height of the small button
|
||||
$button-md-small-height: 2.1em !default;
|
||||
/// @prop - Minimum height of the small button
|
||||
$button-md-small-min-height: 2.1em !default;
|
||||
|
||||
/// @prop - Font size of the small button
|
||||
$button-md-small-font-size: 13px !default;
|
||||
|
||||
@ -55,8 +55,8 @@
|
||||
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
// TODO(FW-4599): change to normal
|
||||
white-space: nowrap;
|
||||
|
||||
user-select: none;
|
||||
@ -114,8 +114,6 @@
|
||||
:host(.button-block) .button-native {
|
||||
@include margin-horizontal(0);
|
||||
|
||||
display: block;
|
||||
|
||||
width: 100%;
|
||||
|
||||
clear: both;
|
||||
@ -138,8 +136,6 @@
|
||||
:host(.button-full) .button-native {
|
||||
@include margin-horizontal(0);
|
||||
|
||||
display: block;
|
||||
|
||||
width: 100%;
|
||||
|
||||
contain: content;
|
||||
@ -159,12 +155,17 @@
|
||||
@include padding(var(--padding-top), var(--padding-end), var(--padding-bottom), var(--padding-start));
|
||||
@include text-inherit();
|
||||
|
||||
display: block;
|
||||
display: flex;
|
||||
|
||||
position: relative;
|
||||
|
||||
align-items: center;
|
||||
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
min-height: inherit;
|
||||
|
||||
transition: var(--transition);
|
||||
|
||||
border-width: var(--border-width);
|
||||
@ -210,11 +211,20 @@
|
||||
}
|
||||
|
||||
|
||||
// Button Slots
|
||||
// --------------------------------------------------
|
||||
|
||||
::slotted([slot=start]),
|
||||
::slotted([slot=end]) {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
|
||||
// Button Icons
|
||||
// --------------------------------------------------
|
||||
|
||||
::slotted(ion-icon) {
|
||||
font-size: 1.4em;
|
||||
font-size: 1.35em;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
207
core/src/components/button/test/wrap/button.e2e.ts
Normal file
@ -0,0 +1,207 @@
|
||||
import { expect } from '@playwright/test';
|
||||
import { configs, test } from '@utils/test/playwright';
|
||||
|
||||
configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
|
||||
test.describe(title('button: wrap'), () => {
|
||||
test('should render button with long text', async ({ page }) => {
|
||||
// TODO(FW-4599): remove ion-text-wrap class
|
||||
await page.setContent(
|
||||
`
|
||||
<ion-button class="ion-text-wrap">This is the button that never ends it just goes on and on and on and on and on and on and on and on my friends</ion-button>
|
||||
`,
|
||||
config
|
||||
);
|
||||
|
||||
const button = page.locator('ion-button');
|
||||
|
||||
await expect(button).toHaveScreenshot(screenshot(`button-wrap`));
|
||||
});
|
||||
|
||||
test('should render small button with long text', async ({ page }) => {
|
||||
// TODO(FW-4599): remove ion-text-wrap class
|
||||
await page.setContent(
|
||||
`
|
||||
<ion-button class="ion-text-wrap" size="small">This is the button that never ends it just goes on and on and on and on and on and on and on and on my friends</ion-button>
|
||||
`,
|
||||
config
|
||||
);
|
||||
|
||||
const button = page.locator('ion-button');
|
||||
|
||||
await expect(button).toHaveScreenshot(screenshot(`button-wrap-small`));
|
||||
});
|
||||
|
||||
test('should render large button with long text', async ({ page }) => {
|
||||
// TODO(FW-4599): remove ion-text-wrap class
|
||||
await page.setContent(
|
||||
`
|
||||
<ion-button class="ion-text-wrap" size="large">This is the button that never ends it just goes on and on and on and on and on and on and on and on my friends</ion-button>
|
||||
`,
|
||||
config
|
||||
);
|
||||
|
||||
const button = page.locator('ion-button');
|
||||
|
||||
await expect(button).toHaveScreenshot(screenshot(`button-wrap-large`));
|
||||
});
|
||||
|
||||
test('should render button with long text and icons', async ({ page }) => {
|
||||
// TODO(FW-4599): remove ion-text-wrap class
|
||||
await page.setContent(
|
||||
`
|
||||
<ion-button class="ion-text-wrap">
|
||||
<ion-icon slot="start" name="heart"></ion-icon>
|
||||
This is the button that never ends it just goes on and on and on and on and on and on and on and on my friends
|
||||
<ion-icon slot="end" name="star"></ion-icon>
|
||||
</ion-button>
|
||||
`,
|
||||
config
|
||||
);
|
||||
|
||||
const button = page.locator('ion-button');
|
||||
|
||||
await expect(button).toHaveScreenshot(screenshot(`button-wrap-icons`));
|
||||
});
|
||||
|
||||
test('should render block button with long text', async ({ page }) => {
|
||||
// TODO(FW-4599): remove ion-text-wrap class
|
||||
await page.setContent(
|
||||
`
|
||||
<ion-button class="ion-text-wrap" expand="block">This is the button that never ends it just goes on and on and on and on and on and on and on and on my friends</ion-button>
|
||||
`,
|
||||
config
|
||||
);
|
||||
|
||||
const button = page.locator('ion-button');
|
||||
|
||||
await expect(button).toHaveScreenshot(screenshot(`button-wrap-block`));
|
||||
});
|
||||
|
||||
test('should render block button with long text and icons', async ({ page }) => {
|
||||
// TODO(FW-4599): remove ion-text-wrap class
|
||||
await page.setContent(
|
||||
`
|
||||
<ion-button class="ion-text-wrap" expand="block">
|
||||
<ion-icon slot="start" name="heart"></ion-icon>
|
||||
This is the button that never ends it just goes on and on and on and on and on and on and on and on my friends
|
||||
<ion-icon slot="end" name="star"></ion-icon>
|
||||
</ion-button>
|
||||
`,
|
||||
config
|
||||
);
|
||||
|
||||
const button = page.locator('ion-button');
|
||||
|
||||
await expect(button).toHaveScreenshot(screenshot(`button-wrap-block-icons`));
|
||||
});
|
||||
|
||||
test('should render full button with long text', async ({ page }) => {
|
||||
// TODO(FW-4599): remove ion-text-wrap class
|
||||
await page.setContent(
|
||||
`
|
||||
<ion-button class="ion-text-wrap" expand="full">This is the button that never ends it just goes on and on and on and on and on and on and on and on my friends</ion-button>
|
||||
`,
|
||||
config
|
||||
);
|
||||
|
||||
const button = page.locator('ion-button');
|
||||
|
||||
await expect(button).toHaveScreenshot(screenshot(`button-wrap-full`));
|
||||
});
|
||||
|
||||
test('should render full button with long text and icons', async ({ page }) => {
|
||||
// TODO(FW-4599): remove ion-text-wrap class
|
||||
await page.setContent(
|
||||
`
|
||||
<ion-button class="ion-text-wrap" expand="full">
|
||||
<ion-icon slot="start" name="heart"></ion-icon>
|
||||
This is the button that never ends it just goes on and on and on and on and on and on and on and on my friends
|
||||
<ion-icon slot="end" name="star"></ion-icon>
|
||||
</ion-button>
|
||||
`,
|
||||
config
|
||||
);
|
||||
|
||||
const button = page.locator('ion-button');
|
||||
|
||||
await expect(button).toHaveScreenshot(screenshot(`button-wrap-full-icons`));
|
||||
});
|
||||
|
||||
test('should render an item button with long text', async ({ page }) => {
|
||||
// TODO(FW-4599): remove ion-text-wrap class
|
||||
await page.setContent(
|
||||
`
|
||||
<ion-item>
|
||||
<ion-button class="ion-text-wrap" slot="end">
|
||||
This is the button that never ends it just goes on and on and on and on and on and on and on and on my friends
|
||||
</ion-button>
|
||||
</ion-item>
|
||||
`,
|
||||
config
|
||||
);
|
||||
|
||||
const item = page.locator('ion-item');
|
||||
|
||||
await expect(item).toHaveScreenshot(screenshot(`button-wrap-item-button`));
|
||||
});
|
||||
|
||||
test('should render an item button with long text and icons', async ({ page }) => {
|
||||
// TODO(FW-4599): remove ion-text-wrap class
|
||||
await page.setContent(
|
||||
`
|
||||
<ion-item>
|
||||
<ion-button class="ion-text-wrap" slot="end">
|
||||
<ion-icon slot="start" name="heart"></ion-icon>
|
||||
This is the button that never ends it just goes on and on and on and on and on and on and on and on my friends
|
||||
<ion-icon slot="end" name="star"></ion-icon>
|
||||
</ion-button>
|
||||
</ion-item>
|
||||
`,
|
||||
config
|
||||
);
|
||||
|
||||
const item = page.locator('ion-item');
|
||||
|
||||
await expect(item).toHaveScreenshot(screenshot(`button-wrap-item-button-icons`));
|
||||
});
|
||||
|
||||
test('should render a list header button with long text', async ({ page }) => {
|
||||
// TODO(FW-4599): remove ion-text-wrap class
|
||||
await page.setContent(
|
||||
`
|
||||
<ion-list-header>
|
||||
<ion-label>List Header</ion-label>
|
||||
<ion-button class="ion-text-wrap">
|
||||
This is the button that never ends it just goes on and on and on and on and on and on and on and on my friends
|
||||
</ion-button>
|
||||
</ion-list-header>
|
||||
`,
|
||||
config
|
||||
);
|
||||
|
||||
const listHeader = page.locator('ion-list-header');
|
||||
|
||||
await expect(listHeader).toHaveScreenshot(screenshot(`button-wrap-list-header-button`));
|
||||
});
|
||||
|
||||
test('should render a toolbar button with long text', async ({ page }) => {
|
||||
// TODO(FW-4599): remove ion-text-wrap class
|
||||
await page.setContent(
|
||||
`
|
||||
<ion-toolbar>
|
||||
<ion-buttons slot="end">
|
||||
<ion-button class="ion-text-wrap">
|
||||
This is the button that never ends it just goes on and on and on and on and on and on and on and on my friends
|
||||
</ion-button>
|
||||
</ion-buttons>
|
||||
</ion-toolbar>
|
||||
`,
|
||||
config
|
||||
);
|
||||
|
||||
const toolbar = page.locator('ion-toolbar');
|
||||
|
||||
await expect(toolbar).toHaveScreenshot(screenshot(`button-wrap-toolbar-button`));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
After Width: | Height: | Size: 5.5 KiB |
|
After Width: | Height: | Size: 8.8 KiB |
|
After Width: | Height: | Size: 5.3 KiB |
|
After Width: | Height: | Size: 5.0 KiB |
|
After Width: | Height: | Size: 8.8 KiB |
|
After Width: | Height: | Size: 4.9 KiB |
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 8.6 KiB |
|
After Width: | Height: | Size: 4.6 KiB |
|
After Width: | Height: | Size: 4.1 KiB |
|
After Width: | Height: | Size: 8.1 KiB |
|
After Width: | Height: | Size: 4.0 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 8.3 KiB |
|
After Width: | Height: | Size: 5.0 KiB |
|
After Width: | Height: | Size: 4.9 KiB |
|
After Width: | Height: | Size: 8.7 KiB |
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 8.2 KiB |
|
After Width: | Height: | Size: 4.3 KiB |
|
After Width: | Height: | Size: 4.0 KiB |
|
After Width: | Height: | Size: 7.9 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 5.5 KiB |
|
After Width: | Height: | Size: 8.8 KiB |
|
After Width: | Height: | Size: 5.3 KiB |
|
After Width: | Height: | Size: 5.0 KiB |
|
After Width: | Height: | Size: 8.8 KiB |
|
After Width: | Height: | Size: 4.9 KiB |
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 8.6 KiB |
|
After Width: | Height: | Size: 4.6 KiB |
|
After Width: | Height: | Size: 4.2 KiB |
|
After Width: | Height: | Size: 6.8 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 5.0 KiB |
|
After Width: | Height: | Size: 7.1 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 3.6 KiB |
|
After Width: | Height: | Size: 5.7 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 6.7 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 6.4 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 6.1 KiB |
|
After Width: | Height: | Size: 6.3 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 6.6 KiB |
|
After Width: | Height: | Size: 7.4 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 6.9 KiB |
|
After Width: | Height: | Size: 5.6 KiB |
|
After Width: | Height: | Size: 9.3 KiB |
|
After Width: | Height: | Size: 5.4 KiB |
|
After Width: | Height: | Size: 4.1 KiB |
|
After Width: | Height: | Size: 8.1 KiB |
|
After Width: | Height: | Size: 4.0 KiB |
|
After Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 5.5 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 6.6 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 5.3 KiB |
|
After Width: | Height: | Size: 8.7 KiB |
|
After Width: | Height: | Size: 4.9 KiB |
|
After Width: | Height: | Size: 4.6 KiB |
|
After Width: | Height: | Size: 7.5 KiB |
|
After Width: | Height: | Size: 4.6 KiB |
121
core/src/components/button/test/wrap/index.html
Normal file
@ -0,0 +1,121 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" dir="ltr">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>Button - Wrap</title>
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
|
||||
/>
|
||||
<link href="../../../../../css/ionic.bundle.css" rel="stylesheet" />
|
||||
<link href="../../../../../scripts/testing/styles.css" rel="stylesheet" />
|
||||
<script src="../../../../../scripts/testing/scripts.js"></script>
|
||||
<script nomodule src="../../../../../dist/ionic/ionic.js"></script>
|
||||
<script type="module" src="../../../../../dist/ionic/ionic.esm.js"></script>
|
||||
|
||||
<style>
|
||||
h2 {
|
||||
font-size: 12px;
|
||||
font-weight: normal;
|
||||
|
||||
color: #6f7378;
|
||||
|
||||
margin-top: 10px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<ion-app>
|
||||
<ion-content class="ion-padding" no-bounce>
|
||||
<h2>Item</h2>
|
||||
<ion-item>
|
||||
<ion-button slot="end">
|
||||
This is the button that never ends it just goes on and on and on and on and on and on and on and on my
|
||||
friends
|
||||
</ion-button>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-button size="default" slot="end">
|
||||
This is the button that never ends it just goes on and on and on and on and on and on and on and on my
|
||||
friends
|
||||
</ion-button>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-button size="large" slot="end">
|
||||
This is the button that never ends it just goes on and on and on and on and on and on and on and on my
|
||||
friends
|
||||
</ion-button>
|
||||
</ion-item>
|
||||
|
||||
<h2>Toolbar</h2>
|
||||
<ion-toolbar>
|
||||
<ion-buttons slot="end">
|
||||
<ion-button>
|
||||
This is the button that never ends it just goes on and on and on and on and on and on and on and on my
|
||||
friends
|
||||
</ion-button>
|
||||
</ion-buttons>
|
||||
</ion-toolbar>
|
||||
|
||||
<h2>Default</h2>
|
||||
<ion-button>Button</ion-button>
|
||||
<ion-button
|
||||
>This is the button that never ends it just goes on and on and on and on and on and on and on and on my
|
||||
friends</ion-button
|
||||
>
|
||||
<ion-button>
|
||||
<ion-icon slot="start" name="heart"></ion-icon>
|
||||
This is the button that never ends it just goes on and on and on and on and on and on and on and on my friends
|
||||
<ion-icon slot="end" name="star"></ion-icon>
|
||||
</ion-button>
|
||||
|
||||
<h2>Small</h2>
|
||||
<ion-button size="small">Button</ion-button>
|
||||
<ion-button size="small">
|
||||
This is the button that never ends it just goes on and on and on and on and on and on and on and on my friends
|
||||
</ion-button>
|
||||
<ion-button size="small">
|
||||
<ion-icon slot="start" name="heart"></ion-icon>
|
||||
This is the button that never ends it just goes on and on and on and on and on and on and on and on my friends
|
||||
<ion-icon slot="end" name="star"></ion-icon>
|
||||
</ion-button>
|
||||
|
||||
<h2>Large</h2>
|
||||
<ion-button size="large">Button</ion-button>
|
||||
<ion-button size="large">
|
||||
This is the button that never ends it just goes on and on and on and on and on and on and on and on my friends
|
||||
</ion-button>
|
||||
<ion-button size="large">
|
||||
<ion-icon slot="start" name="heart"></ion-icon>
|
||||
This is the button that never ends it just goes on and on and on and on and on and on and on and on my friends
|
||||
<ion-icon slot="end" name="star"></ion-icon>
|
||||
</ion-button>
|
||||
|
||||
<h2>Block</h2>
|
||||
<ion-button expand="block">Button</ion-button>
|
||||
<ion-button expand="block"
|
||||
>This is the button that never ends it just goes on and on and on and on and on and on and on and on my
|
||||
friends</ion-button
|
||||
>
|
||||
<ion-button expand="block">
|
||||
<ion-icon slot="start" name="heart"></ion-icon>
|
||||
This is the button that never ends it just goes on and on and on and on and on and on and on and on my friends
|
||||
<ion-icon slot="end" name="star"></ion-icon>
|
||||
</ion-button>
|
||||
|
||||
<h2>Full</h2>
|
||||
<ion-button expand="full">Button</ion-button>
|
||||
<ion-button expand="full"
|
||||
>This is the button that never ends it just goes on and on and on and on and on and on and on and on my
|
||||
friends</ion-button
|
||||
>
|
||||
<ion-button expand="full">
|
||||
<ion-icon slot="start" name="heart"></ion-icon>
|
||||
This is the button that never ends it just goes on and on and on and on and on and on and on and on my friends
|
||||
<ion-icon slot="end" name="star"></ion-icon>
|
||||
</ion-button>
|
||||
</ion-content>
|
||||
</ion-app>
|
||||
</body>
|
||||
</html>
|
||||
@ -6,12 +6,19 @@
|
||||
// --------------------------------------------------
|
||||
|
||||
::slotted(*) ion-button {
|
||||
--padding-top: 3px;
|
||||
--padding-bottom: 3px;
|
||||
--padding-start: 5px;
|
||||
--padding-end: 5px;
|
||||
|
||||
@include margin-horizontal(2px, 2px);
|
||||
|
||||
height: 32px;
|
||||
min-height: 32px;
|
||||
}
|
||||
|
||||
::slotted(*) .button-has-icon-only {
|
||||
--padding-top: 0;
|
||||
--padding-bottom: 0;
|
||||
}
|
||||
|
||||
::slotted(*) ion-button:not(.button-round) {
|
||||
|
||||
@ -5,15 +5,20 @@
|
||||
// --------------------------------------------------
|
||||
|
||||
::slotted(*) ion-button {
|
||||
--padding-top: 0;
|
||||
--padding-bottom: 0;
|
||||
--padding-top: 3px;
|
||||
--padding-bottom: 3px;
|
||||
--padding-start: 8px;
|
||||
--padding-end: 8px;
|
||||
--box-shadow: none;
|
||||
|
||||
@include margin-horizontal(2px, 2px);
|
||||
|
||||
height: 32px;
|
||||
min-height: 32px;
|
||||
}
|
||||
|
||||
::slotted(*) .button-has-icon-only {
|
||||
--padding-top: 0;
|
||||
--padding-bottom: 0;
|
||||
}
|
||||
|
||||
::slotted(*) ion-button:not(.button-round) {
|
||||
|
||||
@ -154,12 +154,12 @@
|
||||
// --------------------------------------------------
|
||||
|
||||
::slotted(.button-small) {
|
||||
--padding-top: 0px;
|
||||
--padding-bottom: 0px;
|
||||
--padding-top: 1px;
|
||||
--padding-bottom: 1px;
|
||||
--padding-start: .5em;
|
||||
--padding-end: .5em;
|
||||
|
||||
height: 24px;
|
||||
min-height: 24px;
|
||||
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
@ -331,12 +331,12 @@
|
||||
// --------------------------------------------------
|
||||
|
||||
::slotted(.button-small) {
|
||||
--padding-top: 0;
|
||||
--padding-bottom: 0;
|
||||
--padding-top: 2px;
|
||||
--padding-bottom: 2px;
|
||||
--padding-start: .6em;
|
||||
--padding-end: .6em;
|
||||
|
||||
height: 25px;
|
||||
min-height: 25px;
|
||||
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 79 KiB |
|
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 63 KiB |
|
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 74 KiB |