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

Chore: Minor tweaks to the header, make sure that external links open in a new tab #101

Merged
merged 1 commit into from
Jan 3, 2025
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
37 changes: 19 additions & 18 deletions docs/assets/stylesheet/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,7 @@
margin-inline: auto;
padding: 0 16px;
}
.md-header > .md-grid > .md-header__source {
width: var(--source-width);
margin-left: 0.5rem;
display: flex;
flex-direction: column;
justify-content: center;
}

.md-header > .md-grid > .md-header__source .md-icon,
.md-header > .md-grid > .md-header__source .md-icon:focus,
.md-header > .md-grid > .md-header__source .md-icon:active,
Expand Down Expand Up @@ -247,10 +241,18 @@ body::before {
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
background-color: rgba(0, 0, 0, 0.4);
z-index: -1;
}

.md-header__source {
width: var(--source-width);
margin-left: 0.5rem;
display: flex;
flex-direction: column;
justify-content: center;
}

.md-tabs {
background-color: var(--esi-input);
}
Expand Down Expand Up @@ -552,8 +554,14 @@ body::before {
display: none;
}

.esi-min-placeholder {
width: 30px;
.esi-source {
width: 0;
margin: 0;
padding: 0;
}

.esi-source > * {
display: none;
}

.esi-nav-container {
Expand All @@ -565,10 +573,6 @@ body::before {
display: none !important;
}

.esi-nav-container > .md-header__source {
display: none;
}

.esi-nav-container > .md-logo {
display: flex;
}
Expand Down Expand Up @@ -614,9 +618,6 @@ body::before {


@media screen and (min-width: 60em) {
.esi-sidebar {
height: auto;
}
.esi-sidebar .md-nav {
margin-bottom: 0;
}
Expand All @@ -635,7 +636,7 @@ body::before {
}
[dir=ltr] .md-nav--integrated>.md-nav__list>.md-nav__item--active .md-nav--secondary {
border-left: 0px;
padding-left: 8px;
padding-left: 16px;
}
[data-md-toggle=search]:checked~.md-header .md-search__input+.md-search__icon {
color: var(--esi-accent);
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ plugins:
- search
- social
- tags
- open-in-new-tab
- privacy:
assets: false
- macros:
Expand Down
6 changes: 3 additions & 3 deletions overrides/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
".icons/" ~ icon ~ ".svg" %}
</label>



<!-- Link to home -->
<a
href="{{ config.extra.homepage | d(nav.homepage.url, true) | url }}"
Expand Down Expand Up @@ -61,10 +63,8 @@

<!-- Repository information -->
{% if config.repo_url %}
<div class="md-header__source">{% include "partials/source.html" %}</div>
<div class="md-header__source esi-source">{% include "partials/source.html" %}</div>
{% endif %}

<div class="esi-min-placeholder"></div>
</nav>

<!-- Navigation tabs (sticky) -->
Expand Down
16 changes: 16 additions & 0 deletions overrides/partials/source.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!-- Repository information -->
<a
href="{{ config.repo_url }}"
title="{{ lang.t('source') }}"
class="md-source"
data-md-component="source"
target="_blank"
>
<div class="md-source__icon md-icon">
{% set icon = config.theme.icon.repo or "fontawesome/brands/git-alt" %}
{% include ".icons/" ~ icon ~ ".svg" %}
</div>
<div class="md-source__repository">
{{ config.repo_name }}
</div>
</a>
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ mkdocs-macros-plugin==1.3.7
mkdocs-material==9.5.49
mkdocs-material[imaging]==9.5.49
mkdocs-material-extensions==1.3.1
mkdocs-open-in-new-tab==1.0.8
pymdown-extensions==10.13
Loading