CSS-Playing-Cards icon indicating copy to clipboard operation
CSS-Playing-Cards copied to clipboard

Improved appearance for checked cards

Open Chris--S opened this issue 13 years ago • 1 comments

When a label is linked to a checkbox by nesting or for attribute the checkbox doesn't need to be visible - it is operated by clicking on the label.

If you structure the card html as

<input id="some-id" type="checkbox" />
<label for="some-id"> <!-- card html/content --></label>

clicking the label will operate the checkbox and sibling selectors can be used to alter the appearance of the card.

Chris--S avatar Jul 24 '12 00:07 Chris--S

Note, in iOS a label element isn't naturally touchable. The above may need something additional to tell iOS safari that the label should respond to touches. Adding an empty onclick attribute is sufficient, e.g. onclick="". There maybe other triggers that achieve the same thing.

Chris--S avatar Sep 07 '12 13:09 Chris--S