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

Fix CSS issues in small form-factor #37

Merged
merged 2 commits into from
Aug 10, 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 ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## [0.4.1] - 2024-08-10

- Fix various UI/CSS issues in small form factors.

## [0.4.0] - 2024-08-05

- Move `pygments_light_style` and `pygments_dark_style` options inside theme options (`html_theme_options`), as `pygments_dark_style` is no longer a valid config setting in `app.config` by Sphinx. Update docs accordingly.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sphinx-nefertiti",
"version": "0.4.0",
"version": "0.4.1",
"private": true,
"description": "Nefertiti is a theme for the Sphinx Documentation Generator.",
"engines": {
Expand Down
14 changes: 13 additions & 1 deletion scss/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ body {
display: grid;
grid-template-areas: "content toc";
grid-template-columns: minmax(570px, 5fr) minmax(190px, 1fr);
gap: 25px;
gap: 18px;
}

@include media-breakpoint-down(lg) {
Expand All @@ -51,6 +51,13 @@ body {
grid-template-columns: 100%;
max-width: 892px;
margin-inline: auto;
margin-top: 1.5rem;
}

@include media-breakpoint-down(sm) {
row-gap: 0;
column-gap: 18px;
margin-top: 0;
}
}

Expand All @@ -70,6 +77,11 @@ body {
max-width: 92%;
margin-inline: auto;
}

@include media-breakpoint-down(sm) {
max-width: 100%;
margin-top: 1.5rem;
}
}

