Skip to main content

This django app allows to override the primary color and its variants in bootstrap.

Usage

  • Add bootstrap_colors to INSTALLED_APPS
  • Add path('colors.css', BootstrapColorsView.as_view(), name='colors') to urls.py
  • Add <link rel="stylesheet" type="text/css" href="{% url 'colors' %}"> to your template
  • Set BOOTSTRAP_THEME_COLORS (Default: ['#0d6efd', '#0b5ed7', '#0a58ca'])
  • Optional: Configure caching, e.g. by using django.views.decorators.cache.cache_control

Alternatives

Bootstrap provides several ways to achieve this:

  • CSS custom properities: It would be great if we could just change a few custom properties. Unfortunately they are not used in a way that would allow that.
  • Scss variables: This requires a Scss compiler somewhere in the build process which I would like to avoid.
  • Override CSS: This is the approach that is used in this package. However, it is brittle because the underlying bootstrap code might change.

Metadata

Release files for django-bootstrap-colors 5.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-bootstrap-colors 5.4.2
File Size Uploaded
django_bootstrap_colors-5.4.2.tar.gz 3.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-bootstrap-colors 5.4.2
File Interpreter ABI Platform
django_bootstrap_colors-5.4.2-py3-none-any.whl Python 3 none any Details

Total release size: 7.0 kB

Release files / django_bootstrap_colors-5.4.2.tar.gz

Download URL django_bootstrap_colors-5.4.2.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
bb55492b7b21cede40a404c2d79df97dd0f92af585f347d7fe3790287051f7ad
BLAKE2b-256 checksum
How to use checksums
64f44e320d94f01c74289bd6dbd53c185b83cabdc00402fb5aa5d5002bc71797
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / django_bootstrap_colors-5.4.2-py3-none-any.whl

Download URL django_bootstrap_colors-5.4.2-py3-none-any.whl
Size 3.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3985fb6b8bbd423f9269ed773b3266457a43ec2e28e8f41202df0cf8e824b92a
BLAKE2b-256 checksum
How to use checksums
678dae14bb7068c8f2f78748c618494732e400adbef0519c7ed7f0ce063727be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

5.4.2 This release

2 release files

5.4.1

2 release files

5.4.0

2 release files

5.3.0

1 release file

5.2.2

1 release file

5.2.1

1 release file

5.2.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page