Skip to content

Commit

Permalink
Add text about making notification bar dismissable
Browse files Browse the repository at this point in the history
  • Loading branch information
pgadige committed Apr 2, 2018
1 parent 23633d5 commit 23320f5
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions warehouse/static/sass/blocks/_notification-bar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,30 @@
- dismissable: Indicates notification be 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 it's classes
- data-controller="notification"
- data-target="notification.notification" as attributes
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 {
border-bottom: 2px solid $white;
Expand Down

0 comments on commit 23320f5

Please sign in to comment.