Skip to content

Commit b25d829

Browse files
committed
fix hover
1 parent 5add0c7 commit b25d829

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

src/plugins/global-settings/color-schemes/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ public function generate_css_rules( $scheme, $mode = '' ) {
426426
}
427427

428428
$inherited_value = $this->get_inherited_value( $scheme[ $property ], $state, $mode );
429-
if ( $state === 'desktopHover' && ! $this->has_value( $scheme, $property, $state ) ) {
429+
if ( $state === 'desktopHover' && ! $this->has_value( $scheme, $property, $state ) && $mode === 'container' ) {
430430
$decls[ $state ][ $css_property ] = $inherited_value;
431431
}
432432

src/plugins/global-settings/color-schemes/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export const getCSS = ( scheme, currentHoverState = 'normal', mode = '' ) => {
9898
decls.desktopHover.push( `${ customProperty }-parent-hover: ${ inheritedValue };` )
9999
}
100100

101-
if ( state === 'desktopHover' && ! scheme[ property ]?.[ state ] && inheritedValue ) {
101+
if ( state === 'desktopHover' && ! scheme[ property ]?.[ state ] && inheritedValue && mode === 'container' ) {
102102
decls[ state ].push( `${ customProperty }${ suffix }: ${ inheritedValue };` )
103103
}
104104

src/styles/block-design-system-blocks.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,11 +238,16 @@ body:not(.wp-admin) .stk-block-columns:has(> .stk-block-content > .stk-block-col
238238
}
239239
}
240240
// Inherit parent-hover/normal state colors when hovering over a block.
241-
:where(.stk-hover-parent:hover) .stk-block-background {
241+
.stk-block-background {
242242
#{ '--stk-button-background-color-hover' }: var(--stk-button-background-color);
243243
#{ '--stk-button-text-color-hover' }: var(--stk-button-text-color);
244244
#{ '--stk-button-outline-color-hover' }: var(--stk-button-outline-color);
245245
}
246+
// :where(.stk-hover-parent:hover) .stk-block-background {
247+
// #{ '--stk-button-background-color-hover' }: var(--stk-button-background-color);
248+
// #{ '--stk-button-text-color-hover' }: var(--stk-button-text-color);
249+
// #{ '--stk-button-outline-color-hover' }: var(--stk-button-outline-color);
250+
// }
246251

247252
// Images
248253
.stk-img-wrapper {

0 commit comments

Comments
 (0)