I think you are trying to complicate the situation. A simple solution is to simply check your default checkbox with unverified styles, and then add verified state styles.
input[type="checkbox"] { // Unchecked Styles } input[type="checkbox"]:checked { // Checked Styles }
I apologize for bringing up the old thread, but felt that it could use a better answer.
EDIT (3/3/2016):
The W3C specs indicate that :not(:checked) as an example for selecting an uncontrolled state. However, this is clearly an uncontrolled state and will only apply these styles to an uncontrolled state. This is useful for adding styles that are only needed in the unchecked state, and it needs to be removed from the checked state if it is used in the input[type="checkbox"] selector. See the example below for an explanation.
input[type="checkbox"] { /* Base Styles aka unchecked */ font-weight: 300; // Will be overwritten by :checked font-size: 16px; // Base styling } input[type="checkbox"]:not(:checked) { /* Explicit Unchecked Styles */ border: 1px solid
Without using :not(:checked) in the example above, the :checked selector would have to use border: none; to achieve the same effect.
Use input[type="checkbox"] for the base style to reduce duplication.
Use input[type="checkbox"]:not(:checked) for explicit unverified styles that you do not want to apply to the checked state.
Michael Stramel May 21 '15 at 4:34 pm 2015-05-21 16:34
source share