From 7b082df82fb5ede4969840622ded3bebd64f4c65 Mon Sep 17 00:00:00 2001 From: rubenmoya Date: Tue, 21 Nov 2017 10:34:45 +0100 Subject: [PATCH] Add hover effects to _toggle.scss --- src/scss/cdb-components/forms/_toggle.scss | 17 ++++++++++++++--- src/scss/cdb-variables/_colors.scss | 4 +++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/scss/cdb-components/forms/_toggle.scss b/src/scss/cdb-components/forms/_toggle.scss index 5947e5d..ce2c8d1 100644 --- a/src/scss/cdb-components/forms/_toggle.scss +++ b/src/scss/cdb-components/forms/_toggle.scss @@ -30,21 +30,32 @@ .CDB-Toggle { position: absolute; + z-index: 1; width: $baseSize * 4; height: $baseSize * 2; opacity: 0; - z-index: 1; + + &:hover { + + .CDB-ToggleFace { + background: $cHintTextHover; + } + + &:checked + .CDB-ToggleFace { + background: $cHighlightHover; + } + } + .CDB-ToggleFace { - @include transition(background, 300ms); position: relative; width: $baseSize * 4; height: $baseSize * 2; margin: 0 2px; + transition: background 300ms; border-radius: 50px; background: $cHintText; &::before { + content: ''; position: absolute; top: 2px; left: 2px; @@ -53,7 +64,6 @@ border-radius: 50%; background: $cWhite; box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.48); - content: ''; } } @@ -69,4 +79,5 @@ .Toggle .is-disabled { opacity: 0.24; + pointer-events: none; } diff --git a/src/scss/cdb-variables/_colors.scss b/src/scss/cdb-variables/_colors.scss index 04b4b05..01b27b6 100644 --- a/src/scss/cdb-variables/_colors.scss +++ b/src/scss/cdb-variables/_colors.scss @@ -3,7 +3,7 @@ // General $cBlue: #1785FB; -$cBlueHover: #0f6cd2; +$cBlueHover: #0F6CD2; $cBlack: #000; $cWhite: #FFF; $cMainBg: #2E3C43; @@ -23,9 +23,11 @@ $cMainText: #2E3C43; $cSecondaryText: #636D72; $cAltText: #979EA1; $cHintText: #CBCED0; +$cHintTextHover: #9C9FA1; //Others $cHighlight: #9DE0AD; +$cHighlightHover: #82BB90; $cAlert: #F19243; $cPublic: #9BC63B; $cLink: #FEB100;