.nftt-sidebar {
Expand Down
85 changes: 85 additions & 0 deletions scss/components/_admonitions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
border: 2px solid var(--#{$prefix}admon-tip-color-bg);
border-radius: $border-radius;

@include media-breakpoint-down(sm) {
margin: 2.5rem .6rem 2rem;
}

.added,
.versionmodified {
position: relative;
Expand All @@ -20,6 +24,12 @@
font-weight: $font-weight-bold;
color: var(--#{$prefix}body-hc-color);
background-color: var(--#{$prefix}admon-tip-color-bg);

@include media-breakpoint-down(sm) {
left: 0;
margin: -1rem 0;
border-radius: $border-radius;
}
}

> p:first-child {
Expand All @@ -34,6 +44,10 @@
border: 2px solid var(--#{$prefix}admon-caution-color-bg);
border-radius: $border-radius;

@include media-breakpoint-down(sm) {
margin: 2.5rem .6rem 2rem;
}

.changed,
.versionmodified {
position: relative;
Expand All @@ -47,6 +61,12 @@
font-weight: $font-weight-bold;
color: var(--#{$prefix}body-hc-color);
background-color: var(--#{$prefix}admon-caution-color-bg);

@include media-breakpoint-down(sm) {
left: 0;
margin: -1rem 0;
border-radius: $border-radius;
}
}

> p:first-child {
Expand All @@ -61,6 +81,10 @@ div.deprecated {
border: 2px solid var(--#{$prefix}admon-error-color-bg);
border-radius: $border-radius;

@include media-breakpoint-down(sm) {
margin: 2.5rem .6rem 2rem;
}

span.deprecated,
span.versionmodified {
position: relative;
Expand All @@ -74,6 +98,12 @@ div.deprecated {
font-weight: $font-weight-bold;
color: var(--#{$prefix}body-hc-color);
background-color: var(--#{$prefix}admon-error-color-bg);

@include media-breakpoint-down(sm) {
left: 0;
margin: -1rem 0;
border-radius: $border-radius;
}
}

> p:first-child {
Expand All @@ -88,6 +118,10 @@ div.versionremoved {
border: 2px solid var(--#{$prefix}admon-attention-color-bg);
border-radius: $border-radius;

@include media-breakpoint-down(sm) {
margin: 2.5rem .6rem 2rem;
}

span.removed,
span.versionmodified {
position: relative;
Expand All @@ -101,6 +135,12 @@ div.versionremoved {
font-weight: $font-weight-bold;
color: var(--#{$prefix}body-hc-color);
background-color: var(--#{$prefix}admon-attention-color-bg);

@include media-breakpoint-down(sm) {
left: 0;
margin: -1rem 0;
border-radius: $border-radius;
}
}

> p:first-child {
Expand All @@ -113,6 +153,10 @@ div.versionremoved {
margin: 2.5rem 2rem;
border: 2px solid transparent;

@include media-breakpoint-down(sm) {
margin: 2.5rem .6rem;
}

> p {
margin-bottom: 0;
}
Expand All @@ -129,6 +173,11 @@ div.versionremoved {
margin: -1rem;
font-weight: $font-weight-bold;
background-color: var(--#{$prefix}admon-tip-color-bg);

@include media-breakpoint-down(sm) {
left: 0;
border-radius: $border-radius;
}
}
}

Expand All @@ -137,6 +186,10 @@ div.versionremoved {
margin: 2.5rem 2rem;
border: 2px solid transparent;

@include media-breakpoint-down(sm) {
margin: 2.5rem .6rem;
}

> p {
margin-bottom: 0;
}
Expand All @@ -153,6 +206,11 @@ div.versionremoved {
margin: -1rem;
font-weight: $font-weight-bold;
background-color: var(--#{$prefix}admon-caution-color-bg);

@include media-breakpoint-down(sm) {
left: 0;
border-radius: $border-radius;
}
}
}

Expand All @@ -161,6 +219,10 @@ div.deprecated-title-only {
margin: 2.5rem 2rem;
border: 2px solid transparent;

@include media-breakpoint-down(sm) {
margin: 2.5rem .6rem;
}

> p {
margin-bottom: 0;
}
Expand All @@ -177,6 +239,11 @@ div.deprecated-title-only {
margin: -1rem;
font-weight: $font-weight-bold;
background-color: var(--#{$prefix}admon-error-color-bg);

@include media-breakpoint-down(sm) {
left: 0;
border-radius: $border-radius;
}
}
}

Expand All @@ -185,6 +252,10 @@ div.deprecated-title-only {
margin: 2.5rem 2rem;
border: 2px solid transparent;

@include media-breakpoint-down(sm) {
margin: 2.5rem .6rem;
}

> p {
margin-bottom: 0;
}
Expand All @@ -201,6 +272,11 @@ div.deprecated-title-only {
margin: -1rem;
font-weight: $font-weight-bold;
background-color: var(--#{$prefix}admon-attention-color-bg);

@include media-breakpoint-down(sm) {
left: 0;
border-radius: $border-radius;
}
}
}

Expand All @@ -218,6 +294,11 @@ aside.topic > .topic-title {
color: var(--#{$prefix}body-hc-color);
background-color: var(--#{$prefix}admon-note-color-bg);

@include media-breakpoint-down(sm) {
left: 6px;
border-radius: $border-radius;
}

&::before {
display: inline-block;
width: 16px;
Expand All @@ -240,6 +321,10 @@ aside.topic {
border: 2px solid var(--#{$prefix}admon-note-color-bg);
border-radius: $border-radius;

@include media-breakpoint-down(sm) {
margin: 2.5rem .6rem 2rem;
}

.admonition-title,
.topic-title {
color: var(--#{$prefix}body-hc-color);
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

setup(
name="sphinx-nefertiti",
version="0.4.0",
version="0.4.1",
packages=find_packages(),
include_package_data=True,
license="MIT",
Expand Down
4 changes: 2 additions & 2 deletions sphinx_nefertiti/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,9 @@
{%- block body %}
{% endblock -%}
</article>
<aside class="nftt-toc">
<aside class="nftt-toc my-3">
{% if display_toc and not hidetoc %}
<div class="mt-3 mb-1 my-lg-0 ps-xl-3 text-muted">
<div class="my-sm-1 my-lg-0 ps-xl-3 text-muted">
<button class="btn btn-link link-dark p-lg-0 mb-2 mb-lg-0 text-decoration-none nftt-toc-toggle d-lg-none" type="button" data-bs-toggle="collapse" data-bs-target="#tocContents" aria-expanded="false" aria-controls="tocContents"
>On this page <i class="ms-2 bi bi-chevron-expand"></i></button>
<div class="title d-none d-lg-block">
Expand Down
6 changes: 3 additions & 3 deletions sphinx_nefertiti/pager.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
<div class="container">
<ul class="pagination justify-content-between mb-0">
{%- if prev -%}
<li class="page-item">
<li class="d-flex page-item">
<a href="{{ prev.link|e }}" class="d-flex px-5 align-items-end" rel="prev" aria-label="{{_('Previous page:')}} {{ prev.title|striptags|e }}">
<span class="prev-page"><i class="bi bi-caret-left"></i></span>
<div class="d-flex flex-column">
<div class="d-none d-sm-flex flex-column">
<span class="text-small text-start text-muted">{{ _('Previous') }}</span>
<span class="underline">{{ prev.title }}</span>
</div>
</a>
</li>
{% endif %}
{%- if next -%}
<li class="page-item ms-auto">
<li class="d-flex page-item ms-auto">
<a href="{{ next.link|e }}" class="d-flex px-5 align-items-end" rel="next" aria-label="{{_('Next page:')}} {{ next.title|striptags|e }}">
<div class="d-flex flex-column">
<span class="text-small text-end text-start text-muted">{{ _('Next') }}</span>
Expand Down
2 changes: 1 addition & 1 deletion sphinx_nefertiti/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
_CURRENT_VERSION = (0, 4, 0, "f", 0) # following PEP 440
_CURRENT_VERSION = (0, 4, 1, "f", 0) # following PEP 440


def get_version():
Expand Down
Loading