New York City (NY) / General Obligation - Unlimited Tax STR: WD LTR: AA
HELLO WORLD
Code
<div class="accordion">
<div class="accordion__wrapper">
<div class="accordion__header accordion__level--1">
<h4 class="heading--6">New York City (NY) / General Obligation - Unlimited Tax <span class="accordion__items">STR: WD</span>
<span class="accordion__items">LTR: AA</span>
</h4>
</div>
<div class="accordion__content accordion__level--1"></div>
</div>
</div>
{#
/**
* @file
* Default theme implementation to display a paragraph.
*
* Available variables:
* - paragraph: Full paragraph entity.
* Only method names starting with "get", "has", or "is" and a few common
* methods such as "id", "label", and "bundle" are available. For example:
* - paragraph.getCreatedTime() will return the paragraph creation timestamp.
* - paragraph.id(): The paragraph ID.
* - paragraph.bundle(): The type of the paragraph, for example, "image" or "text".
* - paragraph.getOwnerId(): The user ID of the paragraph author.
* See Drupal\paragraphs\Entity\Paragraph for a full list of public properties
* and methods for the paragraph object.
* - content: All paragraph items. Use {{ content }} to print them all,
* or print a subset such as {{ content.field_example }}. Use
* {{ content|without('field_example') }} to temporarily suppress the printing
* of a given child element.
* - attributes: HTML attributes for the containing element.
* The attributes.class element may contain one or more of the following
* classes:
* - paragraphs: The current template type (also known as a "theming hook").
* - paragraphs--type-[type]: The current paragraphs type. For example, if the paragraph is an
* "Image" it would result in "paragraphs--type--image". Note that the machine
* name will often be in a short form of the human readable label.
* - paragraphs--view-mode--[view_mode]: The View Mode of the paragraph; for example, a
* preview would result in: "paragraphs--view-mode--preview", and
* default: "paragraphs--view-mode--default".
* - view_mode: View mode; for example, "preview" or "full".
* - logged_in: Flag for authenticated user status. Will be true when the
* current user is a logged-in member.
* - is_admin: Flag for admin user status. Will be true when the current user
* is an administrator.
*
* @see template_preprocess_paragraph()
*
* @ingroup themeable
*/
#}
{{ attach_library('fitch_master/accordion') }}
{%
set classes = [
'admin',
'paragraph',
'paragraph--type--' ~ paragraph.bundle|clean_class,
view_mode ? 'paragraph--view-mode--' ~ view_mode|clean_class,
not paragraph.isPublished() ? 'paragraph--unpublished'
]
%}
{% block paragraph %}
{% block content %}
{{ title_suffix }}
<div class="accordion">
{{ content.field_accordion }}
</div>
{% endblock %}
{% endblock paragraph %}
{#
/**
* @file
* Default theme implementation to display a paragraph.
*
* Available variables:
* - paragraph: Full paragraph entity.
* Only method names starting with "get", "has", or "is" and a few common
* methods such as "id", "label", and "bundle" are available. For example:
* - paragraph.getCreatedTime() will return the paragraph creation timestamp.
* - paragraph.id(): The paragraph ID.
* - paragraph.bundle(): The type of the paragraph, for example, "image" or "text".
* - paragraph.getOwnerId(): The user ID of the paragraph author.
* See Drupal\paragraphs\Entity\Paragraph for a full list of public properties
* and methods for the paragraph object.
* - content: All paragraph items. Use {{ content }} to print them all,
* or print a subset such as {{ content.field_example }}. Use
* {{ content|without('field_example') }} to temporarily suppress the printing
* of a given child element.
* - attributes: HTML attributes for the containing element.
* The attributes.class element may contain one or more of the following
* classes:
* - paragraphs: The current template type (also known as a "theming hook").
* - paragraphs--type-[type]: The current paragraphs type. For example, if the paragraph is an
* "Image" it would result in "paragraphs--type--image". Note that the machine
* name will often be in a short form of the human readable label.
* - paragraphs--view-mode--[view_mode]: The View Mode of the paragraph; for example, a
* preview would result in: "paragraphs--view-mode--preview", and
* default: "paragraphs--view-mode--default".
* - view_mode: View mode; for example, "preview" or "full".
* - logged_in: Flag for authenticated user status. Will be true when the
* current user is a logged-in member.
* - is_admin: Flag for admin user status. Will be true when the current user
* is an administrator.
*
* @see template_preprocess_paragraph()
*
* @ingroup themeable
*/
#}
{%
set classes = [
'admin',
'paragraph',
'paragraph--type--' ~ paragraph.bundle|clean_class,
view_mode ? 'paragraph--view-mode--' ~ view_mode|clean_class,
not paragraph.isPublished() ? 'paragraph--unpublished'
]
%}
{% block paragraph %}
{% block content %}
<div class="accordion__wrapper">
<div class="accordion__header">
<h4 class="heading--6">{{ content.field_title.0 }}
{% if content.field_sub_title.0 is not empty %}
<span class="accordion__items">{{ content.field_sub_title.0 }}</span>
{% endif %}
</h4>
</div>
<div class="accordion__content">
{{ content.field_text.0 }}
</div>
</div>
{% endblock %}
{% endblock paragraph %}
.accordion {
padding-top: var(--spacing-1);
}
.accordion__wrapper {
padding-bottom: var(--spacing-2);
}
.accordion__wrapper .accordion__wrapper {
padding-bottom: 1.8rem;
}
.accordion__wrapper:last-of-type {
padding-bottom: 0;
}
.accordion__wrapper:last-of-type .accordion__content:last-of-type {
padding-bottom: 0;
}
.accordion__header {
position: relative;
padding-left: var(--spacing-2);
line-height: var(--line-height-2);
cursor: pointer;
}
.accordion__header:before {
content: '\f067';
position: absolute;
top: 50%;
left: 0;
transform: translateY(-50%);
margin-top: 0.1rem;
float: left;
font-family: FontAwesomeS;
font-style: normal;
font-weight: 900;
cursor: pointer;
}
.accordion__header.active:before {
content: '\f068';
}
.accordion__header.accordion__level--2 {
padding: var(--spacing-1) 0 var(--spacing-1) var(--spacing-2);
font-weight: 700;
}
.accordion__header.accordion__level--3 {
padding: var(--spacing-1) 0 var(--spacing-1) var(--spacing-2);
font-weight: 700;
border-bottom: 0.063rem solid var(--text-color);
}
.accordion__items {
float: right;
font-size: 1rem;
font-weight: 900;
line-height: 2.528;
text-transform: uppercase;
}
.accordion__content {
padding-bottom: var(--spacing-2);
display: none;
}
.accordion__content.accordion__level--3 {
border-bottom: 0.1rem solid var(--text-color);
}
.accordion__content .accordion__wrapper {
padding-left: var(--spacing-2);
border-left: 1.4rem solid #000000;
border-left: 0.3rem solid #000000;
}
.accordion__content.active {
display: block;
}
.accordion__content .table__wrapper {
margin-bottom: 0;
}
.accordion {
padding-top: var(--spacing-1);
&__wrapper {
padding-bottom: var(--spacing-2);
.accordion__wrapper {
padding-bottom: 1.8rem;
}
&:last-of-type {
padding-bottom: 0;
.accordion__content:last-of-type {
padding-bottom: 0;
}
}
}
&__header {
position: relative;
padding-left: var(--spacing-2);
line-height: var(--line-height-2);
cursor: pointer;
&:before {
content: '\f067';
position: absolute;
top: 50%;
left: 0;
transform: translateY(-50%);
margin-top: 0.1rem;
float: left;
font-family: FontAwesomeS;
font-style: normal;
font-weight: 900;
cursor: pointer;
}
&.active:before {
content: '\f068';
}
&.accordion__level--2 {
padding: var(--spacing-1) 0 var(--spacing-1) var(--spacing-2);
font-weight: 700;
}
&.accordion__level--3 {
padding: var(--spacing-1) 0 var(--spacing-1) var(--spacing-2);
font-weight: 700;
border-bottom: 0.063rem solid var(--text-color);
}
}
&__items {
float: right;
font-size: 1rem;
font-weight: 900;
line-height: 2.528;
text-transform: uppercase;
}
&__content {
padding-bottom: var(--spacing-2);
display: none;
&.accordion__level--3 {
border-bottom: 0.1rem solid var(--text-color);
}
.accordion__wrapper {
padding-left: var(--spacing-2);
border-left: 1.4rem solid #000000;
border-left: 0.3rem solid #000000;
}
&.active {
display: block;
}
.table__wrapper {
margin-bottom: 0;
}
}
&__level--1 {
}
&__level--2 {
}
}
jQuery(function($){
$('.accordion__header', $(this)).click(function(){
$(this).toggleClass('active').next().toggleClass('active');
});
});