diff --git a/scss/_placeholder.scss b/scss/_placeholder.scss index e05056396347..bc70b41e6cf9 100644 --- a/scss/_placeholder.scss +++ b/scss/_placeholder.scss @@ -1,19 +1,29 @@ -@use "colors" as *; @use "config" as *; @use "functions" as *; +@use "mixins/border-radius" as *; @use "mixins/tokens" as *; $placeholder-tokens: () !default; +$placeholder-wave-tokens: () !default; // scss-docs-start placeholder-tokens // stylelint-disable-next-line scss/dollar-variable-default $placeholder-tokens: defaults( ( - --placeholder-opacity-max: .5, - --placeholder-opacity-min: .2, + --placeholder-opacity-max: .18, + --placeholder-opacity-min: .1, ), $placeholder-tokens ); + +// stylelint-disable-next-line scss/dollar-variable-default +$placeholder-wave-tokens: defaults( + ( + --placeholder-opacity-max: .5, + --placeholder-opacity-min: .25, + ), + $placeholder-wave-tokens +); // scss-docs-end placeholder-tokens @layer components { @@ -21,10 +31,11 @@ $placeholder-tokens: defaults( @include tokens($placeholder-tokens); display: inline-block; - min-height: 1em; + min-height: 1.25em; vertical-align: middle; cursor: wait; background-color: currentcolor; + @include border-radius(var(--radius-3)); opacity: var(--placeholder-opacity-max); &.btn::before { @@ -35,15 +46,15 @@ $placeholder-tokens: defaults( // Sizing .placeholder-xs { - min-height: .6em; + min-height: .75em; } .placeholder-sm { - min-height: .8em; + min-height: 1em; } .placeholder-lg { - min-height: 1.2em; + min-height: 1.75em; } // Animation @@ -66,7 +77,9 @@ $placeholder-tokens: defaults( } .placeholder-wave { - mask-image: linear-gradient(130deg, $black 55%, rgb(0 0 0 / calc(1 - var(--placeholder-opacity-min))) 75%, $black 95%); + @include tokens($placeholder-wave-tokens); + + mask-image: linear-gradient(110deg, var(--black) 40%, rgb(0 0 0 / calc(1 - var(--placeholder-opacity-max))) 50%, var(--black) 60%); mask-size: 200% 100%; animation: placeholder-wave 2s linear infinite; diff --git a/site/src/content/docs/components/placeholder.mdx b/site/src/content/docs/components/placeholder.mdx index 0323beb56c3d..7da7fdc0e5fc 100644 --- a/site/src/content/docs/components/placeholder.mdx +++ b/site/src/content/docs/components/placeholder.mdx @@ -39,7 +39,7 @@ In the example below, we take a typical card component and recreate it with plac
- + `} /> @@ -82,13 +82,13 @@ We apply additional styling to `.btn`s via `::before` to ensure the `height` is - `} /> + `} />