Skip to content

Strip all styling from <button> #4834

@dtdesign

Description

@dtdesign

The button element is incredibly versatile and benefits from good a11y when used correctly. However, the current default styling creates all sort of issues that makes <button> not feasible in most cases. The alternative is to resort to a[href="#"] with role="button" plus extra event listeners to handle the keyboard interaction.

  • Strip the default styling from <button>.
  • Disable the default appearance of buttons to make them easier to style.
  • Add the .button class to all elements that should continue to look like a button.
  • Convert a[href="#"] into <button>, this includes stripping extra keydown events that are no longer required.
  • Convert non-link buttons (*) into <button>.

(*) Non-link buttons are HTML constructs such as span.pointer that pretend to be buttons but do not fully behave like those.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions