Rivet 2.6.0 adds gap styles to buttons to create space between elements within a single button, such as the text label and an icon.
However, some buttons have visually hidden text to help people using assistive technologies better understand what a button does. An example of this is the "Copy" button that appears on code snippets on the Rivet website, which have markup like shown below:
The buttons renders the space between "Copy" and the span element, even though the span element is not visible, resulting in extra spacing on the button's right side.
Expected behavior
The button styles should not apply a gap between visible button text and screen reader-only button text.
Potential workaround
Wrapping the entire text of the example button above in a span solves the issue:
If a CSS solution isn't possible, it might be sufficient to tell people to wrap the entire button text in a span in situations where part of the text is hidden. Thoughts?
Describe the bug
Rivet
2.6.0
addsgap
styles to buttons to create space between elements within a single button, such as the text label and an icon.However, some buttons have visually hidden text to help people using assistive technologies better understand what a button does. An example of this is the "Copy" button that appears on code snippets on the Rivet website, which have markup like shown below:
The buttons renders the space between "Copy" and the
span
element, even though thespan
element is not visible, resulting in extra spacing on the button's right side.Expected behavior
The button styles should not apply a gap between visible button text and screen reader-only button text.
Potential workaround
Wrapping the entire text of the example button above in a
span
solves the issue:If a CSS solution isn't possible, it might be sufficient to tell people to wrap the entire button text in a
span
in situations where part of the text is hidden. Thoughts?Relevant context (required)