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 default ToggleSwitch's height to 24px #2363

Closed
wants to merge 27 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
5f5125c
reduced toggle switch height
smmr-dn Dec 6, 2024
d9743d5
set vertical margins to auto
smmr-dn Dec 9, 2024
8717311
added screenshots
smmr-dn Dec 9, 2024
9cfb459
added changesets
smmr-dn Dec 9, 2024
6a86dfe
Merge branch 'main' into uyen/toggle-height
smmr-dn Dec 10, 2024
45811df
Merge branch 'main' into uyen/toggle-height
smmr-dn Dec 10, 2024
c1fdfd1
Merge branch 'main' into uyen/toggle-height
smmr-dn Dec 10, 2024
e18ae6c
fixed calculation to make default Toggle 46px in width
smmr-dn Dec 11, 2024
f10a1be
revert screenshots
smmr-dn Dec 11, 2024
d706b97
Merge branch 'uyen/toggle-height' of https://github.com/iTwin/iTwinUI…
smmr-dn Dec 11, 2024
42295df
moved vars around
smmr-dn Dec 11, 2024
f6d7542
reset margins for small toggle
smmr-dn Dec 12, 2024
0fe0122
modified changesets
smmr-dn Dec 12, 2024
45862f1
css-workshop screenshots
smmr-dn Dec 12, 2024
5026903
screenshots
smmr-dn Dec 12, 2024
b8ac286
Update tough-readers-reflect.md
smmr-dn Dec 12, 2024
66bf100
revert screenshots
smmr-dn Dec 12, 2024
d6d5d91
Merge branch 'uyen/toggle-height' of https://github.com/iTwin/iTwinUI…
smmr-dn Dec 12, 2024
786c249
revert some margins
smmr-dn Dec 12, 2024
b49c025
misc fixes
smmr-dn Dec 12, 2024
8c02302
Merge branch 'main' into uyen/toggle-height
smmr-dn Dec 12, 2024
16db057
fixed sreenshots containing small toggle
smmr-dn Dec 12, 2024
5889cbc
centered
smmr-dn Dec 12, 2024
2f5a850
revert screenshots
smmr-dn Dec 12, 2024
d628c27
revert App.tsx
smmr-dn Dec 12, 2024
2722b9a
react screenshots
smmr-dn Dec 13, 2024
a67f57d
Merge branch 'main' into uyen/toggle-height
smmr-dn Dec 13, 2024
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
5 changes: 5 additions & 0 deletions .changeset/neat-rockets-give.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@itwin/itwinui-react': patch
---

Medium-sized `ToggleSwitch` now has the height of 24px instead of 26px.
5 changes: 5 additions & 0 deletions .changeset/tough-readers-reflect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@itwin/itwinui-css': patch
---

`iui-toggle-switch` that contains `data-iui-size="default"` now has the height of 24px.
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.
10 changes: 9 additions & 1 deletion packages/itwinui-css/src/toggle-switch/toggle-switch.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@
--_iui-toggle-switch-handle-size: var(--iui-size-s);
--_iui-toggle-switch-handle-offset: var(--iui-size-3xs);
}

&:where([data-iui-size='default']) {
--_iui-toggle-switch-handle-offset: calc(var(--iui-size-2xs) * 0.875);

> .iui-toggle-switch {
block-size: calc(var(--_iui-toggle-switch-handle-size) + (var(--_iui-toggle-switch-handle-offset) * 2) + 1px);
}
}
}

.iui-toggle-switch {
Expand Down Expand Up @@ -76,7 +84,7 @@
content: '';
block-size: var(--_iui-toggle-switch-handle-size);
inline-size: var(--_iui-toggle-switch-handle-size);
margin: var(--_iui-toggle-switch-handle-offset);
margin: auto var(--_iui-toggle-switch-handle-offset);
aspect-ratio: 1 / 1;
border-radius: var(--iui-border-radius-round);
transition: background-color var(--iui-duration-1) ease-out;
Expand Down
Loading