Created
September 11, 2018 12:58
-
-
Save marioloncarek/de956aa3adf165b24054e81962f06697 to your computer and use it in GitHub Desktop.
shopify product options in radio buttons css
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
.product-option { | |
&__color { | |
display: flex; | |
.product-option__radio { | |
position: absolute; | |
opacity: 0; | |
z-index: -1; | |
border: none; | |
+ label { | |
color: getColor('black', 'default'); | |
position: relative; | |
cursor: pointer; | |
width: 25px; | |
height: 15px; | |
display: flex; | |
align-items: center; | |
justify-content: center; | |
font-size: 9px; | |
.icon-check { | |
transition: getTransition(); | |
opacity: 0; | |
visibility: hidden; | |
} | |
} | |
&:checked { | |
+ label { | |
.icon-check { | |
opacity: 1; | |
visibility: visible; | |
} | |
} | |
} | |
&:disabled { | |
+ label { | |
display: none; | |
} | |
&:not(:checked), &:checked { | |
+ label { | |
display: none; | |
} | |
} | |
&:checked { | |
+ label { | |
display: none; | |
} | |
} | |
} | |
} | |
} | |
&__size { | |
.product-option__radio { | |
position: absolute; | |
opacity: 0; | |
z-index: -1; | |
border: none; | |
+ label { | |
@include font-map('b6'); | |
@include font-default('medium'); | |
transition: getTransition(); | |
color: getColor('black', 'default'); | |
border-bottom: 2px solid transparent; | |
position: relative; | |
display: inline-block; | |
padding: 2px 0; | |
cursor: pointer; | |
margin-right: 20px; | |
} | |
&:checked { | |
+ label { | |
border-bottom-color: currentColor; | |
} | |
} | |
&:disabled { | |
+ label { | |
color: getColor('label-disabled', 'form'); | |
} | |
&:not(:checked), &:checked { | |
+ label { | |
color: getColor('label-disabled', 'form'); | |
} | |
} | |
&:checked { | |
+ label { | |
color: getColor('label-disabled', 'form'); | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment