-
Notifications
You must be signed in to change notification settings - Fork 5
feat(form elements): provide possibility to visually hide the label #628
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
Merged
mfranzke
merged 14 commits into
main
from
585-form-elements-provide-possibility-to-visually-hide-the-label
Dec 15, 2023
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
577de5c
feat: provide general styling for visually hidden labels
mfranzke 2845f06
docs: typo
mfranzke ae9b054
feat: provided the possibility for all forms to visually hide the label
mfranzke 44283a1
feat: provided the possibility for all forms to visually hide the label
mfranzke a0b5b08
Merge branch 'main' into 585-form-elements-provide-possibility-to-vis…
mfranzke 6902c42
Update _form-elements.scss
mfranzke e2918c5
Merge branch 'main' into 585-form-elements-provide-possibility-to-vis…
mfranzke 7690d9c
refactor: added missing references
mfranzke c184ecf
Merge branch 'main' into 585-form-elements-provide-possibility-to-vis…
mfranzke a9ce252
refactor: not providing an empty option on hidden label
mfranzke 738b968
Merge branch 'main' into 585-form-elements-provide-possibility-to-vis…
mfranzke a16a4ac
Merge branch 'main' into 585-form-elements-provide-possibility-to-vis…
mfranzke ef377f2
Merge branch 'main' into 585-form-elements-provide-possibility-to-vis…
annsch f2899c0
Merge branch 'main' into 585-form-elements-provide-possibility-to-vis…
annsch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
source/_patterns/01-elements/checkbox/checkbox~label-hidden.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"id": "checkbox05", | ||
"labelHidden": true | ||
} |
11 changes: 11 additions & 0 deletions
11
source/_patterns/01-elements/checkbox/checkbox~label-hidden.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
title: Checkbox - Hidden label | ||
--- | ||
|
||
## Possibility to hide the label | ||
|
||
> A label for a form control helps everyone better understand its purpose. In some cases, the purpose may be clear enough from the context when the content is rendered visually. The label can be hidden visually, though it still needs to be provided within the code to support other forms of presentation and interaction, such as for screen reader and speech input users. | ||
|
||
source: <https://www.w3.org/WAI/tutorials/forms/labels/#hiding-label-text> | ||
|
||
You could set the attribute `data-label-hidden="true"` for the rare case that you would want to visually hide the textual label for a checkbox element. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"id": "input20", | ||
"labelHidden": "true" | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
title: Input - Hidden label | ||
state: complete | ||
order: 11 | ||
--- | ||
|
||
## Possibility to hide the label | ||
|
||
> A label for a form control helps everyone better understand its purpose. In some cases, the purpose may be clear enough from the context when the content is rendered visually. The label can be hidden visually, though it still needs to be provided within the code to support other forms of presentation and interaction, such as for screen reader and speech input users. | ||
|
||
source: <https://www.w3.org/WAI/tutorials/forms/labels/#hiding-label-text> | ||
|
||
You could set the attribute `data-label-hidden="true"` for the rare case that you would want to visually hide the textual label for a input element. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{{#each radios }} | ||
{{> elements-radio disabled=../disabled invalid=../invalid required=../required id=(unique-id) name=../name }}<br> | ||
{{> elements-radio disabled=../disabled invalid=../invalid required=../required id=(unique-id) name=../name labelHidden=../labelHidden }}<br> | ||
{{/each }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"name": "radioLabelHidden", | ||
"labelHidden": true | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
title: Radio - Hidden label | ||
--- | ||
|
||
## Possibility to hide the label | ||
|
||
> A label for a form control helps everyone better understand its purpose. In some cases, the purpose may be clear enough from the context when the content is rendered visually. The label can be hidden visually, though it still needs to be provided within the code to support other forms of presentation and interaction, such as for screen reader and speech input users. | ||
|
||
source: <https://www.w3.org/WAI/tutorials/forms/labels/#hiding-label-text> | ||
|
||
You could set the attribute `data-label-hidden="true"` for the rare case that you would want to visually hide the textual label for a radio element. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"id": "select14", | ||
"label": "Devices", | ||
"labelHidden": "true" | ||
} |
13 changes: 13 additions & 0 deletions
13
source/_patterns/01-elements/select/select~hidden-label.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
title: Select - Hidden label | ||
state: complete | ||
order: 8 | ||
--- | ||
|
||
## Possibility to hide the label | ||
|
||
> A label for a form control helps everyone better understand its purpose. In some cases, the purpose may be clear enough from the context when the content is rendered visually. The label can be hidden visually, though it still needs to be provided within the code to support other forms of presentation and interaction, such as for screen reader and speech input users. | ||
|
||
source: <https://www.w3.org/WAI/tutorials/forms/labels/#hiding-label-text> | ||
|
||
You could set the attribute `data-label-hidden="true"` for the rare case that you would want to visually hide the textual label for a select element. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
source/_patterns/01-elements/textarea/textarea~hidden-label.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"id": "textarea08", | ||
"value": "Input", | ||
"labelHidden": "true" | ||
} |
13 changes: 13 additions & 0 deletions
13
source/_patterns/01-elements/textarea/textarea~hidden-label.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
title: Textarea - Hidden label | ||
state: complete | ||
order: 8 | ||
--- | ||
|
||
## Possibility to hide the label | ||
|
||
> A label for a form control helps everyone better understand its purpose. In some cases, the purpose may be clear enough from the context when the content is rendered visually. The label can be hidden visually, though it still needs to be provided within the code to support other forms of presentation and interaction, such as for screen reader and speech input users. | ||
|
||
source: <https://www.w3.org/WAI/tutorials/forms/labels/#hiding-label-text> | ||
|
||
You could set the attribute `data-label-hidden="true"` for the rare case that you would want to visually hide the textual label for a textarea element. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.