new things.
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
name: Accordion
|
||||
props:
|
||||
type: object
|
||||
properties: { }
|
||||
slots:
|
||||
# Content.
|
||||
accordion_headline:
|
||||
title: Accordion Title
|
||||
description: "The accordion title."
|
||||
accordion_content:
|
||||
title: Accordion Content
|
||||
description: "The accordion content."
|
||||
@@ -0,0 +1,14 @@
|
||||
{% set classes = [
|
||||
'accordion',
|
||||
] %}
|
||||
|
||||
<div class="accordion">
|
||||
<div class="accordion-item">
|
||||
<h2 class="accordion-header">
|
||||
{% block accordion_title %}{% endblock %}
|
||||
</h2>
|
||||
</div>
|
||||
<div class="accordion-body">
|
||||
{% block accordion_content %}{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,17 @@
|
||||
name: Button
|
||||
props:
|
||||
type: object
|
||||
required:
|
||||
- type
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
title: Type
|
||||
description: "The type of button to render"
|
||||
# The enum directive restricts the possible values in the element to our list.
|
||||
enum: ['primary', 'secondary', 'danger']
|
||||
slots:
|
||||
# Content to display in the chip.
|
||||
button_text:
|
||||
title: Button Text
|
||||
description: The text for the button
|
||||
7
web/themes/custom/dchadwick/components/button/button.js
Normal file
7
web/themes/custom/dchadwick/components/button/button.js
Normal file
@@ -0,0 +1,7 @@
|
||||
((Drupal) => {
|
||||
Drupal.behaviors.button = {
|
||||
attach(context) {
|
||||
console.log("hello");
|
||||
},
|
||||
};
|
||||
})(Drupal);
|
||||
10
web/themes/custom/dchadwick/components/button/button.twig
Normal file
10
web/themes/custom/dchadwick/components/button/button.twig
Normal file
@@ -0,0 +1,10 @@
|
||||
{%
|
||||
set classes = [
|
||||
'btn',
|
||||
'btn-' ~ type|clean_class,
|
||||
]
|
||||
%}
|
||||
|
||||
<button class="{{ classes|join(" ") }}">
|
||||
{% block button_text %}{% endblock %}
|
||||
</button>
|
||||
Reference in New Issue
Block a user