-
-
Notifications
You must be signed in to change notification settings - Fork 842
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
[A11Y] Replace invalid link elements with buttons #3021
Changes from 4 commits
4eb1928
8d7ca41
fb98050
11a827f
b614373
2e57891
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ import app from '../../forum/app'; | |
import Component from '../../common/Component'; | ||
import humanTime from '../../common/helpers/humanTime'; | ||
import fullTime from '../../common/helpers/fullTime'; | ||
import Button from '../../common/components/Button'; | ||
|
||
/** | ||
* The `PostMeta` component displays the time of a post, and when clicked, shows | ||
|
@@ -29,9 +30,9 @@ export default class PostMeta extends Component { | |
|
||
return ( | ||
<div className="Dropdown PostMeta"> | ||
<a className="Dropdown-toggle" onclick={selectPermalink} data-toggle="dropdown"> | ||
<Button className="Button Button--reset Dropdown-toggle" onclick={selectPermalink} data-toggle="dropdown"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the timestamp looks colored at all times, can we instead use |
||
{humanTime(time)} | ||
</a> | ||
</Button> | ||
|
||
<div className="Dropdown-menu dropdown-menu"> | ||
<span className="PostMeta-number">{app.translator.trans('core.forum.post.number_tooltip', { number: post.number() })}</span>{' '} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,7 +63,8 @@ | |
&:active, | ||
&.active, | ||
.open > &.Dropdown-toggle { | ||
.box-shadow(inset 0 3px 5px rgba(0, 0, 0, .125)); | ||
box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); | ||
outline: none; | ||
} | ||
|
||
&.disabled, | ||
|
@@ -117,7 +118,6 @@ | |
} | ||
} | ||
|
||
|
||
.Button--square { | ||
padding-left: 9px; | ||
padding-right: 9px; | ||
|
@@ -130,16 +130,33 @@ | |
border-radius: 18px; | ||
} | ||
.Button--link { | ||
background: transparent !important; | ||
color: @control-color; | ||
background: none; | ||
davwheat marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
&:hover { | ||
background: transparent !important; | ||
&:active, | ||
&:hover, | ||
&:focus { | ||
color: @link-color; | ||
box-shadow: none; | ||
background: none; | ||
davwheat marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} | ||
.Button--reset { | ||
padding: 0; | ||
margin: 0; | ||
display: inline; | ||
text-align: unset; | ||
color: @link-color; | ||
background: none; | ||
vertical-align: unset; | ||
white-space: unset; | ||
line-height: unset; | ||
.user-select(auto); | ||
width: auto !important; | ||
|
||
&:active, | ||
&.active, | ||
&:hover, | ||
&:focus, | ||
&.focus, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Won't moving these styles from --link to --reset be breaking if the button doesn't update to use --reset with a dropdown toggle? Is it a big deal? |
||
.open > &.Dropdown-toggle { | ||
background: transparent !important; | ||
box-shadow: none; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these look weird as well, colored with no effect on hover, the underline hovering effect of the link was nice.
perhaps we should add a new
Button--textlink
that would mimic an exact link?