Skip to content

Commit

Permalink
fix#1957 Remove collapse margin. Beautify accordion. (#1964)
Browse files Browse the repository at this point in the history
* Fix accordion margin.

* Remove extra css variables.
  • Loading branch information
m0ksem authored Jun 20, 2022
1 parent ba7947e commit 9c493a3
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
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

0 comments on commit 9c493a3

Please sign in to comment.