Skip to content

MzpNotification adds cta anchor after the paragraph #1041

@janbrasna

Description

@janbrasna

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:)

Image

(after:)

Image

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions