Skip to content
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Add padding between switch and its label",
"packageName": "@ni/nimble-components",
"email": "7282195+m-akinc@users.noreply.github.com",
"dependentChangeType": "patch"
}
10 changes: 6 additions & 4 deletions packages/nimble-components/src/switch/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
borderWidth,
buttonLabelDisabledFontColor,
buttonLabelFontColor,
controlHeight,
controlLabelDisabledFontColor,
controlLabelFont,
controlLabelFontColor,
Expand All @@ -38,9 +37,6 @@ export const styles = css`
--ni-private-switch-indicator-size: 24px;
--ni-private-switch-indicator-inner-size: 18px;
--ni-private-switch-indicator-margin: -2px;
padding-bottom: calc(
${controlHeight} - var(--ni-private-switch-height)
);
}

:host([disabled]) {
Expand All @@ -65,6 +61,12 @@ export const styles = css`
.switch-container {
display: flex;
align-items: center;
${'' /*
Reserve space around the 24px control to fill a 32px height until we have a switch 32 design.
See: https://github.com/ni/nimble/issues/3013
*/}
padding-top: 2px;
padding-bottom: 6px;
}

slot[name='unchecked-message']::slotted(*) {
Expand Down