Allow role=button to any HTML element

This commit is contained in:
Lucas Larroche 2022-01-16 11:41:50 +07:00
parent 7c424e8e01
commit 270a128de4
17 changed files with 95 additions and 89 deletions

View file

@ -879,7 +879,7 @@ button {
margin-bottom: var(--spacing);
}
a[role=button] {
[role=button] {
display: inline-block;
text-decoration: none;
}
@ -888,7 +888,7 @@ button,
input[type=submit],
input[type=button],
input[type=reset],
a[role=button] {
[role=button] {
--background-color: var(--primary);
--border-color: var(--primary);
--color: var(--primary-inverse);
@ -917,9 +917,10 @@ input[type=button]:focus,
input[type=reset]:hover,
input[type=reset]:active,
input[type=reset]:focus,
a[role=button]:hover,
a[role=button]:active,
a[role=button]:focus {
[role=button]:hover,
[role=button]:active,
[role=button]:focus {
--color: var(--primary-inverse);
--background-color: var(--primary-hover);
--border-color: var(--primary-hover);
--box-shadow: var(--button-hover-box-shadow, 0 0 0 rgba(0, 0, 0, 0));
@ -928,7 +929,7 @@ button:focus,
input[type=submit]:focus,
input[type=button]:focus,
input[type=reset]:focus,
a[role=button]:focus {
[role=button]:focus {
--box-shadow: var(--button-hover-box-shadow, 0 0 0 rgba(0, 0, 0, 0)),
0 0 0 var(--outline-width) var(--primary-focus);
}
@ -953,7 +954,7 @@ input[type=submit][disabled],
input[type=button][disabled],
input[type=reset][disabled],
a[role=button]:not([href]),
a[role=button][disabled] {
[role=button][disabled] {
opacity: 0.5;
pointer-events: none;
}