styles.py 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. """Styles for the app."""
  2. import reflex as rx
  3. border_radius = "0.375rem"
  4. box_shadow = "0px 0px 0px 1px rgba(84, 82, 95, 0.14)"
  5. border = f"1px solid {rx.color('accent', 12)}"
  6. text_color = rx.color("gray", 11)
  7. accent_text_color = rx.color("accent", 10)
  8. accent_color = rx.color("accent", 1)
  9. hover_accent_color = {"_hover": {"color": accent_text_color}}
  10. hover_accent_bg = {"_hover": {"background_color": accent_color}}
  11. content_width_vw = "90vw"
  12. sidebar_width = "20em"
  13. template_page_style = {"padding_top": "5em", "padding_x": ["auto", "2em"], "flex": "1"}
  14. template_content_style = {
  15. "align_items": "flex-start",
  16. "box_shadow": box_shadow,
  17. "border_radius": border_radius,
  18. "padding": "1em",
  19. "margin_bottom": "2em",
  20. }
  21. link_style = {
  22. "color": accent_text_color,
  23. "text_decoration": "none",
  24. **hover_accent_color,
  25. }
  26. overlapping_button_style = {
  27. "background_color": "white",
  28. "border": border,
  29. "border_radius": border_radius,
  30. }
  31. base_style = {
  32. rx.menu.trigger: {
  33. **overlapping_button_style,
  34. },
  35. rx.menu.item: hover_accent_bg,
  36. }
  37. markdown_style = {
  38. "code": lambda text: rx.code(text, color=accent_text_color, bg=accent_color),
  39. "a": lambda text, **props: rx.link(
  40. text,
  41. **props,
  42. font_weight="bold",
  43. color=accent_text_color,
  44. text_decoration="underline",
  45. text_decoration_color=accent_text_color,
  46. _hover={
  47. "color": accent_color,
  48. "text_decoration": "underline",
  49. "text_decoration_color": accent_color,
  50. },
  51. ),
  52. }