From 4f0483c4245a4c05fa18b8d83c9414730d776cfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xavier=20Juli=C3=A1n?= Date: Mon, 4 May 2015 10:31:45 +0200 Subject: [PATCH] Refactor check class --- app/styles/components/check.scss | 61 +++++++++++++++++++ .../modules/admin/admin-membership-table.scss | 55 ----------------- app/styles/modules/admin/admin-roles.scss | 61 ------------------- app/styles/modules/admin/contrib.scss | 61 ------------------- 4 files changed, 61 insertions(+), 177 deletions(-) create mode 100644 app/styles/components/check.scss diff --git a/app/styles/components/check.scss b/app/styles/components/check.scss new file mode 100644 index 00000000..9c15e077 --- /dev/null +++ b/app/styles/components/check.scss @@ -0,0 +1,61 @@ +.check { + background-color: darken($whitish, 10%); + border-radius: 2px; + cursor: pointer; + height: 1.5rem; + overflow: hidden; + position: relative; + width: 65px; + input { + cursor: pointer; + height: 500px; + left: -10px; + opacity: 0; + position: absolute; + top: -10px; + width: 500px; + z-index: 999; + + div { + background-color: $gray; + height: 25px; + transition: all .2s linear; + width: 50%; + } + ~ .check-text { + //@include transition(opacity .3s linear); + @extend %small; + color: $white; + position: absolute; + top: .1rem; + } + ~ .check-yes { + opacity: 0; + right: .5rem; + } + ~ .check-no { + left: .5rem; + opacity: .6; + } + } + input:checked { + + div { + background-color: $fresh-taiga; + margin-left: 50%; + transition: all .2s linear; + } + ~ .check-yes { + opacity: .6; + right: .4rem; + } + ~ .check-no { + left: .4rem; + opacity: 0; + } + } + input:disabled { + cursor: auto; + + div { + background-color: $gray-light; + } + } +} diff --git a/app/styles/modules/admin/admin-membership-table.scss b/app/styles/modules/admin/admin-membership-table.scss index 1e93696d..544dc21f 100644 --- a/app/styles/modules/admin/admin-membership-table.scss +++ b/app/styles/modules/admin/admin-membership-table.scss @@ -98,59 +98,4 @@ flex-basis: 50px; flex-grow: 1; } - .check { - background-color: darken($whitish, 10%); - border-radius: 2px; - cursor: pointer; - height: 1.5rem; - overflow: hidden; - position: relative; - width: 65px; - input { - cursor: pointer; - height: 500px; - left: -10px; - opacity: 0; - position: absolute; - top: -10px; - width: 500px; - z-index: 999; - + div { - background-color: $gray; - height: 25px; - transition: all .2s linear; - width: 50%; - } - ~ .check-text { - //@include transition(opacity .3s linear); - @extend %small; - color: $white; - position: absolute; - top: .1rem; - } - ~ .check-yes { - opacity: 0; - right: .5rem; - } - ~ .check-no { - left: .5rem; - opacity: .6; - } - } - input:checked { - + div { - background-color: $fresh-taiga; - margin-left: 50%; - transition: all .2s linear; - } - ~ .check-yes { - opacity: .6; - right: .4rem; - } - ~ .check-no { - left: .4rem; - opacity: 0; - } - } - } } diff --git a/app/styles/modules/admin/admin-roles.scss b/app/styles/modules/admin/admin-roles.scss index 40253ca5..83e0511c 100644 --- a/app/styles/modules/admin/admin-roles.scss +++ b/app/styles/modules/admin/admin-roles.scss @@ -47,65 +47,4 @@ margin-left: .5rem; } } - .check { - background-color: darken($whitish, 10%); - border-radius: 2px; - cursor: pointer; - height: 1.5rem; - overflow: hidden; - position: relative; - width: 65px; - input { - cursor: pointer; - height: 500px; - left: -10px; - opacity: 0; - position: absolute; - top: -10px; - width: 500px; - z-index: 999; - + div { - background-color: $gray; - height: 25px; - transition: all .2s linear; - width: 50%; - } - ~ .check-text { - //@include transition(opacity .3s linear); - @extend %small; - color: $white; - position: absolute; - top: .1rem; - } - ~ .check-yes { - opacity: 0; - right: .5rem; - } - ~ .check-no { - left: .5rem; - opacity: .6; - } - } - input:checked { - + div { - background-color: $fresh-taiga; - margin-left: 50%; - transition: all .2s linear; - } - ~ .check-yes { - opacity: .6; - right: .4rem; - } - ~ .check-no { - left: .4rem; - opacity: 0; - } - } - input:disabled { - cursor: auto; - + div { - background-color: $gray-light; - } - } - } } diff --git a/app/styles/modules/admin/contrib.scss b/app/styles/modules/admin/contrib.scss index 95fec6a5..e8745d6b 100644 --- a/app/styles/modules/admin/contrib.scss +++ b/app/styles/modules/admin/contrib.scss @@ -54,67 +54,6 @@ } } } - .check { - background-color: darken($whitish, 10%); - border-radius: 2px; - cursor: pointer; - height: 1.5rem; - overflow: hidden; - position: relative; - width: 65px; - input { - cursor: pointer; - height: 500px; - left: -10px; - opacity: 0; - position: absolute; - top: -10px; - width: 500px; - z-index: 999; - + div { - background-color: $gray; - height: 25px; - transition: all .2s linear; - width: 50%; - } - ~ .check-text { - //@include transition(opacity .3s linear); - @extend %small; - color: $white; - position: absolute; - top: .1rem; - } - ~ .check-yes { - opacity: 0; - right: .5rem; - } - ~ .check-no { - left: .5rem; - opacity: .6; - } - } - input:checked { - + div { - background-color: $fresh-taiga; - margin-left: 50%; - transition: all .2s linear; - } - ~ .check-yes { - opacity: .6; - right: .4rem; - } - ~ .check-no { - left: .4rem; - opacity: 0; - } - } - input:disabled { - cursor: auto; - + div { - background-color: $gray-light; - } - } - } .check-item { align-items: center; border-bottom: 1px solid $whitish;