Metadata-Version: 2.4
Name: zensical-gradient-theme
Version: 0.1.1
Summary: An installable Zensical theme with animated rainbow-gradient accents and purple light/dark color schemes, built for Rich-style Python project docs.
Keywords: zensical,mkdocs,theme,documentation,gradient
Author: Maxwell Ludden
Author-email: Maxwell Ludden <maxludden@me.com>
License-Expression: MIT
License-File: LICENSE
Classifier: Framework :: MkDocs
Classifier: Topic :: Documentation
Classifier: Topic :: Software Development :: Documentation
Requires-Dist: zensical>=0.1.3
Requires-Python: >=3.11
Project-URL: Documentation, https://maxludden.github.io/zensical-gradient-theme/
Project-URL: Repository, https://github.com/maxludden/zensical-gradient-theme
Project-URL: PyPI, https://pypi.org/project/zensical-gradient-theme/
Description-Content-Type: text/markdown

<picture>
  <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/maxludden/zensical-gradient-theme/main/docs/img/zensical-gradient-theme-banner-dark.svg">
  <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/maxludden/zensical-gradient-theme/main/docs/img/zensical-gradient-theme-banner-light.svg">
  <img alt="Zensical Gradient Theme Banner" src="https://raw.githubusercontent.com/maxludden/zensical-gradient-theme/main/docs/img/zensical-gradient-theme-banner.svg">
</picture>

# zensical-gradient-theme

[![PyPI](https://img.shields.io/pypi/v/zensical-gradient-theme)](https://pypi.org/project/zensical-gradient-theme/) [![Docs](https://img.shields.io/badge/docs-GitHub%20Pages-8055ff)](https://maxludden.github.io/zensical-gradient-theme/) [![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)   

Gradient Theme is an installable [Zensical](https://zensical.org) theme that adds animated rainbow gradients to your docs. Links, the site title, the rule under each page title and every admonition shimmer over purple light and dark color schemes. Install it from PyPI and set `name = "gradient"`; no extra CSS or JavaScript is needed.

See it in action in the [documentation](https://maxludden.github.io/zensical-gradient-theme/).

[![The docs home page in the dark scheme, showing the gradient site title, the rainbow rule under the page title and rainbow links](https://raw.githubusercontent.com/maxludden/zensical-gradient-theme/main/docs/img/example.png)](https://maxludden.github.io/zensical-gradient-theme/)

What it gives you:

- `gradient-dark` and `gradient-light` color schemes, with a system / light / dark toggle
- Animated rainbow text on links, the active nav item and the site title, plus a rainbow rule under each `h1`
- Admonitions and collapsible blocks with an animated gradient border, tinted title and gradient-filled icon. Each type has its own gradient around its usual color (warnings stay orange); notes use the full rainbow.
- All animation stops when the reader asks for reduced motion
- Calm, card-style API reference pages for [mkdocstrings](https://mkdocstrings.github.io/) output
- Inter and Roboto Mono fonts, the classic variant, and a sensible feature list (instant navigation, code copy, search suggestions and more)
- Copy-to-clipboard links with a toast

## Install

The theme is on [PyPI](https://pypi.org/project/zensical-gradient-theme/). Add it to the dependency group that holds Zensical:

```shell
uv add --group docs zensical-gradient-theme
```

Or with pip:

```shell
pip install zensical-gradient-theme
```

To track unreleased changes, install from GitHub instead:

```shell
uv add --group docs "zensical-gradient-theme @ git+https://github.com/maxludden/zensical-gradient-theme"
```

## Use

In `zensical.toml`:

```toml
[project.theme]
name = "gradient"
logo = "img/logo.svg"      # optional
favicon = "img/logo.svg"   # optional
```

That's all: the theme's stylesheet and script load automatically, so you don't need `extra_css` or `extra_javascript` entries for it. The same works in `mkdocs.yml` with `theme: {name: gradient}`.

### Overriding defaults

The theme sets `variant`, `font`, `palette` and `features`. Any of these you set in your own `[project.theme]` replaces the theme's value as a whole. For example, setting `features` replaces the full list rather than adding to it. Copy the list from `src/zensical_gradient_theme/templates/mkdocs_theme.yml` and edit it.

To restyle further, add your own `extra_css`. It loads after the theme's stylesheet, so your rules win.

### Copy links

```html
<a class="copy-install" data-copy="uv add my-package" href="#">uv add my-package</a>
```

Clicking copies the `data-copy` text (or the link text, if there's no
`data-copy`) and shows a "Copied" toast.

### Extra classes

| Class | Effect |
| --- | --- |
| `table.params` | Wide parameter table with a solid header |
| `.badges` | Centers a row of badge images |
| `.version` | Accent-colored version label |
| `.banner` | Full-width image |
| `img[src$="#only-dark"]`, `#only-light` | Show an image in one scheme only |

## Development

```shell
uv sync
uv run pytest      # builds a fixture site with the theme and checks the output
uv run ruff check
uv run mypy
uv run zensical serve   # preview the demo site in docs/
```

### How the theme is found

Zensical loads installable themes from the `mkdocs.themes` entry-point group and copies everything in the theme directory into the built site. The entry point targets a small locator object whose `__file__` sits in `templates/`, so only the templates and assets end up in sites, not the package's Python files. `templates/mkdocs_theme.yml` is the one config file that does get copied.
