Make WordPress Core

Changeset 62897


Ignore:
Timestamp:
07/29/2026 01:45:33 PM (2 months ago)
Author:
joedolson
Message:

Administration: Lower specificity of hover and focus states on disabled tooltips.

Core tooltips can accept an existing button as an argument. When applying to an existing button, they should use the existing focus and hover states of that button. The styles for tooltips on disabled controls had higher specificity than the styles for active controls.

Lower the specificity of the styles applied to disabled buttons with tooltips to avoid overriding existing styles. Follow up to [62816].

Developed in ​https://github.com/WordPress/wordpress-develop/pull/12712

Props wildworks, khokansardar, mirmpro, joedolson.
Fixes #65727.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/css/wp-tooltip.css

    r62816 r62897  
    2929}
    3030
    31 .wp-tooltip:not(:has(button[aria-disabled="true"],button[disabled])) .wp-tooltip__toggle:focus,
     31/*
     32 * `:where()` keeps the wrapper out of the specificity total, so buttons
     33 * passed into a tooltip keep control of their own focus ring.
     34 */
     35:where(.wp-tooltip:not(:has(button[aria-disabled="true"],button[disabled]))) .wp-tooltip__toggle:focus,
    3236.wp-tooltip .wp-tooltip__close:focus {
    3337        outline: 2px solid transparent;
Note: See TracChangeset for help on using the changeset viewer.