Skip to content

Commit

Permalink
fix(swiper): update style (#1327)
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeJim authored Dec 29, 2022
1 parent c5a92d4 commit a206fc1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/swiper/_example/cards/index.wxss
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@

.card-theme {
--td-swiper-radius: 0;
--td-swiper-item-padding: 0 12rpx;
--td-swiper-nav-dot-color: #e7e7e7;
--td-swiper-nav-dot-active-color: #0052d9;

padding-bottom: 18px;
}

.card-theme .card-theme-nav {
Expand Down
6 changes: 6 additions & 0 deletions src/swiper/swiper.less
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
@import '../common/style/index.less';

@swiper-radius: var(--td-swiper-radius, @radius-large);
@swiper-item-padding: var(--td-swiper-item-padding, 0);

.@{prefix}-swiper {
position: relative;

&-host {
border-radius: @swiper-radius;
overflow: hidden;
}

&__item {
display: flex;
align-items: center;
Expand Down
2 changes: 1 addition & 1 deletion src/swiper/swiper.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

<view class="{{prefix}}-class {{classPrefix}}" style="{{customStyle}}">
<swiper
class="{{classPrefix}}-host"
autoplay="{{autoplay}}"
current="{{current}}"
interval="{{interval}}"
Expand All @@ -27,7 +28,6 @@
t-class="{{prefix}}-class-image {{this.isPrev(current, index, list) ? (prefix + '-class-prev-image') : ''}} {{this.isNext(current, index, list) ? (prefix + '-class-next-image') : ''}} {{classPrefix}}__image"
custom-style="height: {{_.addUnit(height)}}"
src="{{item}}"
shape="round"
/>
</swiper-item>
</swiper>
Expand Down

0 comments on commit a206fc1

Please sign in to comment.