Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New pill in user doc #303

Merged
merged 4 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -605,3 +605,7 @@ div.path {
.path p.description {
color: var(--ibexa-dusk-black);
}

[hidden] {
display: none !important;
}
7 changes: 7 additions & 0 deletions docs/css/navigation.css
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,13 @@
padding-bottom: 0.5rem;
}

.md-nav__link .pill.new {
margin-right: 15px;
background-color: #d9e8ff;
color: #3562a0;
text-transform: lowercase;
}

.md-nav__link::after {
font-weight: 700;
}
Expand Down
1 change: 1 addition & 0 deletions docs/ibexa_engage/ibexa_engage.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
description: Ibexa Engage helps engage audiences and collect valuable data by using interactive content.
month_change: true
---

# Ibexa Engage
Expand Down
3 changes: 3 additions & 0 deletions docs/js/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,7 @@ $(document).ready(function() {
document.location.hash = event.target.hash;
}, 500);
});

// Mark higher-level nodes with "New" pill, not only the actual item
$(".pill.new:not([hidden])").parents(".md-nav__item").children('label').children(".pill.new[hidden]").removeAttr('hidden');
});
6 changes: 4 additions & 2 deletions theme/partials/nav-item.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{% set checked = "checked" if nav_item.active %}
<input class="md-nav__toggle md-toggle" data-md-toggle="{{ path }}" type="checkbox" id="{{ path }}" {{ checked }}>
<label class="md-nav__link level-{{ level }}" for="{{ path }}">
{{ nav_item.title }}
{{ nav_item.title }} <span class="pill new" hidden>New</span>
</label>
<nav class="md-nav" aria-label="{{ nav_item.title }}" data-md-level="{{ level }}">
<label class="md-nav__link-title md-nav__link level-{{ level }}" for="{{ path }}">
Expand All @@ -16,7 +16,7 @@
<ul class="md-nav__list" data-md-scrollfix>
{% set base = path %}
{% for nav_item in nav_item.children %}
{% set path = base ~ "-" ~ loop.index %}
{% set path = base ~ "-" ~ loop.index %}
{% set level = level + 1 %}
{% include "partials/nav-item.html" %}
{% endfor %}
Expand All @@ -37,6 +37,7 @@
{% endif %}
<a href="{{ nav_item.url | url }}" class="md-nav__link level-{{ level }} md-nav__link--active">
{{ nav_item.title }}
{% if nav_item.meta.month_change %}<span class="pill new">New</span>{% endif %}
</a>
{% if toc | first is defined %}
{% include "partials/toc.html" %}
Expand All @@ -46,6 +47,7 @@
<li class="{{ class }}">
<a href="{{ nav_item.url | url }}" class="md-nav__link level-{{ level }}">
{{ nav_item.title }}
{% if nav_item.meta.month_change %}<span class="pill new">New</span>{% endif %}
</a>
</li>
{% endif %}
Loading