coalition.content.models.theme

Theme model for managing site themes and branding.

Classes

Theme

Model for managing site themes and branding.

Module Contents

class coalition.content.models.theme.Theme(*args, **kwargs)[source]

Bases: django.db.models.Model

Model for managing site themes and branding. Allows organizations to customize colors, typography, and brand assets.

name[source]
description[source]
hex_color_validator[source]
primary_color[source]
secondary_color[source]
accent_color[source]
background_color[source]
section_background_color[source]
card_background_color[source]
heading_color[source]
body_text_color[source]
muted_text_color[source]
heading_font_family[source]
body_font_family[source]
google_fonts[source]
font_size_base[source]
font_size_small[source]
font_size_large[source]
logo_alt_text[source]
favicon[source]
custom_css[source]
is_active[source]
created_at[source]
updated_at[source]
class Meta[source]
db_table = 'theme'[source]
verbose_name = 'Theme'[source]
verbose_name_plural = 'Themes'[source]
ordering = ['-is_active', '-updated_at'][source]
__str__() str[source]
property logo_url: str | None[source]

Return the URL of the uploaded logo, or None if no logo.

property favicon_url: str | None[source]

Return the URL of the uploaded favicon, or None if no favicon.

clean() None[source]

Ensure only one active theme exists

save(*args: Any, **kwargs: Any) None[source]

Sanitize custom CSS and validate before saving

classmethod get_active() Theme | None[source]

Get the currently active theme

generate_css_variables() str[source]

Generate CSS custom properties for this theme