From 0c4e9e21c49e90a88b85f7d47b71c843561f686e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B1=E7=9C=A0=E5=84=80=E5=BC=8F?= <854085467@qq.com> Date: Wed, 9 Feb 2022 10:37:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=20input=20=E4=B8=8E=20textar?= =?UTF-8?q?ea=20=E6=A0=B7=E5=BC=8F=E6=8B=86=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/docs/zh-CN/components/button.md | 11 +++++++ example/docs/zh-CN/components/panel.md | 21 ++++++++++++++ src/component/button/index.less | 4 ++- src/component/card/index.less | 16 +++++++++-- src/component/input/index.less | 36 +++++++++++++++++++++++ src/component/input/index.vue | 2 ++ src/component/panel/index.less | 20 +++++++++++-- src/component/textarea/index.less | 37 ++++++++++++++++++++++++ src/component/textarea/index.vue | 2 ++ src/theme/index.less | 38 ++----------------------- src/theme/variable.less | 9 +++++- 11 files changed, 153 insertions(+), 43 deletions(-) create mode 100644 src/component/textarea/index.less diff --git a/example/docs/zh-CN/components/button.md b/example/docs/zh-CN/components/button.md index 2adb073a..57b74a1b 100644 --- a/example/docs/zh-CN/components/button.md +++ b/example/docs/zh-CN/components/button.md @@ -296,9 +296,20 @@ export default { ::: title 主题配置 ::: +

less

+ ``` @button-primary-color: #009688; // 主题色 @button-border-radius: 2px; // 圆角 +@button-border-color: #d2d2d2; // 边框色 +``` + +

css

+ +``` +--button-primary-color: #009688; // 主题色 +--button-border-radius: 2px; // 圆角 +--button-border-color: #d2d2d2; // 边框色 ``` ::: title Button 属性 diff --git a/example/docs/zh-CN/components/panel.md b/example/docs/zh-CN/components/panel.md index cd15337a..f88b3a44 100644 --- a/example/docs/zh-CN/components/panel.md +++ b/example/docs/zh-CN/components/panel.md @@ -30,6 +30,27 @@ export default { ::: +::: title 主题配置 +::: + +

less

+ +``` +@panel-border-color: #eee; +@panel-border-radius: 2px; +@panel-fore-color: #333; +@panel-back-color: #fff; +``` + +

css

+ +``` +--panel-border-color: #eee; +--panel-border-radius: 2px; +--panel-fore-color: #333; +--panel-back-color: #fff; +``` + ::: title Panel 插槽 ::: diff --git a/src/component/button/index.less b/src/component/button/index.less index f5565640..06cf201e 100644 --- a/src/component/button/index.less +++ b/src/component/button/index.less @@ -2,10 +2,12 @@ @button-primary-color: var(--button-primary-color); @button-border-radius: var(--button-border-radius); +@button-border-color: var(--button-border-color); :root { --button-primary-color: @global-primary-color; --button-border-radius: @global-border-radius; + --button-border-color: #d2d2d2; } .layui-btn { @@ -48,7 +50,7 @@ } .layui-btn-primary { - border-color: #d2d2d2; + border-color: @global-border-color; background: 0 0; color: #666; } diff --git a/src/component/card/index.less b/src/component/card/index.less index 9d6a3feb..72bd91b8 100644 --- a/src/component/card/index.less +++ b/src/component/card/index.less @@ -1,16 +1,26 @@ @import "../../theme/variable.less"; +@card-border-radius: var(--card-border-radius); +@card-back-color: var(--card-back-color); +@card-fore-color: var(--card-fore-color); + +:root { + --card-border-radius: @global-border-radius; + --card-back-color: @global-back-color; + --card-fore-color: @global-fore-color; +} + .layui-card { margin-bottom: 15px; - border-radius: @global-border-radius; - background-color: #fff; + border-radius: @card-border-radius; + background-color: @card-back-color; box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); .layui-card-header { height: 42px; line-height: 42px; padding: 0 15px; border-bottom: 1px solid #f6f6f6; - color: #333; + color: @card-fore-color; font-size: 14px; } .layui-card-body { diff --git a/src/component/input/index.less b/src/component/input/index.less index e69de29b..69806caa 100644 --- a/src/component/input/index.less +++ b/src/component/input/index.less @@ -0,0 +1,36 @@ +@import "../../theme/variable.less"; + +@input-border-radius: var(--input-border-radius); +@input-border-color: var(--input-border-color); + +:root { + --input-border-radius: @global-border-radius; + --input-border-color: @global-border-color; +} + +.layui-input { + height: 38px; + line-height: 1.3; + line-height: 38px\9; + border-width: 1px; + border-style: solid; + background-color: #fff; + color: rgba(0, 0, 0, 0.85); + border-radius: @input-border-radius; + border-color: @input-border-color; + display: block; + width: 100%; + padding-left: 10px; +} + +.layui-input:hover { + border-color: #eee !important; +} + +.layui-input:focus { + border-color: #d2d2d2 !important; +} + +.layui-input::-webkit-input-placeholder { + line-height: 1.3; +} diff --git a/src/component/input/index.vue b/src/component/input/index.vue index 6a461365..b161e157 100644 --- a/src/component/input/index.vue +++ b/src/component/input/index.vue @@ -5,6 +5,8 @@ export default {