From f58ff79872a2eccc4f38ead61c977cefd7ad35ab Mon Sep 17 00:00:00 2001 From: "songwanli2025@163.com" Date: Tue, 15 Oct 2019 17:40:21 +0800 Subject: [PATCH 1/2] add theme to spin --- .../components/spinDemo/enUS/basic.md | 4 + .../components/spinDemo/enUS/index.md | 5 ++ .../components/spinDemo/enUS/wrap.md | 54 ++++++++++++ .../components/spinDemo/index.entry | 0 .../components/spinDemo/index.vue | 35 -------- .../components/spinDemo/scaffold.demo.vue | 28 ------ .../components/spinDemo/wrap.demo.vue | 60 ------------- .../components/spinDemo/zhCN/index.md | 0 packages/base/Loading/src/main.vue | 86 +++++++++++-------- packages/common/Spin/src/main.vue | 8 ++ styles/Loading.scss | 65 ++++++++++++++ styles/Spin.scss | 2 +- styles/index.scss | 3 +- styles/themes/dark/components/Loading.scss | 3 + styles/themes/dark/index.scss | 2 + styles/themes/light/components/Loading.scss | 3 + styles/themes/light/index.scss | 2 + 17 files changed, 199 insertions(+), 161 deletions(-) create mode 100644 demo/documentation/components/spinDemo/enUS/basic.md create mode 100644 demo/documentation/components/spinDemo/enUS/index.md create mode 100644 demo/documentation/components/spinDemo/enUS/wrap.md create mode 100644 demo/documentation/components/spinDemo/index.entry delete mode 100644 demo/documentation/components/spinDemo/index.vue delete mode 100644 demo/documentation/components/spinDemo/scaffold.demo.vue delete mode 100644 demo/documentation/components/spinDemo/wrap.demo.vue create mode 100644 demo/documentation/components/spinDemo/zhCN/index.md create mode 100644 styles/Loading.scss create mode 100644 styles/themes/dark/components/Loading.scss create mode 100644 styles/themes/light/components/Loading.scss diff --git a/demo/documentation/components/spinDemo/enUS/basic.md b/demo/documentation/components/spinDemo/enUS/basic.md new file mode 100644 index 000000000..925e73978 --- /dev/null +++ b/demo/documentation/components/spinDemo/enUS/basic.md @@ -0,0 +1,4 @@ +# Basic +```html + +``` \ No newline at end of file diff --git a/demo/documentation/components/spinDemo/enUS/index.md b/demo/documentation/components/spinDemo/enUS/index.md new file mode 100644 index 000000000..18272d7cc --- /dev/null +++ b/demo/documentation/components/spinDemo/enUS/index.md @@ -0,0 +1,5 @@ +# Divider +```demo +basic +wrap +``` \ No newline at end of file diff --git a/demo/documentation/components/spinDemo/enUS/wrap.md b/demo/documentation/components/spinDemo/enUS/wrap.md new file mode 100644 index 000000000..959549933 --- /dev/null +++ b/demo/documentation/components/spinDemo/enUS/wrap.md @@ -0,0 +1,54 @@ +# Wrap +```html +
+ + + Small Spin + + + + + Medium Spin + + + + + Large Spin + + + + + Leave it till tomorrow to unpack my case + + +
+
spin
+``` +```js +export default { + data () { + return { + spinning: false + } + } +} +``` \ No newline at end of file diff --git a/demo/documentation/components/spinDemo/index.entry b/demo/documentation/components/spinDemo/index.entry new file mode 100644 index 000000000..e69de29bb diff --git a/demo/documentation/components/spinDemo/index.vue b/demo/documentation/components/spinDemo/index.vue deleted file mode 100644 index bcbfb42b3..000000000 --- a/demo/documentation/components/spinDemo/index.vue +++ /dev/null @@ -1,35 +0,0 @@ - - - diff --git a/demo/documentation/components/spinDemo/scaffold.demo.vue b/demo/documentation/components/spinDemo/scaffold.demo.vue deleted file mode 100644 index fd291804b..000000000 --- a/demo/documentation/components/spinDemo/scaffold.demo.vue +++ /dev/null @@ -1,28 +0,0 @@ - - - diff --git a/demo/documentation/components/spinDemo/wrap.demo.vue b/demo/documentation/components/spinDemo/wrap.demo.vue deleted file mode 100644 index c4c31faca..000000000 --- a/demo/documentation/components/spinDemo/wrap.demo.vue +++ /dev/null @@ -1,60 +0,0 @@ - - - diff --git a/demo/documentation/components/spinDemo/zhCN/index.md b/demo/documentation/components/spinDemo/zhCN/index.md new file mode 100644 index 000000000..e69de29bb diff --git a/packages/base/Loading/src/main.vue b/packages/base/Loading/src/main.vue index 4e90efe4b..6129a7517 100644 --- a/packages/base/Loading/src/main.vue +++ b/packages/base/Loading/src/main.vue @@ -1,5 +1,8 @@ - - diff --git a/packages/common/Spin/src/main.vue b/packages/common/Spin/src/main.vue index 0aa79ab19..8c1cc36f2 100644 --- a/packages/common/Spin/src/main.vue +++ b/packages/common/Spin/src/main.vue @@ -5,32 +5,32 @@ >
@@ -44,10 +44,7 @@ export default { components: { NBaseLoading }, - mixins: [ - withapp, - themeable - ], + mixins: [withapp, themeable], props: { size: { type: [String, Number], @@ -62,8 +59,6 @@ export default { default: null } }, - methods: { - - } + methods: {} } diff --git a/styles/Loading.scss b/styles/BaseLoading.scss similarity index 54% rename from styles/Loading.scss rename to styles/BaseLoading.scss index bfa9c9f07..008aeef8f 100644 --- a/styles/Loading.scss +++ b/styles/BaseLoading.scss @@ -2,13 +2,13 @@ @import './themes/vars.scss'; -@keyframes loading-rotate { +@keyframes n-base-loading-rotate { to { transform: rotate(1turn) } } -@keyframes loading-dash { +@keyframes n-base-loading-dash { 0% { stroke-dasharray: 1,200; stroke-dashoffset: 0 @@ -31,12 +31,13 @@ @include once { height: 100%; width: 100%; - animation: loading-rotate 2s linear infinite; + animation: n-base-loading-rotate 2s linear infinite; } @include b(base-loading-circular-path) { - stroke: $--loading-border-color; + stroke: $--base-loading-stroke; @include once { - animation: loading-dash 1.5s ease-in-out infinite; + transition: stroke .3s $default-cubic-bezier; + animation: n-base-loading-dash 1.5s ease-in-out infinite; stroke-dasharray: 90,150; stroke-dashoffset: 0; stroke-width: 8; @@ -45,21 +46,4 @@ } } } -} -// .n-base-loading { -// line-height: 1; -// } - -// .n-base-loading-circular { -// height: 100%; -// width: 100%; -// animation: loading-rotate 2s linear infinite; -// .n-base-loading-circular-path { -// animation: loading-dash 1.5s ease-in-out infinite; -// stroke-dasharray: 90,150; -// stroke-dashoffset: 0; -// stroke-width: 8; -// stroke: #63E2B7; -// stroke-linecap: round; -// } -// } \ No newline at end of file +} \ No newline at end of file diff --git a/styles/index.scss b/styles/index.scss index 826673937..2424fc9a0 100644 --- a/styles/index.scss +++ b/styles/index.scss @@ -56,4 +56,4 @@ @import "./AdvancedTable.scss"; @import "./NimbusIcon.scss"; @import "./Confirm.scss"; -@import "./Loading.scss" \ No newline at end of file +@import "./BaseLoading.scss" \ No newline at end of file diff --git a/styles/themes/dark/components/BaseLoading.scss b/styles/themes/dark/components/BaseLoading.scss new file mode 100644 index 000000000..e544c725c --- /dev/null +++ b/styles/themes/dark/components/BaseLoading.scss @@ -0,0 +1,3 @@ +@mixin setup-dark-base-loading { + $--base-loading-stroke: $--n-primary-color !global; +} \ No newline at end of file diff --git a/styles/themes/dark/components/Loading.scss b/styles/themes/dark/components/Loading.scss deleted file mode 100644 index 131c9173e..000000000 --- a/styles/themes/dark/components/Loading.scss +++ /dev/null @@ -1,3 +0,0 @@ -@mixin setup-dark-loading { - $--loading-border-color: $--n-primary-color !global; -} \ No newline at end of file diff --git a/styles/themes/dark/index.scss b/styles/themes/dark/index.scss index 3f0d7ae83..0bd5d69b6 100644 --- a/styles/themes/dark/index.scss +++ b/styles/themes/dark/index.scss @@ -3,7 +3,7 @@ @import "components/Divider.scss"; @import "components/NimbusServiceLayout.scss"; @import "components/Scrollbar.scss"; -@import "components/Loading.scss"; +@import "components/BaseLoading.scss"; @import "components/BaseSelectMenu.scss"; @import "components/BasePicker.scss"; @import "components/BaseCancelMark.scss"; @@ -51,7 +51,7 @@ @include setup-dark-nimbus-service-layout; @include setup-dark-divider; @include setup-dark-scrollbar; - @include setup-dark-loading; + @include setup-dark-base-loading; @include setup-dark-button; @include setup-dark-base-select-menu; @include setup-dark-base-picker; diff --git a/styles/themes/light/components/BaseLoading.scss b/styles/themes/light/components/BaseLoading.scss new file mode 100644 index 000000000..116914fb4 --- /dev/null +++ b/styles/themes/light/components/BaseLoading.scss @@ -0,0 +1,3 @@ +@mixin setup-light-base-loading { + $--base-loading-stroke: $--n-primary-color !global; +} \ No newline at end of file diff --git a/styles/themes/light/components/Loading.scss b/styles/themes/light/components/Loading.scss deleted file mode 100644 index 65d99d0a7..000000000 --- a/styles/themes/light/components/Loading.scss +++ /dev/null @@ -1,3 +0,0 @@ -@mixin setup-light-loading { - $--loading-border-color: $--n-primary-color !global; -} \ No newline at end of file diff --git a/styles/themes/light/index.scss b/styles/themes/light/index.scss index bacfdfd14..209d37fa6 100644 --- a/styles/themes/light/index.scss +++ b/styles/themes/light/index.scss @@ -3,7 +3,7 @@ @import "components/Divider.scss"; @import "components/NimbusServiceLayout.scss"; @import "components/Scrollbar.scss"; -@import "components/Loading.scss"; +@import "components/BaseLoading.scss"; @import "components/BaseSelectMenu.scss"; @import "components/BasePicker.scss"; @import "components/BaseCancelMark.scss"; @@ -47,7 +47,7 @@ @include setup-light-nimbus-service-layout; @include setup-light-divider; @include setup-light-scrollbar; - @include setup-light-loading; + @include setup-light-base-loading; @include setup-light-button; @include setup-light-base-select-menu; @include setup-light-base-picker;