Skip to main content

override the primary color and its variants in bootstrap

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_bootstrap_colors-5.4.0.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_bootstrap_colors-5.4.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file django_bootstrap_colors-5.4.0.tar.gz.

File metadata

File hashes

Hashes for django_bootstrap_colors-5.4.0.tar.gz
Algorithm Hash digest
SHA256 fb34ba9a5ce9f929a1a5825c557395d9039a9732aaf63f4562ee8e706a5aef60
MD5 a5ba88126768ca2c9645e329a7657cfb
BLAKE2b-256 13c2885898787f278451d29974516a22c9c056cd0bc4c5af06748153c5666ef6

See more details on using hashes here.

File details

Details for the file django_bootstrap_colors-5.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_bootstrap_colors-5.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 62cc74d852b991f7e5fc074ec70579193f95961e1d454f8d3aeeba0bb7a56fce
MD5 0927215cfd175c5d29fb22fd7278cfc6
BLAKE2b-256 cf6062e517cdbbdaea6f8134f48bf49886316fc22303ccf0ae2876f2940f37cb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page