Created
October 24, 2015 18:08
-
-
Save mnich/69c5acb06b3847a536c9 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ---- | |
| // Sass (v3.4.14) | |
| // Compass (v1.0.3) | |
| // ---- | |
| .label--switch { | |
| width: 100%; | |
| input { | |
| display: none; | |
| } | |
| &.green { | |
| .switch { | |
| background: rgba(102,204,153, .26); | |
| &:active { | |
| &:before { | |
| box-shadow: 0 2px 8px rgba(0,0,0,0.28), 0 0 0 20px rgba(102,204,153,0.1); | |
| } | |
| } | |
| } | |
| input:checked + .switch { | |
| background: rgba(102,204,153,0.5); | |
| } | |
| input:checked + .switch:before { | |
| background: #66cc99; | |
| } | |
| input:checked + .switch:active{ | |
| &:before { | |
| box-shadow: 0 2px 8px rgba(0,0,0,0.28), 0 0 0 20px rgba(102,204,153,0.2); | |
| } | |
| } | |
| } | |
| .switch { | |
| display: inline-block; | |
| position: relative; | |
| width: 40px; | |
| height: 16px; | |
| border-radius: 8px; | |
| background: rgba(241, 169, 35, 0.26); | |
| transition: background 0.28s cubic-bezier(0.4, 0, 0.2, 1); | |
| vertical-align: middle; | |
| cursor: pointer; | |
| &:before { | |
| content: ''; | |
| position: absolute; | |
| top: -4px; | |
| left: -4px; | |
| width: 24px; | |
| height: 24px; | |
| background: #fafafa; | |
| box-shadow: 0 2px 8px rgba(0,0,0,0.28); | |
| border-radius: 50%; | |
| transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1), background 0.28s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1); | |
| } | |
| &:active{ | |
| &:before { | |
| box-shadow: 0 2px 8px rgba(0,0,0,0.28), 0 0 0 20px rgba(241, 169, 35,0.1); | |
| } | |
| } | |
| } | |
| input:checked + .switch { | |
| background: rgba(241, 169, 35,0.5); | |
| } | |
| input:checked + .switch:before { | |
| left: 20px; | |
| background: #f1a923; | |
| } | |
| input:checked + .switch:active{ | |
| &:before { | |
| box-shadow: 0 2px 8px rgba(0,0,0,0.28), 0 0 0 20px rgba(241, 169, 35,0.2); | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .label--switch { | |
| width: 100%; | |
| } | |
| .label--switch input { | |
| display: none; | |
| } | |
| .label--switch.green .switch { | |
| background: rgba(102, 204, 153, 0.26); | |
| } | |
| .label--switch.green .switch:active:before { | |
| box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28), 0 0 0 20px rgba(102, 204, 153, 0.1); | |
| } | |
| .label--switch.green input:checked + .switch { | |
| background: rgba(102, 204, 153, 0.5); | |
| } | |
| .label--switch.green input:checked + .switch:before { | |
| background: #66cc99; | |
| } | |
| .label--switch.green input:checked + .switch:active:before { | |
| box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28), 0 0 0 20px rgba(102, 204, 153, 0.2); | |
| } | |
| .label--switch .switch { | |
| display: inline-block; | |
| position: relative; | |
| width: 40px; | |
| height: 16px; | |
| border-radius: 8px; | |
| background: rgba(241, 169, 35, 0.26); | |
| transition: background 0.28s cubic-bezier(0.4, 0, 0.2, 1); | |
| vertical-align: middle; | |
| cursor: pointer; | |
| } | |
| .label--switch .switch:before { | |
| content: ''; | |
| position: absolute; | |
| top: -4px; | |
| left: -4px; | |
| width: 24px; | |
| height: 24px; | |
| background: #fafafa; | |
| box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28); | |
| border-radius: 50%; | |
| transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1), background 0.28s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1); | |
| } | |
| .label--switch .switch:active:before { | |
| box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28), 0 0 0 20px rgba(241, 169, 35, 0.1); | |
| } | |
| .label--switch input:checked + .switch { | |
| background: rgba(241, 169, 35, 0.5); | |
| } | |
| .label--switch input:checked + .switch:before { | |
| left: 20px; | |
| background: #f1a923; | |
| } | |
| .label--switch input:checked + .switch:active:before { | |
| box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28), 0 0 0 20px rgba(241, 169, 35, 0.2); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment