I have a web application with checkboxes that I want to universally disable using CSS, regardless of the language displayed on the page. I initially used the following CSS to disable checkboxes with specific aria-label attributes, but it does not work for all languages:
label[aria-label="Select All"] {
display: none;
pointer-events: none;
}
I want to disable checkboxes for all languages without considering the text content. How can I achieve this using CSS?
Here is an example of a label in French which is still visible.
<label class="label_label__1lyg41o0 base_componentBase__159h7ep0 label_variant_regular__1lyg41o1 checkbox_checkbox__1tqnmmh3 base_componentBase__159h7ep0" aria-label="Sélectionner tout"
Update: here is picture of parent and sibling for label
example for french
2
Answers
Instead of label use input attribute.
I think we can use this selector
th[class*="selectAll"] > label
and just select the parent of the label which contains the "select all" text then select the label itself: