fix(button): increase click area to meet WCAG success criteria

This commit is contained in:
gvangeest 2021-12-15 11:10:45 +01:00
parent 1340c1bd61
commit be84466311
3 changed files with 10 additions and 4 deletions

View file

@ -0,0 +1,5 @@
---
'@lion/button': patch
---
Increase minimum click area to meet WCAG Success Criterion 2.5.5 Target Size (Enhanced)

View file

@ -23,6 +23,8 @@ export const disabled = () => html`<lion-button disabled>Disabled</lion-button>`
## Minimum click area ## Minimum click area
The minimum click area needs to be at least `44px` by `44px` according to [WCAG Success Criterion 2.5.5 Target Size (Enhanced)](https://www.w3.org/TR/WCAG22/#target-size-enhanced).
```js preview-story ```js preview-story
export const minimumClickArea = () => html` <style> export const minimumClickArea = () => html` <style>
.small { .small {

View file

@ -67,10 +67,9 @@ export class LionButton extends DisabledWithTabIndexMixin(LitElement) {
left: 50%; left: 50%;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
/* touch area (comes into play when button height goes below this one) */ /* Minimum click area to meet [WCAG Success Criterion 2.5.5 Target Size (Enhanced)](https://www.w3.org/TR/WCAG22/#target-size-enhanced) */
/* src = https://www.smashingmagazine.com/2012/02/finger-friendly-design-ideal-mobile-touchscreen-target-sizes/ */ min-height: 44px;
min-height: 40px; min-width: 44px;
min-width: 40px;
width: 100%; width: 100%;
height: 100%; height: 100%;
} }