Created
April 1, 2021 14:20
-
-
Save philwolstenholme/23ad68723a922a62be2d548a55105f35 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# List out all the classes we *may* want to use, so they are not purged #} | |
{% set spacing_levels = { | |
1: 'u-o-1', | |
2: 'u-o-2', | |
3: 'u-o-3', | |
4: 'u-o-4', | |
5: 'u-o-5', | |
6: 'u-o-6', | |
7: 'u-o-7', | |
8: 'u-o-8', | |
} %} | |
{# Pick a Tailwind class from the lookup table based on the 'spacing' field's value from the CMS. If there is no value from the CMS then use option 3 #} | |
{% set spacing_level_utility = attribute(spacing_levels, node.field_spacing.value|default(3)) %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment