templates/_snippets/components/_button.html.twig line 1

Open in your IDE?
  1. {# Style du bouton #}
  2. {% set sectionId = ('#'~section(content).id|raw) %}
  3. {% set section = section(content) %}
  4. {% set title = title(content) %}
  5. {% set button = button(content) %}
  6. {{ sectionId }} .button{
  7. display: block;
  8. text-align: center;
  9. {% if button.radius.value is defined and button.radius.value != 0 %}border-radius: {{ (button.radius.value~button.radius.unit)|raw }};{% endif %}
  10. {% if button.color is defined and button.color is not empty %}
  11. {% if button.inverseColor is defined and button.inverseColor == true %}
  12. background-color: {{ (button.secondaryColor)|raw }};
  13. {% else %}
  14. background-color: {{ (button.color)|raw }};
  15. {% endif %}
  16. border: 2px solid {{ (button.color)|raw }};
  17. {% endif %}
  18. {% if button.secondaryColor is defined and button.secondaryColor is not empty %}
  19. {% if button.inverseColor is defined and button.inverseColor == true %}
  20. color: {{ (button.color)|raw }};
  21. {% else %}
  22. color: {{ (button.secondaryColor)|raw }};
  23. {% endif %}
  24. {% endif %}
  25. {% if button.weight is defined and button.weight != 0 %}font-weight: {{ (button.weight)|raw }};{% endif %}
  26. {% if button.margin is defined %}{{ margins(button.margin.unit, button.margin.top, button.margin.right, button.margin.bottom, button.margin.left) }}{% endif %}
  27. {% if button.padding is defined %}{{ paddings(button.padding.unit, button.padding.top, button.padding.right, button.padding.bottom, button.padding.left) }}{% endif %}
  28. {% if button.textAlign is defined and button.textAlign != 'center' %}text-align: {{ (button.textAlign)|raw }} !important;{% endif %}
  29. {% if button.isUnderlined is defined and button.isUnderlined == true %}text-decoration: underline !important; width: 100%;{% endif %}
  30. }
  31. {% if button.isUnderlined is not defined or button.isUnderlined == false %}
  32. {{ sectionId }} .button:hover{
  33. {% if button.secondaryColor is defined and button.secondaryColor is not empty %}
  34. {% if button.inverseColor is defined and button.inverseColor == true %}
  35. background-color: {{ (button.color)|raw }};
  36. {% else %}
  37. background-color: {{ (button.secondaryColor)|raw }};
  38. {% endif %}
  39. {% endif %}
  40. {% if button.color is defined and button.color is not empty %}
  41. {% if button.inverseColor is defined and button.inverseColor == true %}
  42. color: {{ (button.secondaryColor)|raw }};
  43. {% else %}
  44. color: {{ (button.color)|raw }};
  45. {% endif %}
  46. {% endif %}
  47. }
  48. {% endif %}
  49. {{ sectionId }} .button.flying-button{
  50. padding: 0;
  51. }