The title and cta would normally (as shown in other examples) end up in the same paragraph:
|
MzpNotification.init(origin, options); |
|
``` |
|
|
|
You can also pass a range of configuration options: |
|
|
|
```javascript |
|
MzpNotification.init(origin, { |
|
title: 'This is the title.', |
|
cta: { |
|
text: "And this is a CTA link.", |
|
url: "https://www.mozilla.org", |
|
attrs: {"target": "_blank", "rel": "noopener"} |
|
}, |
|
className: 'mzp-t-warning', |
|
closeText: 'Close notification', |
This is how it is rendered:
<aside class="mzp-c-notification-bar mzp-t-warning mzp-is-sticky">
<button class="mzp-c-notification-bar-button" type="button" title="Close notification">Close notification</button>
<p>This is the title.</p>
<a href="https://www.mozilla.org" class="mzp-c-notification-bar-cta" target="_blank" rel="noopener">And this is a CTA link.</a>
</aside>
When fixing #1040, I regressed to #559:
(expand for before/after screenshots)
(before:)
(after:)
It would seem mzp-c-notification-bar-cta was never styled explicitly, so I think additional #1000 (comment) for resilience is in order to render the expected spacing.
The
titleandctawould normally (as shown in other examples) end up in the same paragraph:protocol/components/notification-bar/notification-bar--scripted.readme.md
Lines 28 to 42 in e5627f8
This is how it is rendered:
When fixing #1040, I regressed to #559:
(expand for before/after screenshots)
(before:)
(after:)
It would seem
mzp-c-notification-bar-ctawas never styled explicitly, so I think additional #1000 (comment) for resilience is in order to render the expected spacing.