-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(esl-carousel):
esl-carousel-nav
default classes and attributes…
… reworked Co-authored-by: Anna Barmina <abarmina@exadel.com> Co-authored-by: alesun <alesun@exadel.com>
- Loading branch information
1 parent
b1df718
commit fd50c71
Showing
9 changed files
with
93 additions
and
72 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
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
119 changes: 65 additions & 54 deletions
119
src/modules/esl-carousel/plugin/nav/esl-carousel.nav.arrows.less
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,70 +1,81 @@ | ||
/** Nav control mixin defaults */ | ||
[esl-carousel-nav]:not([active]) { | ||
display: none; | ||
} | ||
|
||
[esl-carousel-nav][disabled] { | ||
pointer-events: none; | ||
} | ||
|
||
:root { | ||
// variable to make clickable area larger | ||
--esl-carousel-arrow-size: 40px; | ||
--esl-carousel-arrow-padding: 0px; | ||
--esl-carousel-arrow-bg: grey; | ||
} | ||
|
||
/** Arrow navigation styles */ | ||
.esl-carousel-nav-container { | ||
position: relative; | ||
// variable to make clickable area larger | ||
--esl-carousel-arrow-padding: 0px; | ||
--esl-carousel-arrow-size: 40px; | ||
|
||
/* stylelint-disable-next-line */ | ||
--esl-carousel-arrow-offset: calc((var(--esl-carousel-arrow-size) + var(--esl-carousel-arrow-padding) + var(--esl-carousel-side-space)) * -1); | ||
--esl-carousel-arrow-bg: grey; | ||
} | ||
|
||
.esl-carousel-arrow { | ||
position: absolute; | ||
z-index: 3; | ||
top: 50%; | ||
transform: translateY(-50%); | ||
padding: var(--esl-carousel-arrow-padding); | ||
|
||
display: grid; | ||
place-content: center; | ||
|
||
background: none; | ||
border: none; | ||
cursor: pointer; | ||
appearance: none; | ||
filter: drop-shadow(0 0 4px var(--esl-carousel-arrow-bg)); | ||
|
||
opacity: 0.75; | ||
|
||
&:hover { | ||
opacity: 1; | ||
} | ||
|
||
&[disabled] { | ||
opacity: 0.25; | ||
} | ||
&[disabled='hidden'] { | ||
visibility: hidden; | ||
} | ||
} | ||
.esl-carousel-arrow { | ||
position: absolute; | ||
z-index: 3; | ||
top: 50%; | ||
transform: translateY(-50%); | ||
padding: var(--esl-carousel-arrow-padding); | ||
|
||
// Positioning | ||
.esl-carousel-arrow.prev { | ||
left: var(--esl-carousel-arrow-offset); | ||
display: grid; | ||
place-content: center; | ||
|
||
&.inner { | ||
left: 0; | ||
} | ||
} | ||
background: none; | ||
border: none; | ||
cursor: pointer; | ||
appearance: none; | ||
filter: drop-shadow(0 0 4px var(--esl-carousel-arrow-bg)); | ||
|
||
.esl-carousel-arrow.next { | ||
right: var(--esl-carousel-arrow-offset); | ||
opacity: 0.75; | ||
|
||
&.inner { | ||
right: 0; | ||
} | ||
&:hover { | ||
opacity: 1; | ||
} | ||
|
||
.esl-carousel-arrow::before { | ||
content: ''; | ||
display: block; | ||
width: var(--esl-carousel-arrow-size); | ||
height: var(--esl-carousel-arrow-size); | ||
background: var(--esl-carousel-arrow-bg); | ||
clip-path: polygon(20% 50%, 70% 0%, 80% 5%, 35% 50%, 80% 95%, 70% 100%); | ||
&[disabled] { | ||
opacity: 0.25; | ||
} | ||
} | ||
|
||
// Positioning | ||
.esl-carousel-arrow.prev { | ||
left: var(--esl-carousel-arrow-offset); | ||
|
||
&.inner { | ||
left: 0; | ||
} | ||
} | ||
|
||
.esl-carousel-arrow.next::before { | ||
transform: scaleX(-1); | ||
.esl-carousel-arrow.next { | ||
right: var(--esl-carousel-arrow-offset); | ||
|
||
&.inner { | ||
right: 0; | ||
} | ||
} | ||
|
||
// Arrow icon | ||
.esl-carousel-arrow::before { | ||
content: ''; | ||
display: block; | ||
width: var(--esl-carousel-arrow-size); | ||
height: var(--esl-carousel-arrow-size); | ||
background: var(--esl-carousel-arrow-bg); | ||
clip-path: polygon(20% 50%, 70% 0%, 80% 5%, 35% 50%, 80% 95%, 70% 100%); | ||
} | ||
|
||
.esl-carousel-arrow.next::before { | ||
transform: scaleX(-1); | ||
} |
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