Skip to main content

Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

Nav Hover Pseudo-element Test

Tests the Firefox bug where &::after:hover doesn't fire but &:hover::after does. This affects USWDS nav accordion expand/collapse icons.

Firefox issue: The USWDS nav SCSS uses &::after:hover { background-color: ... } to change the accordion icon color on hover. Per CSS spec, :hover on ::after pseudo-elements is unreliable in Firefox. The fix is &:hover::after { ... }.

Test: Accordion Expand Icons

Hover over these buttons. The expand icon (::after pseudo-element) should change color on hover in both Chrome and Firefox.

Side-by-side comparison

Two buttons with different CSS approaches. In Firefox, only the right one should change the icon color on hover.

Buggy: &::after:hover

Fixed: &:hover::after

Expected behavior

Icon hover behavior by browser
Selector Chrome Firefox
&::after:hover Icon changes color Icon does NOT change color
&:hover::after Icon changes color Icon changes color

agency.gov

An official website of the Agency

Looking for U.S. government information and services?
Visit USA.gov