Closed Bug 1966430 Opened 10 months ago Closed 9 months ago

Support adding images to moz-promo

Categories

(Toolkit :: UI Widgets, task)

task

Tracking

()

RESOLVED FIXED
142 Branch
Tracking Status
firefox142 --- fixed

People

(Reporter: hjones, Assigned: tgiles)

References

(Blocks 1 open bug)

Details

(Whiteboard: [recomp])

Attachments

(1 file)

One of the main differences between moz-promo and moz-message-bar is that consumers will have the ability to add their own images/iconography to the message and will have more control over where the image is positioned.

This bug covers the work involved in adding image support as well as making it possible to change the position of the image. We'll need to support images at the start, end, and possibly in the center of the promo. In the center case the image will be positioned below the text.

There are a couple of ways we could go about this. What I think we'll want to do is support an imageSrc with a default position (maybe start) as well as an imagePosition property/attr that can be configured to change that position. We've done something similar for moz-button in bug 1948106.

Based on the current designs, it looks like we'll want the image to be background cover so that it doesn’t scale but shows more as the promo grows (at least in the start and end cases).

Assignee: nobody → tgiles
Status: NEW → ASSIGNED

These changes add support for using an image in the moz-promo element.
The image is set using "imageSrc" and you can place the image using
"imageAlignment". The valid values are "start", "end", and "center".

The image used in the promo is currently using "background-image" in
order to get the resizing to behave more like the expected behavior,
however the design for this element is not finalized. This means this
image could change to using <img> if that better suits our need.

The stories added show the various configurations of the image and
alignment, as well as a square image and a rectangular image.

The "test_moz_promo.html" was updated to assert this new image support.

Pushed by tgiles@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/c78cf1daaeec https://hg.mozilla.org/integration/autoland/rev/360e4a4f1525 Add support for images in moz-promo. r=reusable-components-reviewers,desktop-theme-reviewers,hjones
Status: ASSIGNED → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
Target Milestone: --- → 142 Branch
Depends on: 1966422
Blocks: 1966422
No longer depends on: 1966422
QA Whiteboard: [qa-triage-done-c143/b142]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: