Skip to content

Add text about making notification bar dismissable #3500

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 3, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion warehouse/static/sass/blocks/_notification-bar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,31 @@
Modifiers:
- danger: Applies a red background
- success: Applies a green background
- dismissable: Indicates notification be be dismissed. Defaults to hidden.
- dismissable: Indicates notification can be dismissed. Defaults to hidden.
- visible: Indicates a visible, non-dismissed notification

A notification bar can be made dismissable by adding the following to the main
notification-bar div:
- .notification-bar--dismissable to its classes
- data-controller="notification" as an attribute
- data-target="notification.notification" as an attribute

The data-controller and data-target are used for handling visibility,
including adding .notification-bar--visible to notification-bar div if it has
not been dismissed (and persisted) yet.

<div class="notification-bar notification-bar--dismissable"
data-controller="notification" data-target="notification.notification">
<span class="notification-bar__icon">
// icon here
</span>
<span class="notification-bar__message">
// A one line notification goes here.
</span>
</div>

Note that if JavaScript is disabled, the notification bar always defaults to
be visible.
*/

.notification-bar {
Expand Down