Skip to content
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

Site list: match hover styling from core usage #96901

Open
wants to merge 6 commits into
base: trunk
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ const SiteField = ( { site, openSitePreviewPane }: Props ) => {
<SiteListTile
contentClassName={ clsx(
'sites-dataviews__site-name',
site.is_deleted && 'sites-dataviews__site-name--deleted',
css`
min-width: 0;
text-align: start;
Expand Down
10 changes: 9 additions & 1 deletion client/sites/components/sites-dataviews/site-icon.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import clsx from 'clsx';
import { translate } from 'i18n-calypso';
import * as React from 'react';
import SiteFavicon from 'calypso/a8c-for-agencies/components/items-dashboard/site-favicon';
Expand Down Expand Up @@ -53,7 +54,14 @@ export default function SiteIcon( {
const siteTitle = isMigrationPending ? translate( 'Incoming Migration' ) : site.title;

return (
<ThumbnailLink title={ siteTitle } onClick={ onClick } className="sites-dataviews__site-icon">
<ThumbnailLink
title={ siteTitle }
onClick={ onClick }
className={ clsx(
'sites-dataviews__site-icon',
site.is_deleted && 'sites-dataviews__site-icon--deleted'
) }
>
<SiteFavicon
className="sites-site-favicon"
blogId={ site.ID }
Expand Down
32 changes: 21 additions & 11 deletions client/sites/components/sites-dataviews/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,14 @@
overflow: hidden;
padding-bottom: 0;

// TODO: DataViews adds .is-hovered to row/li's when hovering over them, we're targeting that
// to style the site name with a blue color to match core page list view. We need to target
// the row hover as the .sites-dataviews__site button doesn't cover the whole cell.
// At some point, this may be able to be cleaned up via a new onClick handler for primary fields,
// see https://github.com/WordPress/gutenberg/issues/67391#issuecomment-2506037360
.is-hovered {
.sites-dataviews__site {
display: flex;
flex-direction: row;
padding: 0;
overflow: hidden;
cursor: pointer;

&:not(:disabled) {
&:hover,
&:focus {
.sites-dataviews__site-name:not(.sites-dataviews__site-name--deleted) {
.sites-dataviews__site-title {
color: var(--color-accent);
}
Expand All @@ -25,9 +23,16 @@
}
}
}
}

&:disabled {
cursor: default;
.sites-dataviews__site {
display: flex;
flex-direction: row;
padding: 0;
overflow: hidden;
cursor: pointer;

.sites-dataviews__site-name--deleted {
.sites-dataviews__site-title {
color: var(--color-neutral-30);
}
Expand Down Expand Up @@ -73,6 +78,11 @@
.sites-dataviews__site-icon {
cursor: pointer;
padding: 0;

&.sites-dataviews__site-icon--deleted {
cursor: default;
filter: grayscale(100%);
}
}

.site-sort__clickable {
Expand Down