Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
3 changes: 1 addition & 2 deletions .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
os: [ubuntu-latest, windows-latest, macOS-latest]
fail-fast: false
defaults:
Expand All @@ -42,7 +42,6 @@ jobs:
run: |
make test
- name: pyright, flake8, black and isort
if: matrix.python-version != '3.9'
run: |
make check

Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ All notable changes to `shinyswatch` will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.11.0] - 2026-06-01

* Added the `brite` theme. (#56)

* Update pre-built shinyswatch themes for use with Shiny v1.6.3. (#56)

* shinyswatch now requires Shiny v1.6.3 or later and Python 3.10 or later. Python 3.9 is no longer supported. (#56)

## [0.10.0] - 2026-03-20

* Update pre-built shinyswatch themes for use with Shiny v1.6.0. (#54)
Expand Down
6 changes: 3 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ classifiers =
Intended Audience :: Developers
License :: OSI Approved :: MIT License
Programming Language :: Python
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Programming Language :: Python :: 3.13
Programming Language :: Python :: 3.14
Programming Language :: Python :: Implementation :: PyPy
Topic :: Internet :: WWW/HTTP :: Dynamic Content
Topic :: Software Development :: Libraries :: Python Modules
Expand All @@ -29,7 +29,7 @@ project_urls =
Source Code = https://github.com/rstudio/py-shinyswatch

[options]
python_requires = >=3.8
python_requires = >=3.10
packages = find:
test_suite = tests
include_package_data = True
Expand All @@ -39,7 +39,7 @@ install_requires =
typing-extensions>=3.10.0.0
packaging>=20.9
htmltools>=0.2.0
shiny>=1.2.0
shiny>=1.6.3
tests_require =
pytest>=3
zip_safe = False
Expand Down
2 changes: 1 addition & 1 deletion shinyswatch/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Bootswatch + Bootstrap 5 themes for Shiny"""

__version__ = "0.10.0"
__version__ = "0.11.0"

from . import theme
from ._get_theme import get_theme
Expand Down
18 changes: 16 additions & 2 deletions shinyswatch/_bsw5.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

from ._typing_extensions import Literal

bsw5_version = "5.3.1"
bsw5_version = "5.3.8"

bsw5_themes = (
"brite",
"cerulean",
"cosmo",
"cyborg",
Expand Down Expand Up @@ -33,6 +34,7 @@
)

BSW5_THEME_NAME = Literal[
"brite",
"cerulean",
"cosmo",
"cyborg",
Expand Down Expand Up @@ -61,6 +63,18 @@
]

bsw5_theme_colors = {
"brite": {
"body_color": "#212529",
"body_bg": "#fff",
"light": "#e9ecef",
"dark": "#000",
"primary": "#a2e436",
"secondary": "#fff",
"info": "#22d2ed",
"success": "#68d391",
"warning": "#ffc700",
"danger": "#f56565",
},
"cerulean": {
"body_color": "#495057",
"body_bg": "#fff",
Expand Down Expand Up @@ -160,7 +174,7 @@
"lux": {
"body_color": "#55595c",
"body_bg": "#fff",
"light": "#fff",
"light": "#f0f1f2",
"dark": "#343a40",
"primary": "#1a1a1a",
"secondary": "#fff",
Expand Down
5 changes: 5 additions & 0 deletions shinyswatch/bsw5/brite/bootswatch.min.css

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions shinyswatch/bsw5/cerulean/bootswatch.min.css

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions shinyswatch/bsw5/cosmo/bootswatch.min.css

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions shinyswatch/bsw5/cyborg/bootswatch.min.css

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions shinyswatch/bsw5/darkly/bootswatch.min.css

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions shinyswatch/bsw5/flatly/bootswatch.min.css

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions shinyswatch/bsw5/journal/bootswatch.min.css

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions shinyswatch/bsw5/litera/bootswatch.min.css

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions shinyswatch/bsw5/lumen/bootswatch.min.css

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions shinyswatch/bsw5/lux/bootswatch.min.css

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions shinyswatch/bsw5/materia/bootswatch.min.css

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions shinyswatch/bsw5/minty/bootswatch.min.css

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions shinyswatch/bsw5/morph/bootswatch.min.css

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions shinyswatch/bsw5/pulse/bootswatch.min.css

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions shinyswatch/bsw5/quartz/bootswatch.min.css

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions shinyswatch/bsw5/sandstone/bootswatch.min.css

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions shinyswatch/bsw5/simplex/bootswatch.min.css

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions shinyswatch/bsw5/sketchy/bootswatch.min.css

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions shinyswatch/bsw5/slate/bootswatch.min.css

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions shinyswatch/bsw5/solar/bootswatch.min.css

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions shinyswatch/bsw5/spacelab/bootswatch.min.css

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions shinyswatch/bsw5/superhero/bootswatch.min.css

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions shinyswatch/bsw5/united/bootswatch.min.css

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions shinyswatch/bsw5/vapor/bootswatch.min.css

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions shinyswatch/bsw5/yeti/bootswatch.min.css

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions shinyswatch/bsw5/zephyr/bootswatch.min.css

Large diffs are not rendered by default.

65 changes: 65 additions & 0 deletions shinyswatch/theme.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,71 @@

from ._theme_shinyswatch import ShinyswatchTheme

brite = ShinyswatchTheme("brite")
"""
`brite` Bootswatch theme

Visit [https://bootswatch.com/brite/](https://bootswatch.com/brite/) to see
Bootswatch's demo of the `brite` theme.

This theme object is a subclass of :class:`~shiny.ui.Theme` and can be further
customized with the :class:`~shiny.ui.Theme` methods. Note that customizing Shiny
themes requires the [libsass package](https://sass.github.io/libsass-python/).

Examples
--------

Shinyswatch themes must be provided to the `theme` argument of any Shiny UI page
function, e.g. :func:`~shiny.ui.page_fluid` or :func:`~shiny.ui.page_sidebar`, or to
:func:`~shiny.express.ui.page_opts` in Shiny Express.

**Shiny Express**

```python
from shiny.express import ui
import shinyswatch

ui.page_opts(theme=shinyswatch.brite)
```

Comment thread
cpsievert marked this conversation as resolved.
**Shiny Core**

```python
from shiny import App, render, ui

import shinyswatch

app_ui = ui.page_fluid(
ui.input_slider("num", "Number:", min=10, max=100, value=30),
ui.output_text_verbatim("slider_val"),
theme=shinyswatch.theme.darkly,
)


def server(input):
@render.text
def slider_val():
return f"{input.num()}"


app = App(app_ui, server)
```

Attributes
----------
name:
Name of the theme.
colors:
A class containing the color variables used in the theme.

Returns
-------
htmltools.HTMLDependency
When called, returns an HTMLDependency of a full Shiny Bootswatch (brite)
theme.
"""


cerulean = ShinyswatchTheme("cerulean")
"""
`cerulean` Bootswatch theme
Expand Down
Loading