Skip to content

Commit 45907aa

Browse files
authored
feat(checkbox): update styles to iOS 17 specs (#28729)
1 parent 4649637 commit 45907aa

File tree

191 files changed

+27
-7
lines changed

Some content is hidden

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

191 files changed

+27
-7
lines changed

core/src/components/alert/alert.ios.vars.scss

+4-4
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,10 @@ $alert-ios-checkbox-margin-bottom: 10px !default;
264264
$alert-ios-checkbox-margin-start: 16px !default;
265265

266266
/// @prop - Size of the checkbox in the alert
267-
$alert-ios-checkbox-size: dynamic-font-max(24px, 2.75) !default;
267+
$alert-ios-checkbox-size: dynamic-font-max(22px, 2.538) !default;
268268

269269
/// @prop - Border width of the checkbox in the alert
270-
$alert-ios-checkbox-border-width: dynamic-font(1px) !default;
270+
$alert-ios-checkbox-border-width: dynamic-font(2px) !default;
271271

272272
/// @prop - Border style of the checkbox in the alert
273273
$alert-ios-checkbox-border-style: solid !default;
@@ -288,10 +288,10 @@ $alert-ios-checkbox-background-color-off: $item-ios-background !de
288288
$alert-ios-checkbox-background-color-on: ion-color(primary, base) !default;
289289

290290
/// @prop - Top of the icon in the checkbox alert
291-
$alert-ios-checkbox-icon-top: calc($alert-ios-checkbox-size / 6) !default;
291+
$alert-ios-checkbox-icon-top: calc($alert-ios-checkbox-size / 8) !default;
292292

293293
/// @prop - Start of the icon in the checkbox alert
294-
$alert-ios-checkbox-icon-start: calc($alert-ios-checkbox-size / 3 + 1px) !default;
294+
$alert-ios-checkbox-icon-start: calc($alert-ios-checkbox-size / 3) !default;
295295

296296
/// @prop - Width of the icon in the checkbox alert
297297
$alert-ios-checkbox-icon-width: calc($alert-ios-checkbox-size / 6 + 1px) !default;

core/src/components/checkbox/checkbox.ios.scss

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616

1717
// Size
1818
--size: #{$checkbox-ios-icon-size};
19+
20+
// Checkmark width
21+
--checkmark-width: #{$checkbox-ios-icon-checkmark-width};
1922
}
2023

2124

core/src/components/checkbox/checkbox.ios.vars.scss

+5-2
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
$checkbox-ios-background-color-off: $item-ios-background !default;
1010

1111
/// @prop - Size of the checkbox icon
12-
$checkbox-ios-icon-size: dynamic-font-max(26px, 2.538) !default;
12+
$checkbox-ios-icon-size: dynamic-font-max(22px, 2.538) !default;
1313

1414
/// @prop - Border color of the checkbox icon when off
1515
$checkbox-ios-icon-border-color-off: rgba($text-color-rgb, 0.23) !default;
1616

1717
/// @prop - Border width of the checkbox icon
18-
$checkbox-ios-icon-border-width: dynamic-font(1px) !default;
18+
$checkbox-ios-icon-border-width: dynamic-font(2px) !default;
1919

2020
/// @prop - Border style of the checkbox icon
2121
$checkbox-ios-icon-border-style: solid !default;
@@ -49,3 +49,6 @@ $checkbox-ios-item-end-margin-bottom: 9px !default;
4949

5050
/// @prop - Margin start of the right checkbox item
5151
$checkbox-ios-item-end-margin-start: 0 !default;
52+
53+
/// @prop - Checkmark width of the checkbox icon
54+
$checkbox-ios-icon-checkmark-width: 1.5px !default;

core/src/components/checkbox/checkbox.scss

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
--checkbox-background-checked: #{ion-color(primary, base)};
2626
--border-color-checked: #{ion-color(primary, base)};
2727
--checkmark-color: #{ion-color(primary, contrast)};
28-
--checkmark-width: 1;
2928
--transition: none;
3029

3130
display: inline-block;

core/src/components/checkbox/test/basic/checkbox.e2e.ts

+15
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,21 @@ import { configs, test } from '@utils/test/playwright';
33

44
configs().forEach(({ title, screenshot, config }) => {
55
test.describe(title('checkbox: basic visual tests'), () => {
6+
test('should not have visual regressions', async ({ page }) => {
7+
await page.setContent(
8+
`
9+
<div id="checkboxes">
10+
<ion-checkbox>Unchecked</ion-checkbox>
11+
<ion-checkbox checked>Checked</ion-checkbox>
12+
</div>
13+
`,
14+
config
15+
);
16+
17+
const checkboxes = page.locator('#checkboxes');
18+
await expect(checkboxes).toHaveScreenshot(screenshot(`checkbox-basic`));
19+
});
20+
621
test('should render custom checkmark-width correctly', async ({ page }) => {
722
await page.setContent(
823
`

0 commit comments

Comments
 (0)