Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/css/manage/_cloud-community.scss
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,25 @@

.cloud-snippet {
padding: 24px;

.cloud-snippet-title-button {
display: inline;
margin: 0;
padding: 0;
border: none;
background: none;
font: inherit;
color: #2271b1;
cursor: pointer;
text-align: start;
text-decoration: underline;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you say about, no underline by default, but only when hover or focus?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Underlining links is a primary accessibility best practice because it ensures that color is not the only way to identify interactive text.

While the Web Content Accessibility Guidelines (WCAG) do not strictly mandate underlines, they do require that links be visually distinguishable from surrounding text.

I prefer to keep the underline on the link.


&:focus-visible {
outline: 2px solid #2271b1;
outline-offset: 2px;
border-radius: 2px;
}
}
}

.cloud-snippet-meta {
Expand Down
10 changes: 5 additions & 5 deletions src/js/components/ManageMenu/CommunityCloud/SearchResults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ interface CloudSnippetDetailsProps {
const CloudSnippetDetails: React.FC<CloudSnippetDetailsProps> = ({ snippet, setIsPreviewOpen }) =>
<div className="cloud-snippet">
<h3>
<a
href="#"
<button
type="button"
className="cloud-snippet-title-button"
title={__('Preview this snippet', 'code-snippets')}
onClick={event => {
event.preventDefault()
onClick={() => {
setIsPreviewOpen(true)
}}
>
{snippet.name}
</a>
</button>
</h3>

<div className="cloud-snippet-meta">
Expand Down
Loading