You are here

uikit-countdown.html.twig in UIkit Components 8.3

Default theme implementation for a UIkit Countdown.

Available variables:

  • attributes: HTML attributes to be applied to the countdown.
  • separators: An associative array to insert a separator between each number, containing:

    • days_hours: The separator to insert between the days and hours.
    • hours_minutes: The separator to insert between hours and minutes.
    • minutes_seconds: The separator to insert between minutes and seconds.
  • labels: An associative array for labels to display below each number, containing:

    • days: The label to display for days.
    • hours: The label to display for hours.
    • minutes: The label to display for minutes.
    • seconds: The label to display for seconds.

File

templates/components/uikit-countdown.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation for a UIkit Countdown.
  5. *
  6. * Available variables:
  7. * - attributes: HTML attributes to be applied to the countdown.
  8. * - separators: An associative array to insert a separator between each number,
  9. containing:
  10. * - days_hours: The separator to insert between the days and hours.
  11. * - hours_minutes: The separator to insert between hours and minutes.
  12. * - minutes_seconds: The separator to insert between minutes and seconds.
  13. * - labels: An associative array for labels to display below each number,
  14. * containing:
  15. * - days: The label to display for days.
  16. * - hours: The label to display for hours.
  17. * - minutes: The label to display for minutes.
  18. * - seconds: The label to display for seconds.
  19. *
  20. * @see \Drupal\uikit_components\Element\UIkitCountdown
  21. * @see template_preprocess_uikit_countdown()
  22. * @see https://getuikit.com/docs/countdown
  23. *
  24. * @ingroup uikit_components_theme_render
  25. */
  26. #}
  27. <div{{ attributes }}>
  28. <div>
  29. <div class="uk-countdown-number uk-countdown-days"></div>
  30. {% if labels.days %}
  31. <div class="uk-countdown-label uk-margin-small uk-text-center uk-visible@s">{{ labels.days }}</div>
  32. {% endif %}
  33. </div>
  34. {% if separators.days_hours %}
  35. <div class="uk-countdown-separator">{{ separators.days_hours }}</div>
  36. {% endif %}
  37. <div>
  38. <div class="uk-countdown-number uk-countdown-hours"></div>
  39. {% if labels.hours %}
  40. <div class="uk-countdown-label uk-margin-small uk-text-center uk-visible@s">{{ labels.hours }}</div>
  41. {% endif %}
  42. </div>
  43. {% if separators.hours_minutes %}
  44. <div class="uk-countdown-separator">{{ separators.hours_minutes }}</div>
  45. {% endif %}
  46. <div>
  47. <div class="uk-countdown-number uk-countdown-minutes"></div>
  48. {% if labels.minutes %}
  49. <div class="uk-countdown-label uk-margin-small uk-text-center uk-visible@s">{{ labels.minutes }}</div>
  50. {% endif %}
  51. </div>
  52. {% if separators.minutes_seconds %}
  53. <div class="uk-countdown-separator">{{ separators.minutes_seconds }}</div>
  54. {% endif %}
  55. <div>
  56. <div class="uk-countdown-number uk-countdown-seconds"></div>
  57. {% if labels.seconds %}
  58. <div class="uk-countdown-label uk-margin-small uk-text-center uk-visible@s">{{ labels.seconds }}</div>
  59. {% endif %}
  60. </div>
  61. </div>

Related topics