diff --git a/packages/vlossom/src/components/vs-button/VsButton.scss b/packages/vlossom/src/components/vs-button/VsButton.scss index 5fa3509c9..11b9fb41c 100644 --- a/packages/vlossom/src/components/vs-button/VsButton.scss +++ b/packages/vlossom/src/components/vs-button/VsButton.scss @@ -40,7 +40,7 @@ opacity: 0; width: 120%; height: 100%; - background: #ffffff; + background: var(--vs-white); transition: all 0.4s ease-out; pointer-events: none; } @@ -119,24 +119,46 @@ // loading .vs-button { - @keyframes rotate { - 0% { - transform: rotate(0deg); - } - 100% { - transform: rotate(360deg); - } + .content { + visibility: visible; + } + + .loading-icon { + visibility: hidden; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + line-height: 1; + font-size: 0; } &.loading { pointer-events: none; + .content { + visibility: hidden; + } + .loading-icon { - animation: rotate 2s linear infinite; + visibility: visible; + + .rotate { + animation: rotate 2s linear infinite; + } } } } +@keyframes rotate { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } +} + @media screen and (max-width: 768px) { .vs-button.mobile-full { width: 100%; diff --git a/packages/vlossom/src/components/vs-button/VsButton.vue b/packages/vlossom/src/components/vs-button/VsButton.vue index 3c9f0af88..4f404941e 100644 --- a/packages/vlossom/src/components/vs-button/VsButton.vue +++ b/packages/vlossom/src/components/vs-button/VsButton.vue @@ -6,11 +6,13 @@ :disabled="disabled" :aria-label="loading ? 'loading' : undefined" > - + - + + +