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

Use <button> for controls #7821

Open
Malvoz opened this issue Nov 28, 2021 · 5 comments
Open

Use <button> for controls #7821

Malvoz opened this issue Nov 28, 2021 · 5 comments
Labels
accessibility Anything related to ensuring no barriers exist that prevent interactions or information access breaking ux
Milestone

Comments

@Malvoz
Copy link
Member

Malvoz commented Nov 28, 2021

Is your feature request related to a problem? Please describe.

<button> behaves a bit differently from <a href="#" role="button">, this would supersede #7368 and #7369 (these describe some of the problems with <a> controls).

Describe the solution you'd like

Use <button type="button"> over <a href="#"> for controls.

Additional context

Use buttons, not links, for controls

Agreed!

Originally posted by @mourner in #3210 (comment).

we should use the button element here

This would be a breaking change we can make in Leaflet 2.

Originally posted by @jonkoops in #7368 (comment).

@Malvoz
Copy link
Member Author

Malvoz commented Nov 28, 2021

It may be desirable to use a CSS reset for buttons, something along the lines of:

.leaflet-control button {
  background-color: transparent;
  border: none;
  border-radius: 0;
  color: inherit;
  font: inherit;
  line-height: inherit;
  margin: 0;
  padding: 0;
  text-align: inherit;
  text-transform: none;
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
}

This is just a generic class I've been using before (inspired by normalize.css, sanitize.css, Boostrap's reboot.css), however if a default value is set for any of these properties for all controls, there's probably no reason to first reset that property.

@mourner mourner added the accessibility Anything related to ensuring no barriers exist that prevent interactions or information access label Nov 29, 2021
@Falke-Design
Copy link
Member

I only want to document this: We should not remove the existing css classes because they are used for many custom controls

@jonkoops
Copy link
Collaborator

I've created a label to keep track of breaking changes like these.

@Chi-teck

This comment was marked as off-topic.

@Malvoz

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility Anything related to ensuring no barriers exist that prevent interactions or information access breaking ux
Projects
None yet
Development

No branches or pull requests

5 participants