block/basic-alternating.html

  1. ---
  2. default_image_classes: "l--pr-2-col"
  3. default_image_classes_reversed: "l--pl-2-col"
  4. default_top_bottom_space: "my-11 s--my-12"
  5. default_grid_container_margins: " mb-11 s--mb-12"
  6. ---
  7. {{#
  8. /**
  9. * @name block/basic-alternating
  10. * @description A partial for basic alternating blocks. Adding custom image classes allows the image to be position and sized any way, but the fallback will assume an image width of 5 columns on desktop layouts.
  11. * @property {string} title
  12. * @property {string} description
  13. * @property {string} image
  14. * @property {string} [sub_title] - Optional lead in uppercase text above title
  15. * @property {string} [link_text]
  16. * @property {string} [link_url]
  17. * @property {string} [image_mobile]
  18. * @property {string} [text_on] - Have the text appear on the `left` or `right`
  19. * @property {bool} [alternating_backgrounds=false]
  20. * @property {string} [background_color] - If `alternating_backgrounds` is true, you can set the `background_color` var
  21. * @property {bool} [mobile_image_bottom=false] - Flips the order of the image on mobile size
  22. * @property {string} [custom_image_classes] - Custom classes to add to image when it's on the right OR right
  23. * @property {string} [default_image_classes_reversed="l--pl-2-col"] - Custom classes to add to image when it's on the right
  24. * @property {string} [default_image_classes="l--pr-2-col"] - Custom classes to add to image when it's on the left
  25. */
  26. #}}
  27. <section class="px-5 {{ if alternating_backgrounds }} py-11 s--py-12 {{ background_color }} {{ else }} {{ custom_top_bottom_space or default_top_bottom_space }} {{ /if }}">
  28. <div class="mw-32 m-0 {{ unless alternating_backgrounds }}{{ custom_grid_container_margins or default_grid_container_margins }} {{ /unless }} m--mw-grid mx-auto grid g-cols gap-m m--ai-center">
  29. {{ if text_on=="left" }}
  30. <div class="relative g-col-12 m--g-col-6 m--h-100 m--order-2 ta-center m--ta-right {{ if mobile_image_bottom }}order-2{{ /if }}">
  31. <picture class="block w-100 h-auto">
  32. <source srcset="{{ image_mobile or image }}" media="(max-width: 480px)">
  33. {{ asset:image }}
  34. <img src="{{ url }}"
  35. alt="{{ alt }}"
  36. class="mw-100 relative border-box {{ custom_image_classes or default_image_classes_reversed }}">
  37. {{ /asset:image }}
  38. </picture>
  39. </div>
  40. {{ else }}
  41. <div class="relative g-col-12 m--g-col-6 m--h-100 ta-center m--ta-left {{ if mobile_image_bottom }}order-2 m--order-0{{ /if }}">
  42. <picture class="block w-100 h-auto">
  43. <source srcset="{{ image_mobile or image }}" media="(max-width: 480px)">
  44. {{ asset:image }}
  45. <img src="{{ url }}"
  46. alt="{{ alt }}"
  47. class="mw-100 relative border-box {{ custom_image_classes or default_image_classes }}">
  48. {{ /asset:image }}
  49. </picture>
  50. </div>
  51. {{ /if }}
  52. <div class="g-col-12 m--g-col-6">
  53. {{ if sub_title }}
  54. <p class="lead-in-1 {{ foreground_color or 'slate' }} mb-2">{{ sub_title }}</p>
  55. {{ /if }}
  56. <h2 class="title-3 {{ foreground_color or 'slate-120' }} mb-4 m--title-3 m--mt-0">{{ title }}</h2>
  57. <p class="body-3 {{ foreground_color or 'slate' }} m--mb-0">{{ description }}</p>
  58. {{ if link_text }}
  59. <a href="{{ link_url }}" class="ocean fw-500 fs-4 lh-4 mt-4 link hover-link-border hover-link-border-arrow inline-block">
  60. {{ link_text }} <i class="rarr"></i>
  61. </a>
  62. {{ /if }}
  63. </div>
  64. </div>
  65. </section>