Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
View this page
Toggle table of contents sidebar

# betty.extension.cotton_candy.config module

Provide configuration for the Cotton Candy extension.

class betty.extension.cotton_candy.config.ColorConfiguration

  Bases: `Configuration`

  Configure a color.

  __init__(hex_value: str)
  dump() → bool | int | float | str | None | MutableSequence[bool | int | float | str | None | MutableSequence[Dump] | MutableMapping[str, Dump]] | MutableMapping[str, bool | int | float | str | None | MutableSequence[Dump] | MutableMapping[str, Dump]] | type[Void]

    Dump this instance to a portable format.

  property hex: str

    The color’s hexadecimal value.

  load(dump: bool | int | float | str | None | MutableSequence[Dump] | MutableMapping[str, Dump]) → None

    Load dumped configuration.

    Raises:

      betty.assertion.error.AssertionFailed – Raised if the dump contains invalid configuration.

  update(other: Self) → None

    Update this configuration with the values from `other`.

class betty.extension.cotton_candy.config.CottonCandyConfiguration

  Bases: `Configuration`

  Provide configuration for the `betty.extension.cotton_candy.CottonCandy` extension.

  DEFAULT_LINK_ACTIVE_COLOR = '#2a615a'
  DEFAULT_LINK_INACTIVE_COLOR = '#149988'
  DEFAULT_PRIMARY_ACTIVE_COLOR = '#ff69b4'
  DEFAULT_PRIMARY_INACTIVE_COLOR = '#ffc0cb'
  __init__(*, featured_entities: Sequence[EntityReference[UserFacingEntity & Entity]] | None = None, primary_inactive_color: str = '#ffc0cb', primary_active_color: str = '#ff69b4', link_inactive_color: str = '#149988', link_active_color: str = '#2a615a', logo: Path | None = None)
  dump() → bool | int | float | str | None | MutableSequence[bool | int | float | str | None | MutableSequence[Dump] | MutableMapping[str, Dump]] | MutableMapping[str, bool | int | float | str | None | MutableSequence[Dump] | MutableMapping[str, Dump]] | type[Void]

    Dump this instance to a portable format.

  property featured_entities: EntityReferenceSequence[UserFacingEntity & Entity]

    The entities featured on the front page.

  property link_active_color: ColorConfiguration

    The color for active hyperlinks.

  property link_inactive_color: ColorConfiguration

    The color for inactive hyperlinks.

  load(dump: bool | int | float | str | None | MutableSequence[Dump] | MutableMapping[str, Dump]) → None

    Load dumped configuration.

    Raises:

      betty.assertion.error.AssertionFailed – Raised if the dump contains invalid configuration.

  property logo: Path | None

    The path to the logo.

  property primary_active_color: ColorConfiguration

    The color for active primary/CTA elements.

  property primary_inactive_color: ColorConfiguration

    The color for inactive primary/CTA elements.

  update(other: Self) → None

    Update this configuration with the values from `other`.