diff --git a/example/pages/collapse/index.wxml b/example/pages/collapse/index.wxml
index 2a28e4e5..eb69cf73 100644
--- a/example/pages/collapse/index.wxml
+++ b/example/pages/collapse/index.wxml
@@ -1,37 +1,31 @@
- {{ content1 }}
- {{ content2 }}
-
- {{ content3 }}
-
+ {{ content1 }}
+ {{ content2 }}
+ {{ content3 }}
- {{ content1 }}
- {{ content2 }}
- {{ content3 }}
+ {{ content1 }}
+ {{ content2 }}
+ {{ content3 }}
-
+
{{ title1 }}
{{ content1 }}
{{ content2 }}
- {{ content3 }}
+ {{ content3 }}
diff --git a/example/pages/collapse/index.wxss b/example/pages/collapse/index.wxss
index 71c599a9..cad4d831 100644
--- a/example/pages/collapse/index.wxss
+++ b/example/pages/collapse/index.wxss
@@ -1,9 +1,3 @@
-.van-collapse-item__content {
- font-size: 13px;
- line-height: 1.5;
- color: #666;
-}
-
.van-icon-question {
margin-left: 5px;
font-size: 15px !important;
diff --git a/packages/collapse-item/index.less b/packages/collapse-item/index.less
index e883feb2..db118a46 100644
--- a/packages/collapse-item/index.less
+++ b/packages/collapse-item/index.less
@@ -4,7 +4,7 @@
&__title {
.van-cell__right-icon {
transform: rotate(90deg);
- transition: 0.3s;
+ transition: @collapse-item-transition-duration;
}
&--expanded {
@@ -14,12 +14,12 @@
}
&--disabled {
- & .van-cell,
- & .van-cell__right-icon {
- color: @gray !important;
+ .van-cell,
+ .van-cell__right-icon {
+ color: @collapse-item-title-disabled-color !important;
}
- &:active {
+ .van-cell:active {
background-color: @white !important;
}
}
@@ -28,11 +28,14 @@
&__wrapper {
overflow: hidden;
will-change: max-height;
- transition: max-height 0.3s ease-in-out;
+ transition: max-height @collapse-item-transition-duration ease-in-out;
}
&__content {
- padding: 15px;
- background-color: @white;
+ color: @collapse-item-content-text-color;
+ padding: @collapse-item-content-padding;
+ font-size: @collapse-item-content-font-size;
+ line-height: @collapse-item-content-line-height;
+ background-color: @collapse-item-content-background-color;
}
}
diff --git a/packages/collapse/README.md b/packages/collapse/README.md
index a5b0a179..3fe30f46 100644
--- a/packages/collapse/README.md
+++ b/packages/collapse/README.md
@@ -98,8 +98,6 @@ Page({
});
```
-
-
### Collapse API
| 参数 | 说明 | 类型 | 默认值 | 版本 |
diff --git a/packages/common/style/var.less b/packages/common/style/var.less
index be3adec4..b0beb322 100644
--- a/packages/common/style/var.less
+++ b/packages/common/style/var.less
@@ -48,6 +48,15 @@
@checkbox-disabled-label-color: @gray;
@checkbox-disabled-background-color: @border-color;
+// Collapse
+@collapse-item-transition-duration: .3s;
+@collapse-item-content-padding: 15px;
+@collapse-item-content-font-size: 13px;
+@collapse-item-content-line-height: 1.5;
+@collapse-item-content-text-color: @gray-dark;
+@collapse-item-content-background-color: @white;
+@collapse-item-title-disabled-color: @gray;
+
// Info
@info-size: 16px;
@info-color: @white;