code.py 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. """Components for rendering heading.
  2. https://www.radix-ui.com/themes/docs/theme/typography
  3. """
  4. from __future__ import annotations
  5. from reflex.components.core.breakpoints import Responsive
  6. from reflex.components.el import elements
  7. from reflex.components.markdown.markdown import MarkdownComponentMap
  8. from reflex.vars.base import Var
  9. from ..base import LiteralAccentColor, LiteralVariant, RadixThemesComponent
  10. from .base import LiteralTextSize, LiteralTextWeight
  11. class Code(elements.Code, RadixThemesComponent, MarkdownComponentMap):
  12. """A block level extended quotation."""
  13. tag = "Code"
  14. # The visual variant to apply: "solid" | "soft" | "outline" | "ghost"
  15. variant: Var[LiteralVariant]
  16. # Text size: "1" - "9"
  17. size: Var[Responsive[LiteralTextSize]]
  18. # Thickness of text: "light" | "regular" | "medium" | "bold"
  19. weight: Var[Responsive[LiteralTextWeight]]
  20. # Overrides the accent color inherited from the Theme.
  21. color_scheme: Var[LiteralAccentColor]
  22. # Whether to render the text with higher contrast color
  23. high_contrast: Var[bool]
  24. code = Code.create