/* Table of Contents ================================================== # Variables # Swoggle # Colors */ /* # Variables ================================================== */ $ongray-colors: ( dark-haze: $color-dark-haze, haze: $color-haze, light-haze: $color-light-haze, white: $color-white ); $onwhite-colors: ( dark-black: $color-dark-black, black: $color-black, light-black: $color-light-black, dark-gray: $color-dark-gray, gray: $color-gray, light-gray: $color-light-gray, lime: $color-lime, green: $color-green, teal: $color-teal, blue: $color-blue, indigo: $color-indigo, purple: $color-purple, pink: $color-pink, red: $color-red, orange: $color-orange, yellow: $color-yellow ); /* # Swoggle ================================================== */ .swoggle input[type='radio'], .swoggle input[type='checkbox'] { left: 0; opacity: 0; filter: alpha(opacity=0); position: absolute !important; top: 0; z-index: -1; } .swoggle { background: $color-light-haze; border: 1px solid $color-light-haze; border-radius: 500px; color: $color-gray; cursor: pointer; display: inline-block; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-size: 12px; font-weight: bold; line-height: 1; margin-top: -2px; min-width: 64px; overflow: hidden; padding: 4px 0; position: relative; text-align: center; text-rendering: geometricPrecision; text-transform: uppercase; @include transition(all 0.5s ease-in-out); @include user-select(none); vertical-align: middle; } .swoggle span, .swoggle label { box-sizing: border-box; cursor: pointer; display: inline-block; height: 100%; position: relative; text-align: center; vertical-align: middle; } .swoggle label { background: $color-white; border-radius: 500px; margin: 0; padding: 3px 0 4px 0; width: 20%; z-index: 100; } .swoggle span { padding: 0; width: 40%; z-index: 1; } .swoggle div { display: inline-block; position: relative; @include transform(translate3d(0,0,0)); top: 0; width: 150%; } .swoggle.swoggle-on div { margin-left: 0; } .swoggle.swoggle-off div { margin-left: -50%; } .swoggle.swoggle-animate div { @include transition(margin-left 0.5s); } .swoggle.swoggle-disabled { cursor: not-allowed !important; } .swoggle.swoggle-readonly { cursor: default !important; } /* # Colors ================================================== */ @each $name, $color in $ongray-colors { .swoggle.swoggle-on.swoggle-#{$name} { background: $color; border-color: $color; color: $color-gray; } } @each $name, $color in $onwhite-colors { .swoggle.swoggle-on.swoggle-#{$name} { background: $color; border-color: $color; color: $color-white; } }