From 313d232b363981ce94c11e419ace904bfc2b246d Mon Sep 17 00:00:00 2001 From: BeADre Date: Fri, 17 Dec 2021 10:22:28 +0800 Subject: [PATCH] fix(loading): expose marigin css variable --- packages/varlet-ui/src/loading/docs/en-US.md | 2 +- packages/varlet-ui/src/loading/docs/zh-CN.md | 1 + packages/varlet-ui/src/loading/loading.less | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/varlet-ui/src/loading/docs/en-US.md b/packages/varlet-ui/src/loading/docs/en-US.md index 7e4e852e62a..65c1899c5d0 100644 --- a/packages/varlet-ui/src/loading/docs/en-US.md +++ b/packages/varlet-ui/src/loading/docs/en-US.md @@ -89,4 +89,4 @@ Here are the CSS variables used by the component, Styles can be customized using | Variable | Default | | --- | --- | | `--loading-opacity` | `0.38` | - +| `--loading-desc-margin` | `8px 0 0` | diff --git a/packages/varlet-ui/src/loading/docs/zh-CN.md b/packages/varlet-ui/src/loading/docs/zh-CN.md index ef0e1e3f969..4216b2ad3b6 100644 --- a/packages/varlet-ui/src/loading/docs/zh-CN.md +++ b/packages/varlet-ui/src/loading/docs/zh-CN.md @@ -89,3 +89,4 @@ export default { | 变量名 | 默认值 | | --- | --- | | `--loading-opacity` | `0.38` | +| `--loading-desc-margin` | `8px 0 0` | diff --git a/packages/varlet-ui/src/loading/loading.less b/packages/varlet-ui/src/loading/loading.less index 9ee7e97c7ce..5ff39c4f2d2 100644 --- a/packages/varlet-ui/src/loading/loading.less +++ b/packages/varlet-ui/src/loading/loading.less @@ -1,6 +1,7 @@ @import '../styles/var'; @loading-opacity: 0.38; +@loading-desc-margin: 8px 0 0; @loading-normal-width: 50px; @loading-normal-height: @font-size-md + 2; @@ -15,6 +16,7 @@ :root { --loading-opacity: @loading-opacity; + --loading-desc-margin: @loading-desc-margin; } .var-loading { @@ -43,7 +45,7 @@ &__description { color: currentColor; - margin-top: 8px; + margin: var(--loading-desc-margin); &--large { font-size: @font-size-lg;