From 078ba99f9429f44645c16b48f4629d1c39cc4108 Mon Sep 17 00:00:00 2001 From: neverland Date: Sun, 24 Mar 2019 21:03:47 +0800 Subject: [PATCH] [improvement] Actionsheet: add less vars (#3049) --- packages/actionsheet/index.less | 24 ++++++++++++------------ packages/style/var.less | 13 +++++++++++++ 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/packages/actionsheet/index.less b/packages/actionsheet/index.less index 2b033a5a0..95f1e67ab 100644 --- a/packages/actionsheet/index.less +++ b/packages/actionsheet/index.less @@ -1,15 +1,15 @@ @import '../style/var'; .van-actionsheet { - max-height: 90%; - color: @text-color; + color: @action-sheet-item-text-color; + max-height: @action-sheet-max-height; &__item, &__cancel { - line-height: 50px; - font-size: 16px; text-align: center; - background-color: @white; + font-size: @action-sheet-item-font-size; + line-height: @action-sheet-item-height; + background-color: @action-sheet-item-background; &:active { background-color: @active-color; @@ -17,7 +17,7 @@ } &__item { - height: 50px; + height: @action-sheet-item-height; } &__item--disabled { @@ -29,8 +29,8 @@ } &__subname { - font-size: 12px; - color: @gray-darker; + color: @action-sheet-subname-color; + font-size: @action-sheet-subname-font-size; margin-left: 5px; } @@ -46,8 +46,8 @@ } &__header { - font-size: 16px; - line-height: 44px; + font-size: @action-sheet-header-font-size; + line-height: @action-sheet-header-height; text-align: center; } @@ -55,9 +55,9 @@ top: 0; right: 0; padding: 0 15px; - font-size: 18px; - color: @gray-dark; position: absolute; line-height: inherit; + color: @action-sheet-close-icon-color; + font-size: @action-sheet-close-icon-size; } } diff --git a/packages/style/var.less b/packages/style/var.less index e59d5803c..a248d52d8 100644 --- a/packages/style/var.less +++ b/packages/style/var.less @@ -19,6 +19,19 @@ @background-color: #f8f8f8; @background-color-light: #fafafa; +// ActionSheet +@action-sheet-max-height: 90%; +@action-sheet-header-height: 44px; +@action-sheet-header-font-size: 16px; +@action-sheet-item-height: 50px; +@action-sheet-item-background: @white; +@action-sheet-item-font-size: 16px; +@action-sheet-item-text-color: @text-color; +@action-sheet-subname-color: @gray-darker; +@action-sheet-subname-font-size: 12px; +@action-sheet-close-icon-size: 18px; +@action-sheet-close-icon-color: @gray-dark; + // Button @button-default-color: @text-color; @button-default-background-color: @white;