Skip to content

Commit

Permalink
Adds the hover customisation to the GS UI as duplication of link color
Browse files Browse the repository at this point in the history
  • Loading branch information
draganescu committed Jun 6, 2022
1 parent 9ee5def commit 7aa2397
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
useStyle,
useColorsPerOrigin,
} from './hooks';
import Subtitle from './subtitle';

function ScreenLinkColor( { name } ) {
const supports = getSupportedGlobalStylesPanels( name );
Expand All @@ -39,6 +40,16 @@ function ScreenLinkColor( { name } ) {
'user'
);

const [ linkHoverColor, setLinkHoverColor ] = useStyle(
'elements.link:hover.color.text',
name
);
const [ userLinkHoverColor ] = useStyle(
'elements.link:hover.color.text',
name,
'user'
);

if ( ! hasLinkColor ) {
return null;
}
Expand All @@ -51,6 +62,7 @@ function ScreenLinkColor( { name } ) {
'Set the default color used for links across the site.'
) }
/>
<Subtitle>{ __( 'General' ) }</Subtitle>
<ColorGradientControl
className="edit-site-screen-link-color__control"
colors={ colorsPerOrigin }
Expand All @@ -63,6 +75,19 @@ function ScreenLinkColor( { name } ) {
onColorChange={ setLinkColor }
clearable={ linkColor === userLinkColor }
/>
<Subtitle>{ __( 'Hover' ) }</Subtitle>
<ColorGradientControl
className="edit-site-screen-link-color__control"
colors={ colorsPerOrigin }
disableCustomColors={ ! areCustomSolidsEnabled }
__experimentalHasMultipleOrigins
showTitle={ false }
enableAlpha
__experimentalIsRenderedInSidebar
colorValue={ linkHoverColor }
onColorChange={ setLinkHoverColor }
clearable={ linkColor === userLinkHoverColor }
/>
</>
);
}
Expand Down

0 comments on commit 7aa2397

Please sign in to comment.