Skip to content

Commit

Permalink
feat(pagination): more pagination bullet CSS variables (#4927)
Browse files Browse the repository at this point in the history
* feat(pagination): add pagination bullet CSS variables

* feat(pagination): add horizontal & vertical gaps variables

Co-authored-by: Vladimir Kharlampidi <nolimits4web@gmail.com>
  • Loading branch information
Androlax2 and nolimits4web authored Sep 8, 2021
1 parent 7fd04fe commit 25416de
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 14 deletions.
22 changes: 15 additions & 7 deletions src/modules/pagination/pagination.less
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
:root {
/*
--swiper-pagination-color: var(--swiper-theme-color);
--swiper-pagination-bullet-size: 8px;
--swiper-pagination-bullet-width: 8px;
--swiper-pagination-bullet-height: 8px;
--swiper-pagination-bullet-inactive-color: #000;
--swiper-pagination-bullet-inactive-opacity: 0.2;
--swiper-pagination-bullet-opacity: 1;
--swiper-pagination-bullet-horizontal-gap: 4px;
--swiper-pagination-bullet-vertical-gap: 6px;
*/
}
.swiper-pagination {
Expand Down Expand Up @@ -50,12 +58,12 @@
}
}
.swiper-pagination-bullet {
width: 8px;
height: 8px;
width: var(--swiper-pagination-bullet-width, var(--swiper-pagination-bullet-size, 8px));
height: var(--swiper-pagination-bullet-height, var(--swiper-pagination-bullet-size, 8px));
display: inline-block;
border-radius: 50%;
background: #000;
opacity: 0.2;
background: var(--swiper-pagination-bullet-inactive-color, #000);
opacity: var(--swiper-pagination-bullet-inactive-opacity, 0.2);
button& {
border: none;
margin: 0;
Expand All @@ -72,7 +80,7 @@
}
}
.swiper-pagination-bullet-active {
opacity: 1;
opacity: var(--swiper-pagination-bullet-opacity, 1);
background: var(--swiper-pagination-color, var(--swiper-theme-color));
}

Expand All @@ -82,7 +90,7 @@
top: 50%;
transform: translate3d(0px, -50%, 0);
.swiper-pagination-bullet {
margin: 6px 0;
margin: var(--swiper-pagination-bullet-vertical-gap, 6px) 0;
display: block;
}
&.swiper-pagination-bullets-dynamic {
Expand All @@ -98,7 +106,7 @@
.swiper-horizontal > .swiper-pagination-bullets,
.swiper-pagination-horizontal.swiper-pagination-bullets {
.swiper-pagination-bullet {
margin: 0 4px;
margin: 0 var(--swiper-pagination-bullet-horizontal-gap, 4px);
}
&.swiper-pagination-bullets-dynamic {
left: 50%;
Expand Down
22 changes: 15 additions & 7 deletions src/modules/pagination/pagination.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
:root {
/*
--swiper-pagination-color: var(--swiper-theme-color);
--swiper-pagination-bullet-size: 8px;
--swiper-pagination-bullet-width: 8px;
--swiper-pagination-bullet-height: 8px;
--swiper-pagination-bullet-inactive-color: #000;
--swiper-pagination-bullet-inactive-opacity: 0.2;
--swiper-pagination-bullet-opacity: 1;
--swiper-pagination-bullet-horizontal-gap: 4px;
--swiper-pagination-bullet-vertical-gap: 6px;
*/
}
.swiper-pagination {
Expand Down Expand Up @@ -52,12 +60,12 @@
}
}
.swiper-pagination-bullet {
width: 8px;
height: 8px;
width: var(--swiper-pagination-bullet-width, var(--swiper-pagination-bullet-size, 8px));
height: var(--swiper-pagination-bullet-height, var(--swiper-pagination-bullet-size, 8px));
display: inline-block;
border-radius: 50%;
background: #000;
opacity: 0.2;
background: var(--swiper-pagination-bullet-inactive-color, #000);
opacity: var(--swiper-pagination-bullet-inactive-opacity, 0.2);
@at-root button#{&} {
border: none;
margin: 0;
Expand All @@ -74,7 +82,7 @@
}
}
.swiper-pagination-bullet-active {
opacity: 1;
opacity: var(--swiper-pagination-bullet-opacity, 1);
background: var(--swiper-pagination-color, var(--swiper-theme-color));
}

Expand All @@ -84,7 +92,7 @@
top: 50%;
transform: translate3d(0px, -50%, 0);
.swiper-pagination-bullet {
margin: 6px 0;
margin: var(--swiper-pagination-bullet-vertical-gap, 6px) 0;
display: block;
}
&.swiper-pagination-bullets-dynamic {
Expand All @@ -100,7 +108,7 @@
.swiper-horizontal > .swiper-pagination-bullets,
.swiper-pagination-horizontal.swiper-pagination-bullets {
.swiper-pagination-bullet {
margin: 0 4px;
margin: 0 var(--swiper-pagination-bullet-horizontal-gap, 4px);
}
&.swiper-pagination-bullets-dynamic {
left: 50%;
Expand Down

0 comments on commit 25416de

Please sign in to comment.