coalition.content.models.theme ============================== .. py:module:: coalition.content.models.theme .. autoapi-nested-parse:: Theme model for managing site themes and branding. Classes ------- .. autoapisummary:: coalition.content.models.theme.Theme Module Contents --------------- .. py:class:: Theme(*args, **kwargs) Bases: :py:obj:`django.db.models.Model` Model for managing site themes and branding. Allows organizations to customize colors, typography, and brand assets. .. py:attribute:: name .. py:attribute:: description .. py:attribute:: hex_color_validator .. py:attribute:: primary_color .. py:attribute:: secondary_color .. py:attribute:: accent_color .. py:attribute:: background_color .. py:attribute:: section_background_color .. py:attribute:: card_background_color .. py:attribute:: heading_color .. py:attribute:: body_text_color .. py:attribute:: muted_text_color .. py:attribute:: link_color .. py:attribute:: link_hover_color .. py:attribute:: heading_font_family .. py:attribute:: body_font_family .. py:attribute:: google_fonts .. py:attribute:: font_size_base .. py:attribute:: font_size_small .. py:attribute:: font_size_large .. py:attribute:: logo .. py:attribute:: logo_alt_text .. py:attribute:: favicon .. py:attribute:: custom_css .. py:attribute:: is_active .. py:attribute:: created_at .. py:attribute:: updated_at .. py:class:: Meta .. py:attribute:: db_table :value: 'theme' .. py:attribute:: verbose_name :value: 'Theme' .. py:attribute:: verbose_name_plural :value: 'Themes' .. py:attribute:: ordering :value: ['-is_active', '-updated_at'] .. py:method:: __str__() -> str .. py:property:: logo_url :type: str | None Return the URL of the uploaded logo, or None if no logo. .. py:property:: favicon_url :type: str | None Return the URL of the uploaded favicon, or None if no favicon. .. py:method:: clean() -> None Ensure only one active theme exists .. py:method:: save(*args: Any, **kwargs: Any) -> None Sanitize custom CSS and validate before saving .. py:method:: get_active() -> Theme | None :classmethod: Get the currently active theme .. py:method:: generate_css_variables() -> str Generate CSS custom properties for this theme