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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

<uui-key> - Would <kbd> be more suitable? #52

Closed
leekelleher opened this issue Nov 10, 2021 · 3 comments
Closed

<uui-key> - Would <kbd> be more suitable? #52

leekelleher opened this issue Nov 10, 2021 · 3 comments

Comments

@leekelleher
Copy link
Member

leekelleher commented Nov 10, 2021

馃憢 Hello! I've been exploring the UI Library (Storybook), I'm liking it. Great work!

I'd like to get involved, but want to start small, so an easy question first. 馃槂

With the <uui-key> component, (source link), it appears to be presentational rather than functional.

Would the native <kbd> element be more suitable?

With the <uui-keyboard-shortcut> component, it'd be...

<uui-keyboard-shortcut>
  <kbd>CTRL</kbd> + <kbd>S</kbd>
</uui-keyboard-shortcut>
@leekelleher
Copy link
Member Author

It dawned on me that with using a custom components it can be styled, so the <uui-key> would have it's own styles applied to itself (and nothing else). (Apologies, this may be me getting my dinosaur brain up to speed with web-components). 馃檹

OK, then <uui-key> makes sense to me now. About the <kbd> element, I'm wondering if there are semantic benefits in using it within the component's markup?

@julczka
Copy link
Contributor

julczka commented Nov 11, 2021

Hi Lee!
Nice to meet you and I'm super happy that you like the UI Library.
It never even crossed my mind that there is a native element for that. HTML is really full of surprises 馃榿
I was thinking the same - if we use the native element we'd loose the benefit of scoped styles that custom elements provide.
I don't know if there are any accessibility benefits coming from using the native one but that would probably be the only factor to speak for using it instead of the our custom one. I'll take a look into it!

@leekelleher
Copy link
Member Author

Thanks @julczka, nice to meet you too. 馃憢

HTML is really full of surprises

Maybe my dinosaur brain might come in helpful. 馃馃馃槅

I don't know if there are any accessibility benefits coming from using the native one but that would probably be the only factor to speak for using it instead of the our custom one. I'll take a look into it!

I had a look too, <kbd> doesn't appear to have any special treatment in terms of accessibility.
ref: https://stackoverflow.com/questions/15190247/does-the-kbd-element-help-at-all-in-terms-of-accessibility

I'll close off this issue. 馃憤

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants