Get number of child pages for menu styling

Hello, first post here!
I’ve been experimenting Grav for some weeks and I love it! Modular pages are a stunning feature so is its speed.
That said, I ended up trying to create a theme fitting my needs.
I’m not completely new to web programming however my (limited) experience has been paused for the last ten years and a lot has happened. I primarly worked with PHP + CSS 2 and a little bit of jQuery.
I decided to start with the minimal Pure CSS framework, here’s the first issue: how do I output in HTML the number of pages of the menu? This is needed in order to use Pure’s Grid System i nnavigation menu.
I tried children.count() but it doesn’t seem to fit this case. Or maybe I’m using it the wrong way.
Thank you!

@phmg701, Welcome to the forum!

I wonder what you need the count for as the ‘Pure’ theme uses a <ul> for its menu-items.

Anyway, to get the count of visible root pages, try: pages.children.visible.count
And to get the count of visible children of the current page: page.children.visible.count

Have a look at the docs on Theme Variables where the Page and Pages object are mentioned.

Thank you, this just works!
My aim is to build a photo gallery based off PureCSS grids and those variables will be useful.
But I’m still far from this point, I’m struggling with navigation menu :sweat_smile:
I’m also trying to understand how the Docs work as I’m not that used to such schemes (coming from WordPress Codex).
Thank you!