Skip to content

Commit

Permalink
💥💄 center or left align for less number of slides than slidesToShow (#65
Browse files Browse the repository at this point in the history
, #66)

* Fix #63

* ⏪ keep original style behavior

* Remove margin and added center class

Co-authored-by: jpucheavoristravel <[email protected]>
Co-authored-by: KyuWoo Choi <[email protected]>

close: #65
  • Loading branch information
javipuche authored and kyuwoo-choi committed Feb 5, 2020
1 parent 4e12b4a commit 10d2262
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/SliderTrack.vue
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,9 @@ export default {
render() {
const slides = this.renderSlides(this.$props, this.$slots.default)
return (
<div class="slick-track" style={this.trackStyle}>
<div
class={{ 'slick-track': true, 'slick-center': this.$props.centerMode }}
style={this.trackStyle}>
{slides}
</div>
)
Expand All @@ -221,15 +223,17 @@ export default {
left: 0;
display: block;
margin-left: auto;
margin-right: auto;
-webkit-transform: translate3d(0, 0, 0);
-moz-transform: translate3d(0, 0, 0);
-ms-transform: translate3d(0, 0, 0);
-o-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
.slick-track.slick-center {
margin-left: auto;
margin-right: auto;
}
.slick-track:before,
.slick-track:after {
display: table;
Expand Down

0 comments on commit 10d2262

Please sign in to comment.