Skip to content

Commit

Permalink
Select font size of submenu2 entries depending on item count.
Browse files Browse the repository at this point in the history
  • Loading branch information
splattater committed Feb 12, 2024
1 parent e767dbb commit 8223ecf
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion _includes/components/menu_sub2.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,17 @@

{% assign current_page = page.rdf.render_path | relativize_url %}
{% assign menu = menuResource | rdf_container %}
{%- if menu.size <= 6 -%}
{%- assign fontSize = 100 -%}
{%- elsif menu.size == 7 -%}
{% assign fontSize = 90 -%}
{%- elsif menu.size == 8 -%}
{% assign fontSize = 80 -%}
{%- else -%}
{%- assign fontSize = 70 -%}
{%- endif -%}

<nav class="nav-sub2" aria-label="{{ str_sub2_menu }}">
<nav class="nav-sub2" aria-label="{{ str_sub2_menu }}" style="font-size:{{ fontSize }}%;">
<ul>
{% for entry in menu %}
{% assign label = nil %}
Expand Down

0 comments on commit 8223ecf

Please sign in to comment.