Created
May 26, 2024 18:35
-
-
Save MatthieuScarset/6282ec2488a36faf90ecd102730d1037 to your computer and use it in GitHub Desktop.
HTML - Details with custom marker styling
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
details { | |
border: 0; | |
summary { | |
position: relative; | |
cursor: pointer; | |
padding: 0; | |
} | |
summary > * { | |
display: inline-block; | |
} | |
summary::marker { | |
content: none; | |
} | |
&[open] summary i { | |
transform: rotate(45deg); | |
} | |
} |
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
{% | |
set classes = [ | |
'node', | |
'node--type-' ~ node.bundle|clean_class, | |
view_mode ? 'node--view-mode-' ~ view_mode|clean_class, | |
] | |
%} | |
{% set title_attributes = title_attributes ?? create_attribute() %} | |
{% set content_attributes = content_attributes ?? create_attribute() %} | |
<details{{ attributes.addClass(classes) }}> | |
<summary{{ title_attributes.addClass('d-flex', 'flex-nowrap', 'align-items-center', 'justify-content-between', 'py-1') }}> | |
<strong>{{ node.label() }}</strong> | |
<i aria-hidden="true" class="icon-cross"></i> | |
</summary> | |
<div{{ content_attributes.addClass('container', 'p-2') }}> | |
{{ content }} | |
</div> | |
</details> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment