styles.py 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. """Styles for the app."""
  2. import reflex as rx
  3. from .state import State
  4. border_radius = "0.375rem"
  5. box_shadow = "0px 0px 0px 1px rgba(84, 82, 95, 0.14)"
  6. border = "1px solid #F4F3F6"
  7. text_color = "black"
  8. accent_text_color = "#1A1060"
  9. accent_color = "#F5EFFE"
  10. hover_accent_color = {"_hover": {"color": accent_color}}
  11. hover_accent_bg = {"_hover": {"bg": accent_color}}
  12. content_width_vw = "90vw"
  13. sidebar_width = "20em"
  14. template_page_style = {
  15. "padding_top": "5em",
  16. "padding_x": "2em",
  17. }
  18. template_content_style = {
  19. "width": rx.cond(
  20. State.sidebar_displayed,
  21. f"calc({content_width_vw} - {sidebar_width})",
  22. content_width_vw,
  23. ),
  24. "min-width": sidebar_width,
  25. "align_items": "flex-start",
  26. "box_shadow": box_shadow,
  27. "border_radius": border_radius,
  28. "padding": "1em",
  29. "margin_bottom": "2em",
  30. }
  31. link_style = {
  32. "color": text_color,
  33. "text_decoration": "none",
  34. **hover_accent_color,
  35. }
  36. overlapping_button_style = {
  37. "background_color": "white",
  38. "border": border,
  39. "border_radius": border_radius,
  40. }
  41. base_style = {
  42. rx.MenuButton: {
  43. "width": "3em",
  44. "height": "3em",
  45. **overlapping_button_style,
  46. },
  47. rx.MenuItem: hover_accent_bg,
  48. }