I want to check a checkbox and apply a 1px border around it via an enclosing span tag.
I am a bit stuck on how to detect the checked css property and select the parent span to apply a property to the span? Can I achieve this with only CSS? Below is what I have so far.
CSS(Sass)
input.checkbox
opacity: 0
span.check
width: 16px
height: 16px
border: 2px solid black
display: inline-block
position: relative
input.checkbox:checked <--once i detect checked I am unsure how to apply the border to the parent span tag
background: black
position: absolute
top: -8px
left: 0px
HTML
<span class='check'><input type="checkbox" class="checkbox" name="" /></span>