tengxuanp
tengxuanp

Reputation: 179

Select parent selector when child is checked in SCSS/SASS

Hello guys I have a very newbie question here but can't find a way to fix:

.parent {
  justify-content:left;

  .child__checkbox {
  // properties
  &:checked {
   justify-content:right;  
   } 
  }

When the .child__checkbox is checked, the .parent property should change from justify-content:left to justify-content:right without affecting the properties of .child__checkbox.

How do you do this?

Upvotes: 1

Views: 1449

Answers (1)

Fdamaso
Fdamaso

Reputation: 100

In this case, javascript would be more apropriated, since as of now we dont have a way to affect a parent element like this that works across all browsers.

Upvotes: 1

Related Questions