-
Notifications
You must be signed in to change notification settings - Fork 747
Closed
Description
Is there any possibility labels which refer to a disabled input (or any form control like select
, textarea
, ect...) can have additional styling applied to?
For example:
HTML:
<!-- Normal label: -->
<div>
<label for="test">Label</label>
<input type="checkbox" id="test">
</div>
<!-- This disabled label can be styled with a sibling selector: -->
<div>
<input type="checkbox" id="test2" disabled>
<label for="test2">Label</label>
</div>
<!-- This disabled label can not be styled in CSS: -->
<div>
<label for="test3">Label</label>
<input type="checkbox" id="test3" disabled>
</div>
<!-- This disabled label can not be styled in CSS: -->
<label>
<span>Label</label>
<input type="checkbox" disabled>
</label>
CSS:
input:disabled {
/* Styling for disabled input, this currently works */
}
label:disabled {
/* Styling for label referring to a disabled input, this currently doesn't works */
}
So my proposal is to add a disabled state for labels, like described in the CSS block above. Let me know if I'm missing something here.
Metadata
Metadata
Assignees
Labels
No labels