Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typo with incorrect class in docs for required checkbox and variants #770

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ui/components/checkbox-toggle/docs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ Groups of checkboxes should be marked up using the fieldset and legend element.

Custom checkboxes are created by applying the `.slds-checkbox` class to a `<label>` element. To remain accessible to all user agents, place `<input>` with `type="checkbox"` inside the `<label>` element. The `<input>` is then visually hidden, and the styling is placed on a span with the `.slds-checkbox_faux` class. The styling of the span changes based on whether the checkbox is selected or focused by using a pseudo-element. A second span with `.slds-form-element__label` contains the label text.

When a single checkbox is required, `<div class="slds-checkbox">` should get `<abbr class="required" title="required">*</abbr>` added to the DOM, directly before the `<input type="checkbox" />` for visual indication that the checkbox is required.
When a single checkbox is required, `<div class="slds-checkbox">` should get `<abbr class="slds-required" title="required">*</abbr>` added to the DOM, directly before the `<input type="checkbox" />` for visual indication that the checkbox is required.

When a checkbox group is required, the `<fieldset>` should receive the class `.slds-is-required`. The `<legend>` should then get `<abbr class="required" title="required">*</abbr>` added to the DOM for visual indication that the checkbox group is required.
When a checkbox group is required, the `<fieldset>` should receive the class `.slds-is-required`. The `<legend>` should then get `<abbr class="slds-required" title="required">*</abbr>` added to the DOM for visual indication that the checkbox group is required.

As SLDS checkboxes rely on the `:checked` pseudo selector, and the indeterminate state is only accessible via JavaScript, the use of a CSS class on the input will be necessary to implement this in SLDS. Use JavaScript to add the class when the indeterminate property is set to true on the input.

Expand Down
4 changes: 2 additions & 2 deletions ui/components/checkbox/_doc.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
* A second span with `.slds-form-element__label` contains the label text.
*
* When a single checkbox is required, `<div class="slds-checkbox">` should
* get `<abbr class="required" title="required">*</abbr>` added to the DOM,
* get `<abbr class="slds-required" title="required">*</abbr>` added to the DOM,
* directly before the `<input type="checkbox" />` for visual indication
* that the checkbox is required.
*
* When a checkbox group is required, the `<fieldset>` should receive the
* class `.slds-is-required`. The `<legend>` should then get
* `<abbr class="required" title="required">*</abbr>` added to the DOM for
* `<abbr class="slds-required" title="required">*</abbr>` added to the DOM for
* visual indication that the checkbox group is required.
*
* As SLDS checkboxes rely on the :checked psuedo selector, and the
Expand Down
4 changes: 2 additions & 2 deletions ui/components/checkbox/docs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ Groups of checkboxes should be marked up using the fieldset and legend element.

Custom checkboxes are created by applying the `.slds-checkbox` class to a `<label>` element. To remain accessible to all user agents, place `<input>` with `type="checkbox"` inside the `<label>` element. The `<input>` is then visually hidden, and the styling is placed on a span with the `.slds-checkbox_faux` class. The styling of the span changes based on whether the checkbox is selected or focused by using a pseudo-element. A second span with `.slds-form-element__label` contains the label text.

When a single checkbox is required, `<div class="slds-checkbox">` should get `<abbr class="required" title="required">*</abbr>` added to the DOM, directly before the `<input type="checkbox" />` for visual indication that the checkbox is required.
When a single checkbox is required, `<div class="slds-checkbox">` should get `<abbr class="slds-required" title="required">*</abbr>` added to the DOM, directly before the `<input type="checkbox" />` for visual indication that the checkbox is required.

When a checkbox group is required, the `<fieldset>` should receive the class `.slds-is-required`. The `<legend>` should then get `<abbr class="required" title="required">*</abbr>` added to the DOM for visual indication that the checkbox group is required.
When a checkbox group is required, the `<fieldset>` should receive the class `.slds-is-required`. The `<legend>` should then get `<abbr class="slds-required" title="required">*</abbr>` added to the DOM for visual indication that the checkbox group is required.

As SLDS checkboxes rely on the `:checked` pseudo selector, and the indeterminate state is only accessible via JavaScript, the use of a CSS class on the input will be necessary to implement this in SLDS. Use JavaScript to add the class when the indeterminate property is set to true on the input.

Expand Down
2 changes: 1 addition & 1 deletion ui/components/radio-group/docs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Groups of radio buttons should be marked up using the fieldset and legend elemen

Custom radio buttons are created by applying the `.slds-radio` class to a `<label>` element. To remain accessible to all user agents, place an `<input>` with `type="radio"` inside the `<label>` element. The `<input>` is then visually hidden, and the styling is placed on a span with the `.slds-radio_faux` class. The styling of the span changes based on whether the radio button is selected or focused by using a pseudo-element. A second span with `.slds-form-element__label` contains the label text.

When a radio group is required, the `<fieldset>` should receive the class `.slds-is-required`. The `<legend>` should then get `<abbr class="required" title="required">*</abbr>` added to the DOM for visual indication that the radio group is required.
When a radio group is required, the `<fieldset>` should receive the class `.slds-is-required`. The `<legend>` should then get `<abbr class="slds-required" title="required">*</abbr>` added to the DOM for visual indication that the radio group is required.

When disabling a radio button, either the entire group must be disabled or if only some radio buttons are disabled, then the checked radio button cannot be disabled.

Expand Down