Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(checkbox): update styles to iOS 17 specs #28729

Merged
merged 19 commits into from
Dec 20, 2023
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
8 changes: 4 additions & 4 deletions core/src/components/alert/alert.ios.vars.scss
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,10 @@ $alert-ios-checkbox-margin-bottom: 10px !default;
$alert-ios-checkbox-margin-start: 16px !default;

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

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

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

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

/// @prop - Start of the icon in the checkbox alert
$alert-ios-checkbox-icon-start: calc($alert-ios-checkbox-size / 3 + 1px) !default;
$alert-ios-checkbox-icon-start: calc($alert-ios-checkbox-size / 3) !default;
Comment on lines +291 to +294
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes were made to align the icon to the center.


/// @prop - Width of the icon in the checkbox alert
$alert-ios-checkbox-icon-width: calc($alert-ios-checkbox-size / 6 + 1px) !default;
Expand Down
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.
3 changes: 3 additions & 0 deletions core/src/components/checkbox/checkbox.ios.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@

// Size
--size: #{$checkbox-ios-icon-size};

// Checkmark width
--checkmark-width: #{$checkbox-ios-icon-checkmark-width};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can delete

--checkmark-width: 1;

from checkbox.scss since it is defined in both ios and md now.

}


Expand Down
7 changes: 5 additions & 2 deletions core/src/components/checkbox/checkbox.ios.vars.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
$checkbox-ios-background-color-off: $item-ios-background !default;

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

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

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

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

/// @prop - Margin start of the right checkbox item
$checkbox-ios-item-end-margin-start: 0 !default;

/// @prop - Checkmark width of the checkbox icon
$checkbox-ios-icon-checkmark-width: 1.5px !default;
1 change: 0 additions & 1 deletion core/src/components/checkbox/checkbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
--checkbox-background-checked: #{ion-color(primary, base)};
--border-color-checked: #{ion-color(primary, base)};
--checkmark-color: #{ion-color(primary, contrast)};
--checkmark-width: 1;
--transition: none;

display: inline-block;
Expand Down
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.
15 changes: 15 additions & 0 deletions core/src/components/checkbox/test/basic/checkbox.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@ import { configs, test } from '@utils/test/playwright';

configs().forEach(({ title, screenshot, config }) => {
test.describe(title('checkbox: basic visual tests'), () => {
test('should not have visual regressions', async ({ page }) => {
await page.setContent(
`
<div id="checkboxes">
<ion-checkbox>Unchecked</ion-checkbox>
<ion-checkbox checked>Checked</ion-checkbox>
</div>
`,
config
);

const checkboxes = page.locator('#checkboxes');
await expect(checkboxes).toHaveScreenshot(screenshot(`checkbox-basic`));
});

test('should render custom checkmark-width correctly', async ({ page }) => {
await page.setContent(
`
Expand Down
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