Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
# HEAD

## Bug Fixes

* **css:** Notification bar padding of links only working for complete sentences (#1000)
* **css:** Missing explicit `mzp-c-notification-bar-cta` distinction (#1041)

# 20.0.0

## Features

* **fonts:** (breaking) Adds rebrand fonts, Mozilla Headline and Mozilla Text. Removes outdated Mozilla Brand font, Zilla Slab. New fonts will only support `woff2` format to simplify maintenance.
* **fonts:** Upgrade Inter font to version 4.1, drop WOFF 1.0 format (#1026)
* **css:** Add `text-wrap: balance` to all headings (#910)
* **css:** Apply hover cursor from Details component to Details element (#948)
* **assets:** Update @mozilla-protocol/assets to 5.4.0

## Migration Tips

* **fonts:** Any use of `font-mozilla` mixin should be replaced with `font-mozilla-headline`. NOTE: we recommend `font-mozilla-headline` only for text over 24px (below should be `font-mozilla-text`)
* Headings are now [balanced](https://developer.mozilla.org/docs/Web/CSS/text-wrap-style#balanced_text), which can impact other wrapping rules. Make sure any changes to `h1`–`h6` rendering end up styled as expected, especially if you apply any `white-space`, `word-break` or `hyphens` customizations.
* See notes for [Protocol Assets 5.4.0](https://github.com/mozilla/protocol-assets/blob/main/CHANGELOG.md#540)
Expand Down
17 changes: 7 additions & 10 deletions assets/js/protocol/notification-bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,17 @@ MzpNotification.init = (origin, opts) => {
const className = (options && options.className) ? options.className : '';
const closeText = (options && options.closeText) ? options.closeText : '';
const isSticky = (options && options.isSticky) ? 'mzp-is-sticky' : '';
const ctaOptions = options && options.cta ? options.cta : {};
const ctaOptions = (options && options.cta) ? options.cta : {};

const notification = document.createElement('aside');
notification.className = 'mzp-c-notification-bar ' + className + ' ' + isSticky;

// Notification Title

if (options && options.title){
const notificationContent = document.createElement('p');
notification.appendChild(notificationContent);

const notificationTitle = document.createElement('p');
notificationTitle.appendChild(title);

// add title to notification
notification.appendChild(notificationTitle);
// Notification Title
if (options && options.title) {
notificationContent.appendChild(title);
}

// Notification CTA link
Expand All @@ -67,7 +64,7 @@ MzpNotification.init = (origin, opts) => {
for (key in ctaAttrs){
ctaAnchor.setAttribute(key, ctaAttrs[key]);
}
notification.appendChild(ctaAnchor);
notificationContent.appendChild(ctaAnchor);
}

// Notification Fragment
Expand Down
5 changes: 4 additions & 1 deletion assets/sass/protocol/components/_notification-bar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,17 @@
display: inline-block;
font-size: inherit;
font-weight: 700;
margin: 0 $spacing-sm;

&:hover,
&:active,
&:focus {
color: inherit;
text-decoration: none;
}

&.mzp-c-notification-bar-cta {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 definitely a good idea to scope this specifically to the CTA links

margin: 0 $spacing-sm;
}
}

&.mzp-is-sticky {
Expand Down
2 changes: 1 addition & 1 deletion components/notification-bar/notification-bar.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ variants:
context:
class: mzp-t-warning
close_button: True
content: Warning! It's dangerous to go alone.
content: Warning! It’s <a href="#">dangerous</a> to go alone.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

- name: Error
notes: Use the class `mzp-t-error` for a negative notification, to indicate
an unsuccessful action. This example also features an action link.
Expand Down