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.1.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.1-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for django_bootstrap_colors-5.4.1.tar.gz
Algorithm Hash digest
SHA256 61e1727050282f50a2dc686bb7cd94766e048b16da450cdaaaf350739a5ffe38
MD5 87aa250a19a94779a16a2c067c1c67f4
BLAKE2b-256 924aedca371fd258e68d1257c7e14d4f90486b1bf754b1da433e0d8f6f09c77d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_bootstrap_colors-5.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4f205c7409710469b9285da85d349f7f19845ee703e8b70771909ecc0ec79460
MD5 85664711e5fe6c4e7effa7cae45e0d0c
BLAKE2b-256 5d1452c026fcf84b9345fe1f9c77c27bdab5a2736750898310732de154c094d6

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