Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions core/src/components/button/button.ios.vars.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ $button-ios-height: 3.1em !default;
$button-ios-border-radius: 14px !default;

/// @prop - Font size of the button text
$button-ios-font-size: 16px !default;
/// The maximum font size is calculated by taking the default font size
/// and multiplying it by 3, since 310% of the default is the maximum
$button-ios-font-size: min(1rem, 48px) !default;
Comment thread
brandyscarney marked this conversation as resolved.

/// @prop - Font weight of the button text
$button-ios-font-weight: 500 !default;
Expand Down Expand Up @@ -83,7 +85,9 @@ $button-ios-large-height: 3.1em !default;
$button-ios-large-border-radius: 16px !default;

/// @prop - Font size of the large button
$button-ios-large-font-size: 20px !default;
/// The maximum font size is calculated by taking the default font size
/// and multiplying it by 3, since 310% of the default is the maximum
$button-ios-large-font-size: min(1.25rem, 60px) !default;
Comment thread
brandyscarney marked this conversation as resolved.


// iOS Small Button
Expand All @@ -108,7 +112,9 @@ $button-ios-small-height: 2.1em !default;
$button-ios-small-border-radius: 6px !default;

/// @prop - Font size of the small button
$button-ios-small-font-size: 13px !default;
/// The maximum font size is calculated by taking the default font size
/// and multiplying it by 3, since 310% of the default is the maximum
$button-ios-small-font-size: min(0.8125rem, 39px) !default;
Comment thread
brandyscarney marked this conversation as resolved.


// iOS Outline Button
Expand Down Expand Up @@ -151,13 +157,15 @@ $button-ios-outline-background-color-focused: ion-color(primary, base, $
// --------------------------------------------------

/// @prop - Font size of the clear button
$button-ios-clear-font-size: 17px !default;
/// The maximum font size is calculated by taking the default font size
/// and multiplying it by 3, since 310% of the default is the maximum
$button-ios-clear-font-size: min(1.0625rem, 51px) !default;
Comment thread
brandyscarney marked this conversation as resolved.

/// @prop - Font weight of the clear button
$button-ios-clear-font-weight: normal !default;

/// @prop - Letter spacing of the button
$button-ios-letter-spacing: 0 !default;
$button-ios-letter-spacing: 0 !default;

/// @prop - Border color of the clear button
$button-ios-clear-border-color: transparent !default;
Expand Down
6 changes: 3 additions & 3 deletions core/src/components/button/button.md.vars.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ $button-md-height: 36px !default;
$button-md-border-radius: 4px !default;

/// @prop - Font size of the button text
$button-md-font-size: 14px !default;
$button-md-font-size: 0.875rem !default;

/// @prop - Font weight of the button text
$button-md-font-weight: 500 !default;
Expand Down Expand Up @@ -78,7 +78,7 @@ $button-md-large-padding-start: $button-md-large-padding
$button-md-large-height: 2.8em !default;

/// @prop - Font size of the large button
$button-md-large-font-size: 20px !default;
$button-md-large-font-size: 1.25rem !default;


// Material Design Small Button
Expand All @@ -100,7 +100,7 @@ $button-md-small-padding-start: $button-md-small-padding
$button-md-small-height: 2.1em !default;

/// @prop - Font size of the small button
$button-md-small-font-size: 13px !default;
$button-md-small-font-size: 0.8125rem !default;


// Material Design Outline Button
Expand Down
82 changes: 82 additions & 0 deletions core/src/components/button/test/a11y/button.e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
import { expect } from '@playwright/test';
import { configs, test } from '@utils/test/playwright';

configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
test.describe(title('button: font scaling'), () => {
test('should scale default button text on larger font sizes', async ({ page }) => {
await page.setContent(
`
<style>
html {
font-size: 310%;
}
</style>

<ion-button>Default</ion-button>
`,
config
);

const button = page.locator('ion-button');

await expect(button).toHaveScreenshot(screenshot(`button-default-scale`));
});

test('should scale clear button text on larger font sizes', async ({ page }) => {
await page.setContent(
`
<style>
html {
font-size: 310%;
}
</style>

<ion-button fill="clear">Clear</ion-button>
`,
config
);

const button = page.locator('ion-button');

await expect(button).toHaveScreenshot(screenshot(`button-clear-scale`));
});

test('should scale small button text on larger font sizes', async ({ page }) => {
await page.setContent(
`
<style>
html {
font-size: 310%;
}
</style>

<ion-button size="small">Small</ion-button>
`,
config
);

const button = page.locator('ion-button');

await expect(button).toHaveScreenshot(screenshot(`button-small-scale`));
});

test('should scale large button text on larger font sizes', async ({ page }) => {
await page.setContent(
`
<style>
html {
font-size: 310%;
}
</style>

<ion-button size="large">Large</ion-button>
`,
config
);

const button = page.locator('ion-button');

await expect(button).toHaveScreenshot(screenshot(`button-large-scale`));
});
});
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.