Last active
August 29, 2015 14:03
-
-
Save markhalliwell/64bf26914d5f5304df39 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
{% attributes.class.add([ | |
'node', | |
'node--type-' ~ node.bundle|class, | |
node.promoted ? 'node--promoted', | |
node.sticky ? 'node--sticky', | |
not node.published ? 'node--unpublished', | |
preview ? 'node--preview', | |
'node--view-mode-' ~ view_mode|class | |
]).remove([ | |
'some-module-class' | |
]) %} | |
<article {{attributes}}> | |
vs. | |
{% set classes = [ | |
'node', | |
'node--type-' ~ node.bundle|class, | |
node.promoted ? 'node--promoted', | |
node.sticky ? 'node--sticky', | |
not node.published ? 'node--unpublished', | |
preview ? 'node--preview', | |
'node--view-mode-' ~ view_mode|class | |
] | |
%} | |
<article class="{{ attributes.class.add(classes).remove(['some-module-class']) }}"{{ attributes|without('class') }}> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment