bulma/docs/documentation/elements/notification.html

83 lines
2.6 KiB
HTML
Raw Normal View History

---
2017-07-29 12:02:00 +00:00
title: Notification
layout: documentation
doc-tab: elements
doc-subtab: notification
2018-04-09 13:15:31 +00:00
breadcrumb:
- home
- documentation
- elements
- elements-notification
meta:
colors: true
sizes: false
variables: true
---
2017-07-29 12:02:00 +00:00
{% capture notification %}
<div class="notification">
<button class="delete"></button>
Lorem ipsum dolor sit amet, consectetur
2017-07-05 20:27:23 +00:00
adipiscing elit lorem ipsum dolor. <strong>Pellentesque risus mi</strong>, tempus quis placerat ut, porta nec nulla. Vestibulum rhoncus ac ex sit amet fringilla. Nullam gravida purus diam, et dictum <a>felis venenatis</a> efficitur. Sit amet,
consectetur adipiscing elit
</div>
2017-07-29 12:02:00 +00:00
{% endcapture %}
2017-07-29 12:02:00 +00:00
{% capture notification_colors %}
{% for color in site.data.colors.justColors %}
2017-10-09 22:30:58 +00:00
<div class="notification is-{{ color }}">
<button class="delete"></button>
Primar lorem ipsum dolor sit amet, consectetur
2017-07-05 20:27:23 +00:00
adipiscing elit lorem ipsum dolor. <strong>Pellentesque risus mi</strong>, tempus quis placerat ut, porta nec nulla. Vestibulum rhoncus ac ex sit amet fringilla. Nullam gravida purus diam, et dictum <a>felis venenatis</a> efficitur. Sit amet,
consectetur adipiscing elit
</div>
2017-10-09 17:13:02 +00:00
{% endfor %}
2017-07-29 12:02:00 +00:00
{% endcapture %}
{% capture notification_js_html %}
<div class="notification">
<button class="delete"></button>
Lorem ipsum
</div>
{% endcapture %}
{% capture notification_js_code %}
document.addEventListener('DOMContentLoaded', () => {
(document.querySelectorAll('.notification .delete') || []).forEach(($delete) => {
$notification = $delete.parentNode;
$delete.addEventListener('click', () => {
$notification.parentNode.removeChild($notification);
});
});
});
{% endcapture %}
2018-04-09 21:25:26 +00:00
{% include elements/snippet.html content=notification %}
2017-07-29 12:02:00 +00:00
2018-04-09 21:25:26 +00:00
{% include elements/anchor.html name="Colors" %}
2017-07-29 12:02:00 +00:00
2018-04-09 21:25:26 +00:00
{% include elements/snippet.html content=notification_colors %}
2017-07-29 12:02:00 +00:00
<div id="notificationJsExample" class="message is-info">
<h4 class="message-header">Javascript delete notification</h4>
<div class="message-body">
<div class="content">
<p>
The Bulma package <strong>does not come with any JavaScript</strong>.
<br>
Here is however an implementation example, which sets <code>click</code> handler for <code>delete</code> elements of all notifications on the page, in Vanilla Javascript.
</p>
{% highlight html %}{{ notification_js_html }}{% endhighlight %}
{% highlight javascript %}{{ notification_js_code }}{% endhighlight %}
<p>
Remember, these are just implementation examples. The Bulma package <strong>does not come with any JavaScript</strong>.
</p>
</div>
</div>
</div>
2018-04-09 21:25:26 +00:00
{% include elements/variables.html type='element' %}