Skip to content

Commit

Permalink
feat(element): add shadow parts
Browse files Browse the repository at this point in the history
fixes #6594
  • Loading branch information
nolimits4web committed Apr 24, 2023
1 parent 8df6cf2 commit e4f3def
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/element/swiper-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,14 @@ class SwiperContainer extends ClassToExtend {
</div>
<slot name="container-end"></slot>
${needsNavigation(this.passedParams) ? `
<div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div>
<div part="button-prev" class="swiper-button-prev"></div>
<div part="button-next" class="swiper-button-next"></div>
` : ''}
${needsPagination(this.passedParams) ? `
<div class="swiper-pagination"></div>
<div part="pagination" class="swiper-pagination"></div>
` : '' }
${needsScrollbar(this.passedParams) ? `
<div class="swiper-scrollbar"></div>
<div part="scrollbar" class="swiper-scrollbar"></div>
` : '' }
`;
[...this.tempDiv.children].forEach((el) => {
Expand Down

3 comments on commit e4f3def

@strarsis
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Thank you!

@nolimits4web
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@strarsis I first thought you mean to add more custom elements, but shadow parts worth to be added for sure

@strarsis
Copy link

@strarsis strarsis commented on e4f3def Apr 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nolimits4web: It would be great if the pagination buttons can also become shadow parts (as only the node itself can be styled, not its child elements), including an [...]-active part for the currently active pagination button.

Please sign in to comment.