You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make active tab/section distinguishable in navbar #1321
There are some things to work through here mostly what the definition of an active tab is (as tabs can target individual files, index pages in directories, sidebars, etc. and/or can have drop-down menus that target all of the same). I've built sites that use a simple directory prefix heuristic but Quarto sites will all vary considerably in their topology so it won't be that simple in most cases.
I'm pretty confident we can come up with an automated heuristic here but it will require some thought and tweaking to get right -- will work on this after the v1.0 release window.
In the default and cosmo themes (which is what generate from quarto create-website) there is no visual distinguisher for active however for many other themes there is.
I'm going to close this issue as the system appears to have correct logic for this state (we can then separately debate whether we want to override the bootstrap default for latched visual appearance -- I will say that in a couple of themes I tried it was very subtle, possibly because too heavy a treatment creates more visual noise on the navbar than people want). If it has potential to be overdone and somewhat a matter of taste/preference I'd be more inclined for this to be something resolved by themes/variables rather than a default we set.
Activity
jjallaire commentedon May 31, 2022
There are some things to work through here mostly what the definition of an active tab is (as tabs can target individual files, index pages in directories, sidebars, etc. and/or can have drop-down menus that target all of the same). I've built sites that use a simple directory prefix heuristic but Quarto sites will all vary considerably in their topology so it won't be that simple in most cases.
I'm pretty confident we can come up with an automated heuristic here but it will require some thought and tweaking to get right -- will work on this after the v1.0 release window.
jjallaire commentedon Aug 6, 2022
It looks like we do actually attempt to latch the active nav item here (which amount to adding the
activeclass as well assetting
aria-current=page):https://github.com/quarto-dev/quarto-cli/blob/main/src/project/types/website/website-navigation.ts#L405-L422
The visual appearance is in turn controlled by these variables:
https://github.com/quarto-dev/quarto-cli/blob/main/src/resources/formats/html/bootstrap/dist/scss/_nav.scss#L74-L79
In the default and cosmo themes (which is what generate from
quarto create-website) there is no visual distinguisher foractivehowever for many other themes there is.I'm going to close this issue as the system appears to have correct logic for this state (we can then separately debate whether we want to override the bootstrap default for latched visual appearance -- I will say that in a couple of themes I tried it was very subtle, possibly because too heavy a treatment creates more visual noise on the navbar than people want). If it has potential to be overdone and somewhat a matter of taste/preference I'd be more inclined for this to be something resolved by themes/variables rather than a default we set.
ecomodeller commentedon Nov 19, 2024
It seems like this feature is broken.
An example from the Quarto gallery is https://nbdev.fast.ai/tutorials/tutorial.html
In this example the
activeclass as well as thearia-currentattribute is set on the "Get started" anchor, instead of the "Tutorial".Is the path
../tutorials/tutorial.htmltoo complicated?This is confusing, any hints on a workaround on how to disable this?
In some themes it might not be visually apparent, but I suppose still a problem for accessibility, in some cases it is subtle:

Mkdocs material uses a more explicit approach to indicate the current tab
Example from FastAPI docs

mcanouil commentedon Nov 19, 2024
Please open a new issue following the issue template eventually referencing this one.
Thank you!
ecomodeller commentedon Nov 19, 2024
@mcanouil I have opened a new issue where I have tried to create a minimal reproducible example.
I suspect the sidebar is causing some issue, without the sidebar it works fine.