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(NcCheckboxRadioSwitch): adjust to new border radius #5974

Merged
merged 1 commit into from
Aug 19, 2024
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
6 changes: 3 additions & 3 deletions src/components/NcCheckboxRadioSwitch/NcCheckboxContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,11 @@ export default {
display: flex;
align-items: center;
flex-direction: row;
gap: 4px;
gap: var(--default-grid-baseline);
user-select: none;
min-height: var(--default-clickable-area);
border-radius: var(--default-clickable-area);
padding: 4px calc((var(--default-clickable-area) - var(--icon-height)) / 2);
border-radius: var(--checkbox-radio-switch--border-radius);
padding: var(--default-grid-baseline) calc((var(--default-clickable-area) - var(--icon-height)) / 2);
// Set to 100% to make text overflow work on button style
width: 100%;
// but restrict to content so plain checkboxes / radio switches do not expand
Expand Down
22 changes: 11 additions & 11 deletions src/components/NcCheckboxRadioSwitch/NcCheckboxRadioSwitch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -682,9 +682,9 @@ export default {
color: var(--color-primary-element-light);
}

$border-radius: calc(var(--default-clickable-area) / 2);
--checkbox-radio-switch--border-radius: var(--border-radius-element, calc(var(--default-clickable-area) / 2));
// keep inner border width in mind
$border-radius-outer: calc($border-radius + 2px);
--checkbox-radio-switch--border-radius-outer: calc(var(--checkbox-radio-switch--border-radius) + 2px);

&--button-variant.checkbox-radio-switch {
background-color: var(--color-main-background);
Expand Down Expand Up @@ -721,7 +721,7 @@ export default {

&--button-variant:not(&--button-variant-v-grouped):not(&--button-variant-h-grouped),
&--button-variant &__content {
border-radius: $border-radius;
border-radius: var(--checkbox-radio-switch--border-radius);
}

/* Special rules for vertical button groups */
Expand All @@ -732,12 +732,12 @@ export default {
}
&--button-variant-v-grouped {
&:first-of-type {
border-top-left-radius: $border-radius-outer;
border-top-right-radius: $border-radius-outer;
border-top-left-radius: var(--checkbox-radio-switch--border-radius-outer);
border-top-right-radius: var(--checkbox-radio-switch--border-radius-outer);
}
&:last-of-type {
border-bottom-left-radius: $border-radius-outer;
border-bottom-right-radius: $border-radius-outer;
border-bottom-left-radius: var(--checkbox-radio-switch--border-radius-outer);
border-bottom-right-radius: var(--checkbox-radio-switch--border-radius-outer);
}

// remove borders between elements
Expand All @@ -755,12 +755,12 @@ export default {
/* Special rules for horizontal button groups */
&--button-variant-h-grouped {
&:first-of-type {
border-top-left-radius: $border-radius-outer;
border-bottom-left-radius: $border-radius-outer;
border-top-left-radius: var(--checkbox-radio-switch--border-radius-outer);
border-bottom-left-radius: var(--checkbox-radio-switch--border-radius-outer);
}
&:last-of-type {
border-top-right-radius: $border-radius-outer;
border-bottom-right-radius: $border-radius-outer;
border-top-right-radius: var(--checkbox-radio-switch--border-radius-outer);
border-bottom-right-radius: var(--checkbox-radio-switch--border-radius-outer);
}

// remove borders between elements
Expand Down
Loading