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

Fix shrinking checkbox when parent container shrinks #544

Merged
merged 2 commits into from
Mar 8, 2024

Conversation

chryw
Copy link
Collaborator

@chryw chryw commented Mar 7, 2024

Link to relevant issue

This pull request resolves #539

Description of changes

The width and height inherited from the parent container will override the width: 16 and height: 16 in the <svg>. If the parent container makes the checkbox shrink below 16px, the size will be skewed. Adding mid-width and min-height will prevent this to happen.

webview-ui-toolkit-checkbox-fix.mp4

@chryw chryw requested a review from hawkticehurst March 7, 2024 22:37
Copy link
Member

@hawkticehurst hawkticehurst left a comment

Choose a reason for hiding this comment

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

General idea is great, just need to use a different design token!

src/checkbox/checkbox.styles.ts Outdated Show resolved Hide resolved
Copy link
Member

@hawkticehurst hawkticehurst left a comment

Choose a reason for hiding this comment

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

Looks great, thank you!

@hawkticehurst hawkticehurst merged commit a1f078e into microsoft:main Mar 8, 2024
4 checks passed
@hawkticehurst hawkticehurst changed the title Fixes #539 Checkbox shrinks when parent container shrinks Fix shrinking checkbox when parent container shrinks Mar 8, 2024
@chryw chryw deleted the 539-checkbox-shrink branch March 8, 2024 01:49
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.

Checkboxes squish when their parent container's width shrinks
2 participants