reviewboard.themes.ui.base¶
Base support for defining UI themes.
New in version 7.0.
- class InkColorScheme(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
Enum
The Ink color scheme set by a theme.
New in version 7.0.
- class BaseUITheme[source]¶
Bases:
object
Base class for a UI theme.
New in version 7.0.
- theme_id: ClassVar[str]¶
The unique ID of the theme.
This is used for registration and lookup purposes.
These only need to be unique within other UI themes.
- Type:
- name: ClassVar[StrOrPromise]¶
The displayed name of the theme.
This will be shown to the user when choosing themes. It should be localized.
- Type:
- ink_color_scheme: ClassVar[InkColorScheme]¶
The value for the
data-ink-color-scheme=
HTML attribute.This informs the CSS and JavaScript of the current color scheme.
- Type:
- get_html_attrs(*, request: HttpRequest) dict[str, str] [source]¶
Return HTML attributes to include on the root HTML element.
By default, this sets
data-theme
totheme_id
anddata-ink-color-scheme
toink_color_scheme`
.Subclasses can override this to provide additional attributes.
- Parameters:
request (
django.http.HttpRequest
) – The HTTP request from the client.- Returns:
The HTML attributes to include.
- Return type:
- __annotations__ = {'ink_color_scheme': 'ClassVar[InkColorScheme]', 'name': 'ClassVar[StrOrPromise]', 'theme_id': 'ClassVar[str]'}¶