V
V
Vlad2021-04-14 10:59:12
css
Vlad, 2021-04-14 10:59:12

CSS in SASS. How would this construct look like in SASS?

How would this construct look like in SASS?
Does it read like this? When hovering over a pseudo-element, toggle the radio input to - selected.

input[type="radio"]:checked + span::before {
  background-position: 0 -12px;
}
.checkbox[type="checkbox"] + span::before {
  background-position: 0 -24px;
}

input[type="checkbox"]:checked + span::before {
  background-position: 0 -36px;
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
approximate solution, 2021-04-14
@approximate_solution

input[type="radio"]:checked 
  & + span 
    &::before 
      background-position: 0 -12px 
.checkbox[type="checkbox"] 
  & + span 
    &::before 
      background-position: 0 -24px 
input[type="checkbox"]:checked 
  & + span 
    &::before 
      background-position: 0 -36px

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question