Skip to content
Christiane Celeste — home
All notes

1 min read

Gatsby JS: Highlighting the active page

How to highlight the active page in Gatsby JS

  • #GatsbyJS
  • #CSS
  • #short notes

In Gatsby, when a new page is selected in the navigation, the aria-current=‘page’ attribute is added to it.

This can be used to style the current active page as follows:

a[aria-current="page"] {
  color: green;
}