Skip to content

Commit

Permalink
Prepare release 0.5.2 (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
danirus authored Nov 26, 2024
1 parent 247a05e commit 0ea8ea8
Show file tree
Hide file tree
Showing 31 changed files with 73 additions and 61 deletions.
8 changes: 8 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Change Log

## [0.5.2] - 2024-11-26

- Increase contrast for body-bg, pre-border-color, and border-color for the light color scheme, in all colorsets.
- Fix colorset selector. Data attributes do not match between JS and HTML.
- Fix light/dark selector. When not 'default', reloading brings back 'default'.
- Update required version of sphinx-colorschemed-images.
- Update `colorsets.rst` in the docs.

## [0.5.1] - 2024-11-26

- Header and footer links can be references to internal documents or URLs.
Expand Down
2 changes: 1 addition & 1 deletion docs/source/users-guide/customization/colorsets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Test the different colorsets using the palette dropdown in the header. You can a
.. important::

When adding ``"show_colorset_choices": True`` and building in ReadTheDocs, be sure to add ``sphinx_nefertiti`` as an extension.
When adding ``"show_colorset_choices": True`` and building in ReadTheDocs, be sure to add ``sphinx_nefertiti`` as an extension to your ``extensions`` setting in ``conf.py``.


The ``style`` setting
Expand Down
8 changes: 6 additions & 2 deletions js/src/cschemes.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ export class CSchemeHandler {
constructor() {
this.stored = localStorage.getItem('snftt-color-scheme') || "default";
this._cshdl = new SphinxColorschemeImageHandler({auto: false});

for (const scheme of ['dark', 'light']) {
const q = globalThis.matchMedia(`(prefers-color-scheme: ${scheme})`);
if (q.matches && ['default', scheme].includes(this.stored)) {
if (q.matches && this.stored == 'default') {
this.apply(scheme);
this.updateDropdown(this.stored);
this._cshdl.activate(scheme);
Expand All @@ -19,6 +18,11 @@ export class CSchemeHandler {
}
});
}
if (this.stored != "default") {
this.apply(this.stored);
this.updateDropdown(this.stored);
this._cshdl.activate(this.stored);
}
}

registerClickEvents() {
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sphinx-nefertiti",
"version": "0.5.1",
"version": "0.5.2",
"private": true,
"description": "Nefertiti is a theme for the Sphinx Documentation Generator.",
"engines": {
Expand Down Expand Up @@ -70,7 +70,7 @@
"rollup": "^4.24.4",
"rollup-plugin-istanbul": "^5.0.0",
"sass": "1.78.0",
"sphinx-colorschemed-images": "^0.2.0",
"sphinx-colorschemed-images": "^0.2.2",
"stylelint": "^16.10.0",
"stylelint-config-twbs-bootstrap": "^15.1.0",
"terser": "^5.36.0"
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ dev = [
docs = [
"sphinx >=8.1.3, <8.2",
"myst-parser >=4.0.0, <4.1",
"sphinx-colorschemed-images >=0.2.0",
"sphinx-colorschemed-images >=0.2.2",
"sphinx_copybutton >=0.5.2, <1.0.0",
"sphinx-design >=0.6.1, <0.7",
"sphinx-nefertiti >=0.5.1",
Expand Down
6 changes: 3 additions & 3 deletions scss/_variables-blue.scss
Original file line number Diff line number Diff line change
Expand Up @@ -64,21 +64,21 @@ $dark: $gray-800 !default;
// scheme-color light.
$scheme-light-body-color: $gray-700;
$scheme-light-body-hc-color: $gray-800;
$scheme-light-body-bg: #fafafa;
$scheme-light-body-bg: $gray-300;
$scheme-light-body-secondary-color: rgba($scheme-light-body-color, .75) !default;
$scheme-light-body-secondary-bg: $gray-200 !default;
$scheme-light-body-tertiary-color: rgba($scheme-light-body-color, .8) !default;
$scheme-light-body-tertiary-bg: $gray-100 !default;
$scheme-light-body-emphasis-color: $black !default;
$scheme-light-pre-border-color: $gray-200;
$scheme-light-pre-border-color: $gray-400;
$scheme-light-foot1-bg: #fff;
$scheme-light-foot2-bg: $blue-100;
$scheme-light-foot2-link1: get-color-contrast($scheme-light-foot2-bg, 15%);
$scheme-light-foot2-link2: get-color-contrast($scheme-light-foot2-bg, 30%);
$scheme-light-foot2-link-bg: color.scale($scheme-light-foot2-bg, $lightness: -10%, $saturation: 30%);
$scheme-light-foot2-link-hover: get-color-contrast($scheme-light-foot2-bg, 0%);
$scheme-light-headings-color: $gray-700;
$scheme-light-border-color: $gray-200;
$scheme-light-border-color: $gray-400;
$scheme-light-border-color-translucent: rgba($black, .175) !default;
$scheme-light-link-color: $blue-600;
$scheme-light-link-hover-color: $blue-700;
Expand Down
6 changes: 3 additions & 3 deletions scss/_variables-cyan.scss
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,21 @@ $dark: $gray-800 !default;
// scheme-color light.
$scheme-light-body-color: $gray-700;
$scheme-light-body-hc-color: $gray-800;
$scheme-light-body-bg: #fafafa;
$scheme-light-body-bg: $gray-300;
$scheme-light-body-secondary-color: rgba($scheme-light-body-color, .9) !default;
$scheme-light-body-secondary-bg: $gray-200 !default;
$scheme-light-body-tertiary-color: rgba($scheme-light-body-color, .8) !default;
$scheme-light-body-tertiary-bg: $gray-100 !default;
$scheme-light-body-emphasis-color: $black !default;
$scheme-light-pre-border-color: $gray-200;
$scheme-light-pre-border-color: $gray-400;
$scheme-light-foot1-bg: #fff;
$scheme-light-foot2-bg: $cyan-100;
$scheme-light-foot2-link1: get-color-contrast($scheme-light-foot2-bg, 15%);
$scheme-light-foot2-link2: get-color-contrast($scheme-light-foot2-bg, 30%);
$scheme-light-foot2-link-bg: color.scale($scheme-light-foot2-bg, $lightness: -10%, $saturation: 30%);
$scheme-light-foot2-link-hover: get-color-contrast($scheme-light-foot2-bg, 0%);
$scheme-light-headings-color: $gray-700;
$scheme-light-border-color: $gray-200;
$scheme-light-border-color: $gray-400;
$scheme-light-border-color-translucent: rgba($black, .175) !default;
$scheme-light-link-color: $cyan-700;
$scheme-light-link-hover-color: $blue-600;
Expand Down
6 changes: 3 additions & 3 deletions scss/_variables-green.scss
Original file line number Diff line number Diff line change
Expand Up @@ -67,21 +67,21 @@ $dark: $gray-800 !default;
// scheme-color light.
$scheme-light-body-color: $gray-700;
$scheme-light-body-hc-color: $gray-800;
$scheme-light-body-bg: #fafafa;
$scheme-light-body-bg: $gray-300;
$scheme-light-body-secondary-color: rgba($scheme-light-body-color, .75) !default;
$scheme-light-body-secondary-bg: $gray-200 !default;
$scheme-light-body-tertiary-color: rgba($scheme-light-body-color, .8) !default;
$scheme-light-body-tertiary-bg: $gray-100 !default;
$scheme-light-body-emphasis-color: $black !default;
$scheme-light-pre-border-color: $gray-200;
$scheme-light-pre-border-color: $gray-400;
$scheme-light-foot1-bg: #fff;
$scheme-light-foot2-bg: $green-100;
$scheme-light-foot2-link1: get-color-contrast($scheme-light-foot2-bg, 15%);
$scheme-light-foot2-link2: get-color-contrast($scheme-light-foot2-bg, 30%);
$scheme-light-foot2-link-bg: color.scale($scheme-light-foot2-bg, $lightness: -10%, $saturation: 30%);
$scheme-light-foot2-link-hover: get-color-contrast($scheme-light-foot2-bg, 0%);
$scheme-light-headings-color: $gray-700;
$scheme-light-border-color: $gray-200;
$scheme-light-border-color: $gray-400;
$scheme-light-border-color-translucent: rgba($black, .175) !default;
$scheme-light-link-color: $green-600;
$scheme-light-link-hover-color: $green-800;
Expand Down
6 changes: 3 additions & 3 deletions scss/_variables-indigo.scss
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,21 @@ $dark: $gray-800 !default;
// scheme-color light.
$scheme-light-body-color: $gray-700;
$scheme-light-body-hc-color: $gray-800;
$scheme-light-body-bg: #fafafa;
$scheme-light-body-bg: $gray-300;
$scheme-light-body-secondary-color: rgba($scheme-light-body-color, .75) !default;
$scheme-light-body-secondary-bg: $gray-200 !default;
$scheme-light-body-tertiary-color: rgba($scheme-light-body-color, .8) !default;
$scheme-light-body-tertiary-bg: $gray-100 !default;
$scheme-light-body-emphasis-color: $black !default;
$scheme-light-pre-border-color: $gray-200;
$scheme-light-pre-border-color: $gray-400;
$scheme-light-foot1-bg: #fff;
$scheme-light-foot2-bg: $indigo-100;
$scheme-light-foot2-link1: get-color-contrast($scheme-light-foot2-bg, 15%);
$scheme-light-foot2-link2: get-color-contrast($scheme-light-foot2-bg, 30%);
$scheme-light-foot2-link-bg: color.scale($scheme-light-foot2-bg, $lightness: -10%, $saturation: 30%);
$scheme-light-foot2-link-hover: get-color-contrast($scheme-light-foot2-bg, 0%);
$scheme-light-headings-color: $gray-700;
$scheme-light-border-color: $gray-200;
$scheme-light-border-color: $gray-400;
$scheme-light-border-color-translucent: rgba($black, .175) !default;
$scheme-light-link-color: $indigo-500;
$scheme-light-link-hover-color: $indigo-700;
Expand Down
6 changes: 3 additions & 3 deletions scss/_variables-orange.scss
Original file line number Diff line number Diff line change
Expand Up @@ -70,21 +70,21 @@ $dark: $gray-800 !default;
// scheme-color light.
$scheme-light-body-color: $gray-700;
$scheme-light-body-hc-color: $gray-800;
$scheme-light-body-bg: #fafafa;
$scheme-light-body-bg: $gray-300;
$scheme-light-body-secondary-color: rgba($scheme-light-body-color, .75) !default;
$scheme-light-body-secondary-bg: $gray-200 !default;
$scheme-light-body-tertiary-color: rgba($scheme-light-body-color, .8) !default;
$scheme-light-body-tertiary-bg: $gray-100 !default;
$scheme-light-body-emphasis-color: $black !default;
$scheme-light-pre-border-color: $gray-200;
$scheme-light-pre-border-color: $gray-400;
$scheme-light-foot1-bg: #fff;
$scheme-light-foot2-bg: $orange-100;
$scheme-light-foot2-link1: get-color-contrast($scheme-light-foot2-bg, 15%);
$scheme-light-foot2-link2: get-color-contrast($scheme-light-foot2-bg, 30%);
$scheme-light-foot2-link-bg: color.scale($scheme-light-foot2-bg, $lightness: -10%, $saturation: 30%);
$scheme-light-foot2-link-hover: get-color-contrast($scheme-light-foot2-bg, 0%);
$scheme-light-headings-color: $gray-700;
$scheme-light-border-color: $gray-200;
$scheme-light-border-color: $gray-400;
$scheme-light-border-color-translucent: rgba($black, .175) !default;
$scheme-light-link-color: $orange-600;
$scheme-light-link-hover-color: $orange-800;
Expand Down
6 changes: 3 additions & 3 deletions scss/_variables-pink.scss
Original file line number Diff line number Diff line change
Expand Up @@ -70,21 +70,21 @@ $dark: $gray-800 !default;
// scheme-color light.
$scheme-light-body-color: $gray-700;
$scheme-light-body-hc-color: $gray-800;
$scheme-light-body-bg: #fafafa;
$scheme-light-body-bg: $gray-300;
$scheme-light-body-secondary-color: rgba($scheme-light-body-color, .75) !default;
$scheme-light-body-secondary-bg: $gray-200 !default;
$scheme-light-body-tertiary-color: rgba($scheme-light-body-color, .8) !default;
$scheme-light-body-tertiary-bg: $gray-100 !default;
$scheme-light-body-emphasis-color: $black !default;
$scheme-light-pre-border-color: $gray-200;
$scheme-light-pre-border-color: $gray-400;
$scheme-light-foot1-bg: #fff;
$scheme-light-foot2-bg: $pink-100;
$scheme-light-foot2-link1: get-color-contrast($scheme-light-foot2-bg, 15%);
$scheme-light-foot2-link2: get-color-contrast($scheme-light-foot2-bg, 30%);
$scheme-light-foot2-link-bg: color.scale($scheme-light-foot2-bg, $lightness: -10%, $saturation: 30%);
$scheme-light-foot2-link-hover: get-color-contrast($scheme-light-foot2-bg, 0%);
$scheme-light-headings-color: $gray-700;
$scheme-light-border-color: $gray-200;
$scheme-light-border-color: $gray-400;
$scheme-light-border-color-translucent: rgba($black, .175) !default;
$scheme-light-link-color: $pink-600;
$scheme-light-link-hover-color: $pink-800;
Expand Down
6 changes: 3 additions & 3 deletions scss/_variables-purple.scss
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,21 @@ $dark: $gray-800 !default;
// scheme-color light.
$scheme-light-body-color: $gray-700;
$scheme-light-body-hc-color: $gray-800;
$scheme-light-body-bg: #fafafa;
$scheme-light-body-bg: $gray-300;
$scheme-light-body-secondary-color: rgba($scheme-light-body-color, .75) !default;
$scheme-light-body-secondary-bg: $gray-200 !default;
$scheme-light-body-tertiary-color: rgba($scheme-light-body-color, .8) !default;
$scheme-light-body-tertiary-bg: $gray-100 !default;
$scheme-light-body-emphasis-color: $black !default;
$scheme-light-pre-border-color: $gray-200;
$scheme-light-pre-border-color: $gray-400;
$scheme-light-foot1-bg: #fff;
$scheme-light-foot2-bg: $purple-100;
$scheme-light-foot2-link1: get-color-contrast($scheme-light-foot2-bg, 15%);
$scheme-light-foot2-link2: get-color-contrast($scheme-light-foot2-bg, 30%);
$scheme-light-foot2-link-bg: color.scale($scheme-light-foot2-bg, $lightness: -10%, $saturation: 30%);
$scheme-light-foot2-link-hover: get-color-contrast($scheme-light-foot2-bg, 0%);
$scheme-light-headings-color: $gray-700;
$scheme-light-border-color: $gray-200;
$scheme-light-border-color: $gray-400;
$scheme-light-border-color-translucent: rgba($black, .175) !default;
$scheme-light-link-color: $purple-500;
$scheme-light-link-hover-color: $blue-600;
Expand Down
6 changes: 3 additions & 3 deletions scss/_variables-red.scss
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,21 @@ $dark: $gray-800 !default;
// scheme-color light.
$scheme-light-body-color: $gray-700;
$scheme-light-body-hc-color: $gray-800;
$scheme-light-body-bg: #fafafa;
$scheme-light-body-bg: $gray-300;
$scheme-light-body-secondary-color: rgba($scheme-light-body-color, .75) !default;
$scheme-light-body-secondary-bg: $gray-200 !default;
$scheme-light-body-tertiary-color: rgba($scheme-light-body-color, .8) !default;
$scheme-light-body-tertiary-bg: $gray-100 !default;
$scheme-light-body-emphasis-color: $black !default;
$scheme-light-pre-border-color: $gray-200;
$scheme-light-pre-border-color: $gray-400;
$scheme-light-foot1-bg: #fff;
$scheme-light-foot2-bg: $red-100;
$scheme-light-foot2-link1: get-color-contrast($scheme-light-foot2-bg, 15%);
$scheme-light-foot2-link2: get-color-contrast($scheme-light-foot2-bg, 30%);
$scheme-light-foot2-link-bg: color.scale($scheme-light-foot2-bg, $lightness: -10%, $saturation: 30%);
$scheme-light-foot2-link-hover: get-color-contrast($scheme-light-foot2-bg, 0%);
$scheme-light-headings-color: $gray-700;
$scheme-light-border-color: $gray-200;
$scheme-light-border-color: $gray-400;
$scheme-light-border-color-translucent: rgba($black, .175) !default;
$scheme-light-link-color: $red-600;
$scheme-light-link-hover-color: $red-800;
Expand Down
6 changes: 3 additions & 3 deletions scss/_variables-teal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,21 @@ $dark: $gray-800 !default;
// scheme-color light.
$scheme-light-body-color: $gray-700;
$scheme-light-body-hc-color: $gray-800;
$scheme-light-body-bg: #fafafa;
$scheme-light-body-bg: $gray-300;
$scheme-light-body-secondary-color: rgba($scheme-light-body-color, .75) !default;
$scheme-light-body-secondary-bg: $gray-200 !default;
$scheme-light-body-tertiary-color: rgba($scheme-light-body-color, .8) !default;
$scheme-light-body-tertiary-bg: $gray-100 !default;
$scheme-light-body-emphasis-color: $black !default;
$scheme-light-pre-border-color: $gray-200;
$scheme-light-pre-border-color: $gray-400;
$scheme-light-foot1-bg: #fff;
$scheme-light-foot2-bg: $teal-100;
$scheme-light-foot2-link1: get-color-contrast($scheme-light-foot2-bg, 15%);
$scheme-light-foot2-link2: get-color-contrast($scheme-light-foot2-bg, 30%);
$scheme-light-foot2-link-bg: color.scale($scheme-light-foot2-bg, $lightness: -10%, $saturation: 30%);
$scheme-light-foot2-link-hover: get-color-contrast($scheme-light-foot2-bg, 0%);
$scheme-light-headings-color: $gray-700;
$scheme-light-border-color: $gray-200;
$scheme-light-border-color: $gray-400;
$scheme-light-border-color-translucent: rgba($black, .175) !default;
$scheme-light-link-color: $teal-600;
$scheme-light-link-hover-color: $teal-800;
Expand Down
6 changes: 3 additions & 3 deletions scss/_variables-yellow.scss
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,21 @@ $dark: $gray-800 !default;
// scheme-color light.
$scheme-light-body-color: $gray-700;
$scheme-light-body-hc-color: $gray-800;
$scheme-light-body-bg: #fafafa;
$scheme-light-body-bg: $gray-300;
$scheme-light-body-secondary-color: rgba($scheme-light-body-color, .75) !default;
$scheme-light-body-secondary-bg: $gray-200 !default;
$scheme-light-body-tertiary-color: rgba($scheme-light-body-color, .8) !default;
$scheme-light-body-tertiary-bg: $gray-100 !default;
$scheme-light-body-emphasis-color: $black !default;
$scheme-light-pre-border-color: $gray-200;
$scheme-light-pre-border-color: $gray-400;
$scheme-light-foot1-bg: #fff;
$scheme-light-foot2-bg: $yellow-100;
$scheme-light-foot2-link1: get-color-contrast($scheme-light-foot2-bg, 15%);
$scheme-light-foot2-link2: get-color-contrast($scheme-light-foot2-bg, 30%);
$scheme-light-foot2-link-bg: color.scale($scheme-light-foot2-bg, $lightness: -10%, $saturation: 30%);
$scheme-light-foot2-link-hover: get-color-contrast($scheme-light-foot2-bg, 0%);
$scheme-light-headings-color: $gray-700;
$scheme-light-border-color: $gray-200;
$scheme-light-border-color: $gray-400;
$scheme-light-border-color-translucent: rgba($black, .175) !default;
$scheme-light-link-color: $yellow-700;
$scheme-light-link-hover-color: $yellow-800;
Expand Down
2 changes: 1 addition & 1 deletion sphinx_nefertiti/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from sphinx_nefertiti import colorsets, docsver, fonts, links, pygments

__version__ = "0.5.1"
__version__ = "0.5.2"

pages_wo_index = ["genindex", "search"]

Expand Down
2 changes: 1 addition & 1 deletion sphinx_nefertiti/colorsets-dropdown.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ <h6 class="dropdown-header">{{ _('Change color set') }}</h6>
</li>
{% for item in all_colorsets %}
<li>
<a class="dropdown-item d-flex align-items-center {% if theme_style == item %}active{% endif %}" data-snftt-color="{{ item }}" href="#" aria-pressed="false">
<a class="dropdown-item d-flex align-items-center {% if theme_style == item %}active{% endif %}" data-snftt-colorset="{{ item }}" href="#" aria-pressed="false">
<span class="{% if item=='default' %}cyan{% else %}{{ item }}{% endif %}">
<i class="bi bi-circle-fill"></i>
</span>
Expand Down
Loading

0 comments on commit 0ea8ea8

Please sign in to comment.