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

Reduced ToggleSwitch's heights to 16px and 24px #2363

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

smmr-dn
Copy link
Contributor

@smmr-dn smmr-dn commented Dec 6, 2024

Changes

Originally, the ToggleSwitch checkmark icon of class iui-toggle-switch-icon had the margin setup of iui-size-m (16px; 8px each) with an additional of 1px on each side ($iui-toggle-switch-border-thickness).

On top of that, the content class iui-toggle-switch's block-size was specified by the addition of --_iui-toggle-switch-handle-size (16px) + --_iui-toggle-switch-handle-offset * 2 (8px) + $iui-toggle-switch-border-thickness * 2 (2px) which resulted in 26px.

Therefore, these $iui-toggle-switch-border-thickness values have been removed in this PR to reduce the height from 26px to 24px while maintaining the icons' size to be 16px for medium (default size). The small toggle was originally 18px in height, and now has been reduced to 16px.

Testing

Screenshots containing ToggleSwitch with this change have been approved.

Docs

Added two changesets.

@smmr-dn smmr-dn marked this pull request as ready for review December 9, 2024 19:42
@smmr-dn smmr-dn requested a review from a team as a code owner December 9, 2024 19:42
@smmr-dn smmr-dn requested review from mayank99 and r100-stack and removed request for a team December 9, 2024 19:42
Copy link
Contributor

@mayank99 mayank99 left a comment

Choose a reason for hiding this comment

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

This has again changed the height of the regular size ToggleSwitch. Only the small one should be affected.

Edit: Actually it's the opposite: only the regular one should be affected. See later comment.

@smmr-dn
Copy link
Contributor Author

smmr-dn commented Dec 10, 2024

This has again changed the height of the regular size ToggleSwitch. Only the small one should be affected.

I just double checked and realized that there are two sizes for ToggleSwitch: small 18px and medium (default) 26px, which have now been reduced to 16px and 24px. Were these supposed to be 16px and 24px instead of 18px and 26px? Most of the examples/stories use the default medium size, I believe that might be why it affects the other screenshots.

@smmr-dn smmr-dn changed the title Reduced ToggleSwitch's height to 24px Reduced ToggleSwitch's height to 16px and 24px for both sizes Dec 10, 2024
@smmr-dn smmr-dn changed the title Reduced ToggleSwitch's height to 16px and 24px for both sizes Reduced ToggleSwitch's heights to 16px and 24px Dec 10, 2024
@mayank99
Copy link
Contributor

mayank99 commented Dec 10, 2024

I just double checked and realized that there are two sizes for ToggleSwitch: small 18px and medium (default) 26px, which have now been reduced to 16px and 24px. Were these supposed to be 16px and 24px instead of 18px and 26px?

Oh wow, I'm not sure how I missed this. I thought they were the same height as our other components (i.e. 24px and 36px).

Looking at our Figma library, the heights appear to be 18px and 24px, so let's go with that for now. More specifically, the dimensions are 46x24 and 32x18.

I personally think 24px is too short for the default toggle switch, but we can have that conversation in the future (outside this PR).

@mayank99 mayank99 dismissed their stale review December 10, 2024 18:14

Misunderstanding.

Copy link
Member

@r100-stack r100-stack left a comment

Choose a reason for hiding this comment

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

Just left a small comment. Regarding the actual sizes, agreed with @mayank99's comments.

'@itwin/itwinui-css': patch
---

`iui-toggle-switch` now has the height of 24px.
Copy link
Member

Choose a reason for hiding this comment

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

You might need to mention which size is now 24px, because there are multiple ToggleSwitch sizes.

Same for the other changeset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants