-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #639 from tblivet/issue-490
Fix: issue-490
- Loading branch information
Showing
9 changed files
with
155 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const initCategoryTree = () => { | ||
const categoryTree = document.querySelector('.ps_categorytree'); | ||
|
||
if (categoryTree) { | ||
const accordionButtons = categoryTree.querySelectorAll('.accordion-button'); | ||
|
||
accordionButtons.forEach((element) => { | ||
element.addEventListener('click', () => { | ||
const isActive = element.getAttribute('aria-expanded') === 'true'; | ||
element.closest('.category-tree__item')?.classList.toggle('active', isActive); | ||
}); | ||
}); | ||
} | ||
}; | ||
|
||
export default initCategoryTree; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
122 changes: 90 additions & 32 deletions
122
src/scss/custom/components/category-tree/_category-tree.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,116 @@ | ||
$component-name: category-tree; | ||
|
||
#left-column { | ||
--#{$component-name}-title-color: #{$gray-800}; | ||
--#{$component-name}-title-size: 1.5rem; | ||
--#{$component-name}-title-spacing: 1rem; | ||
--#{$component-name}-subtitle-color: #{$gray-800}; | ||
--#{$component-name}-subtitle-size: 1rem; | ||
--#{$component-name}-subtitle-spacing: 0.25rem; | ||
--#{$component-name}-border-bottom: 1px solid #{$gray-200}; | ||
} | ||
|
||
.#{$component-name} { | ||
padding-bottom: 1rem; | ||
margin-bottom: 2rem; | ||
border-bottom: var(--#{$component-name}-border-bottom); | ||
.accordion { | ||
--bs-accordion-bg: transparent; | ||
--bs-accordion-btn-bg: transparent; | ||
--bs-accordion-active-bg: transparent; | ||
} | ||
|
||
&__child { | ||
padding: 0; | ||
border: none; | ||
.#{$component-name}__list { | ||
display: flex; | ||
flex-direction: column; | ||
row-gap: 0.5rem; | ||
|
||
&[data-depth="0"] { | ||
> .category-tree__item { | ||
> .category-tree__item__header { | ||
.category-tree__item__link { | ||
font-weight: 600; | ||
} | ||
} | ||
} | ||
} | ||
|
||
&[data-depth="1"] { | ||
padding-left: 0.5rem; | ||
} | ||
|
||
&[data-depth="2"] { | ||
padding-left: 0.5rem; | ||
} | ||
|
||
&[data-depth="3"] { | ||
padding-left: 0.5rem; | ||
} | ||
|
||
&[data-depth="4"] { | ||
padding-left: 0.5rem; | ||
} | ||
} | ||
} | ||
|
||
&__title { | ||
padding: 0; | ||
margin-bottom: var(--#{$component-name}-title-spacing); | ||
font-size: var(--#{$component-name}-title-size); | ||
border: none; | ||
|
||
&__link { | ||
display: block; | ||
font-weight: 600; | ||
line-height: 2rem; | ||
color: var(--#{$component-name}-title-color); | ||
color: var(--bs-body-color); | ||
} | ||
} | ||
|
||
&__item { | ||
/* stylelint-disable-next-line declaration-no-important */ | ||
transition: $transition-base; | ||
|
||
&.active { | ||
> .category-tree__item__header { | ||
&.parent { | ||
.category-tree__item__link { | ||
color: var(--bs-primary); | ||
} | ||
} | ||
} | ||
} | ||
|
||
&__link { | ||
display: block; | ||
padding: var(--#{$component-name}-subtitle-spacing) 0; | ||
font-size: var(--#{$component-name}-subtitle-size); | ||
font-weight: 600; | ||
color: var(--#{$component-name}-subtitle-color); | ||
color: var(--bs-body-color); | ||
|
||
&:hover { | ||
color: var(--bs-primary); | ||
} | ||
} | ||
|
||
&__header { | ||
&--parent { | ||
&.split { | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
padding: 0.25rem 0; | ||
|
||
> div { | ||
padding: 0; | ||
.accordion-button { | ||
margin: -0.25rem -0.5rem -0.25rem auto; | ||
} | ||
} | ||
|
||
&.nosplit { | ||
display: flex; | ||
padding: 0.25rem 0; | ||
} | ||
|
||
.category-tree__item__link { | ||
flex-grow: 1; | ||
} | ||
} | ||
} | ||
} | ||
|
||
// Accordion variant | ||
.accordion--category { | ||
margin-bottom: 0; | ||
|
||
.accordion-item { | ||
border: none; | ||
} | ||
|
||
.accordion-body { | ||
padding: 0.5rem 0 0; | ||
margin: 0; | ||
} | ||
|
||
.accordion-button { | ||
width: auto; | ||
padding: 0.25rem 0.5rem; | ||
font-size: 1rem; | ||
font-weight: 700; | ||
cursor: pointer; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 6 additions & 10 deletions
16
src/scss/custom/components/search-filters/_search-filters.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters