From b569503077bf585862f52b39d87ec27fffbbd1ff Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Wed, 29 Dec 2021 14:42:59 +0000 Subject: [PATCH] Cleanup toggle switch --- war/src/main/less/form/toggle-switch.less | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/war/src/main/less/form/toggle-switch.less b/war/src/main/less/form/toggle-switch.less index d0ba6dd8a6af..8a98e9c18fed 100644 --- a/war/src/main/less/form/toggle-switch.less +++ b/war/src/main/less/form/toggle-switch.less @@ -24,14 +24,20 @@ &:checked + label::after { left: 25px; - color: var(--focus-input-border); transform: rotate(0deg); + mask-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='66px' height='66px' viewBox='0 0 66 66' version='1.1' xmlns='http://www.w3.org/2000/svg'%3E%3Cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E%3Cpath d='M66,0 L66,66 L0,66 L0,0 L66,0 Z M37.7154094,29.2061836 C37.3690459,28.9031155 36.8425777,28.9382134 36.5395097,29.2845769 L36.5395097,29.2845769 L31.2924962,35.2799905 L29.4225874,33.410737 L29.3440813,33.3414133 C29.0171724,33.0872262 28.5444804,33.1103341 28.2440774,33.410737 C27.9186409,33.7361736 27.9186409,34.2638104 28.2440774,34.589247 L28.2440774,34.589247 L30.7440745,37.0892441 L30.8202748,37.15679 C31.1634387,37.4256962 31.6657159,37.3856111 31.9604761,37.0487424 L31.9604761,37.0487424 L37.7938027,30.3820833 L37.8577508,30.2991398 C38.0896293,29.9560466 38.0351295,29.4859387 37.7154094,29.2061836 Z' fill='%23000000'%3E%3C/path%3E%3C/g%3E%3C/svg%3E"); } &:active + label::before, &:focus + label::before { box-shadow: 0 0 0 5px var(--focus-input-glow); } + + &:disabled { + & + label { + cursor: not-allowed; + } + } } .jenkins-toggle-switch label { @@ -58,7 +64,7 @@ } &::after { - content: "✓"; + content: ""; display: flex; align-items: center; justify-content: center; @@ -68,13 +74,11 @@ width: 20px; height: 20px; background: var(--background); - border-radius: 19px; - color: transparent; - transition: 0.2s ease; + mask-size: 60px 60px; + mask-position: center; + border-radius: 100%; + transition: var(--standard-transition); transform: rotate(-90deg); - font-size: 12px; - font-weight: bold; - padding-top: 2px; box-shadow: -1px 0 0 rgba(0, 0, 0, 0.1); }