You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The :kbd: role doesn't mark container <kbd> elements with a CSS class, so they can be styled differently that child <kbd> elements representing actual keystrokes.
Now we have a problem here: there is no way to differentiate between the parent container <kbd> element and the child <kbd> element with CSS selectors! If we provide a CSS style to draw a border around a <kbd> element, so single keystrokes are displayed correctly, then in the second example we'd get a double border (borders around the child elements, and another border around the parent element).
If you want to have borders around single keystrokes, and only around the child <kbd> elements in compound keystrokes, as shown on the screenshot below, the only way is to differentiate the container and child <kbd> elements with a CSS class.
Expected behavior
Single keystrokes are fine as they are, no change needed:
For compound keystrokes, the container <kbd> element should be marked with a CSS class (e.g. compound) so it can be styled differently than the child <kbd> elements:
Quite agree, the outer <kbd> and inner <kbd> should be given different attributes for distinction. CSS has no way of selecting parent element so we are not able to determine whether a <kbd> element contains nested <kbd>.
With key combination and certain style for <kbd>, we get:
Describe the bug
The
:kbd:
role doesn't mark container<kbd>
elements with a CSS class, so they can be styled differently that child<kbd>
elements representing actual keystrokes.To Reproduce
For the below input
the following output is generated:
Now we have a problem here: there is no way to differentiate between the parent container
<kbd>
element and the child<kbd>
element with CSS selectors! If we provide a CSS style to draw a border around a<kbd>
element, so single keystrokes are displayed correctly, then in the second example we'd get a double border (borders around the child elements, and another border around the parent element).If you want to have borders around single keystrokes, and only around the child
<kbd>
elements in compound keystrokes, as shown on the screenshot below, the only way is to differentiate the container and child<kbd>
elements with a CSS class.Expected behavior
Single keystrokes are fine as they are, no change needed:
For compound keystrokes, the container
<kbd>
element should be marked with a CSS class (e.g.compound
) so it can be styled differently than the child<kbd>
elements:Environment info
The text was updated successfully, but these errors were encountered: