Skip to content

Commit

Permalink
Minor improvements to the groups page
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Brosset committed Jul 12, 2024
1 parent 3d8f1fb commit 1416edd
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 27 deletions.
17 changes: 8 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Visualize web features",
"devDependencies": {
"@11ty/eleventy": "^2.0.1",
"@mdn/browser-compat-data": "^5.5.38",
"@mdn/browser-compat-data": "^5.5.39",
"web-features": "next"
},
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions site/_includes/layout.njk
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<li><a href="/nobaseline">Not yet available</a></li>
<li><a href="/missingone">Missing in just one engine</a></li>
<li><a href="/all">All features</a></li>
<li><a href="/groups">Groups</a></li>
<li><a href="/monthly">Monthly updates</a></li>
</ul>
</nav>
Expand Down
15 changes: 13 additions & 2 deletions site/assets/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -312,12 +312,23 @@ nav li {
background: none;
}

.groups li {
padding: .25rem;
}

.groups li li {
margin-inline-start: 2rem;
}

.groups .group {
border-inline-start: 1px solid;
.groups summary {
cursor: pointer;
}

.groups details[open] {
background-image: linear-gradient(to right, black 1px, transparent 0);
background-position: .3rem 1rem;
background-size: 100% calc(100% - 1rem);
background-repeat: no-repeat;
}

footer {
Expand Down
43 changes: 28 additions & 15 deletions site/groups.njk
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,25 @@ layout: layout.njk

{% macro groupMacro(id, group, allGroups) %}
<li class="group" id="{{ id }}">
<p><strong>{{ group.name }}</strong></p>
<ul class="children-groups">
{% for id2, group2 in allGroups %}
{% if group2.parent === id %}
{{ groupMacro(id2, group2, allGroups) }}
{% endif %}
{% endfor %}
</ul>
<ul class="features">
{% for feature in allFeatures %}
{% if feature.group.includes(id) %}
<li>{{ feature.name }}</li>
{% endif %}
{% endfor %}
</ul>
<details>
<summary>{{ group.name }}</summary>
<ul class="children-groups">
{% for id2, group2 in allGroups %}
{% if group2.parent === id %}
{{ groupMacro(id2, group2, allGroups) }}
{% endif %}
{% endfor %}
</ul>
<ul class="features">
{% for feature in allFeatures %}
{% if feature.group.includes(id) %}
<li>
<a href="/features/{{ feature.id | slugify }}/">{{ feature.name }}</a>
</li>
{% endif %}
{% endfor %}
</ul>
</details>
</li>
{% endmacro %}

Expand All @@ -32,3 +36,12 @@ layout: layout.njk
{% endif %}
{% endfor %}
</ul>

<h2>Ungrouped features</h2>
<ul class="features">
{% for feature in allFeatures %}
{% if feature.group.length === 0 %}
<li>{{ feature.name }}</li>
{% endif %}
{% endfor %}
</ul>

0 comments on commit 1416edd

Please sign in to comment.