Skip to content

Instantly share code, notes, and snippets.

@johnlindquist
Created March 8, 2013 16:46
Show Gist options
  • Save johnlindquist/5117860 to your computer and use it in GitHub Desktop.
Save johnlindquist/5117860 to your computer and use it in GitHub Desktop.
.container input:checked + label,
.container input:checked + label:hover{
}
@joshuacc
Copy link

joshuacc commented Mar 8, 2013

You could do this:

.container {
    input {
        &:checked + label {
            color: red;

            &:hover {
                color: red;
            }
        }
    }
}

But that introduces some unnecessary repetition. Honestly, I might be inclined to keep your original example as-is, depending on the context.

@joshuacc
Copy link

joshuacc commented Mar 8, 2013

Ah. Here we go:

.container {
    input {
        &:checked {
            & + label,
            & + label:hover {
                color: red;
            }
        }
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment