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#1957 Remove collapse margin. Beautify accordion. #1964

Merged
merged 2 commits into from
Jun 20, 2022
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
23 changes: 23 additions & 0 deletions packages/ui/src/components/va-accordion/VaAccordion.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,28 @@ export default defineComponent({
<style lang="scss">
.va-accordion {
font-family: var(--va-font-family);

// Do not remove border radius from expanded and next to it collapse
.va-collapse:not(.va-collapse--expanded, .va-collapse--expanded + .va-collapse) {
&:not(:first-child, :last-child) {
.va-collapse__header__content {
border-radius: 0;
}
}

&:first-child {
.va-collapse__header__content {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
}

&:last-child {
.va-collapse__header__content {
border-top-left-radius: 0;
border-top-right-radius: 0;
}
}
}
}
</style>
2 changes: 1 addition & 1 deletion packages/ui/src/components/va-collapse/VaCollapse.vue
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ export default defineComponent({
tabIndexComputed,

computedClasses: computed(() => ({
'va-collapse--expanded': computedModelValue.value,
'va-collapse--disabled': props.disabled,
'va-collapse--solid': props.solid,
'va-collapse--active': props.solid && computedModelValue.value,
Expand Down Expand Up @@ -192,7 +193,6 @@ export default defineComponent({
&__body {
transition: var(--va-collapse-body-transition);
overflow: var(--va-collapse-body-overflow);
margin-top: var(--va-collapse-body-margin-top);
}

&__header {
Expand Down
1 change: 0 additions & 1 deletion packages/ui/src/components/va-collapse/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
--va-collapse-inset-margin: 0.5rem 0.5rem;
--va-collapse-body-transition: all 0.3s linear;
--va-collapse-body-overflow: hidden;
--va-collapse-body-margin-top: 0.1rem;
--va-collapse-header-content-display: flex;
--va-collapse-header-content-justify-content: space-between;
--va-collapse-header-content-cursor: pointer;
Expand Down