-
Notifications
You must be signed in to change notification settings - Fork 18
Description
Hi,
First of all, thanks for creating Bahunya — I really like its minimal and elegant approach.
However, I’ve run into a limitation with the rule targeting the site navigation:
body nav:first-of-type { ... }
This selector assumes that the first <nav>
element in the document is the main site navigation.
Unfortunately, this becomes problematic as soon as you introduce other <nav>
elements elsewhere — for example, pagination, article navigation, or table of contents.
Because :first-of-type
applies within each parent, not globally within the document, every first <nav>
inside a container (e.g. <main>
, <aside>
) also matches this rule.
As a result, styling leaks to other navs unintentionally.
💡 Suggested improvement
It would be more robust to target the main navigation explicitly, for example: header > nav
.
This keeps the classless nature of Bahunya but avoids false positives.
Thanks again for this lovely project — it’s small details like this that can make classless CSS even more versatile!