Skip to content
This repository has been archived by the owner on Dec 3, 2020. It is now read-only.

Fix #230: Constrain width of entire popup with lower and upper bounds #249

Merged
merged 1 commit into from
Nov 6, 2018

Conversation

biancadanforth
Copy link
Collaborator

In previous PRs (#214, #215 and #218) CSS fixes were added to partially constrain either the whole popup or sections of it, leaving the 'Undo' section out. This patch puts a min-width and max-width on the whole popup, while flexibly sizing all its child containers, ensuring that the fixes applied in previous PRs remain in place.

Unfortunately, the Overflow menu has a width greater than our ideal popup width of 320px per the UX spec, and that width cannot be controlled by a Web Extension, so I have set the max-width to 400px which will ensure the width of the popup doesn't change whether the toolbar button is in the overflow menu or not (previously, it would be one width when opened from the overflow menu and another width when opened otherwise).

One idea for the future is to try and detect whether the toolbar button is in the overflow menu or not and change classes accordingly via an experimental API, but that seems like overkill for now.

@biancadanforth biancadanforth requested a review from Osmose November 5, 2018 23:52
@biancadanforth
Copy link
Collaborator Author

@Osmose Ready for your review!

Copy link
Contributor

@Osmose Osmose left a comment

Choose a reason for hiding this comment

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

No idea why I didn't do something like this initially, this works great!

… bounds

In previous PRs (mozilla#214, mozilla#215 and mozilla#218) CSS fixes were added to partially constrain either the whole popup or sections of it, leaving the 'Undo' section out. This patch puts a min-width and max-width on the whole popup, while flexibly sizing all its child containers, ensuring that the fixes applied in previous PRs remain in place.

Unfortunately, the Overflow menu has a width greater than our ideal popup width of 320px per the [UX spec](https://mozilla.invisionapp.com/share/UFNSHAIMT4V#/screens/317130676_Artboard_1), and that width cannot be controlled by a Web Extension, so I have set the max-width to 400px which will ensure the width of the popup doesn't change whether the toolbar button is in the overflow menu or not (previously, it would be one width when opened from the overflow menu and another width when opened otherwise).

One idea for the future is to try and detect whether the toolbar button is in the overflow menu or not and change classes accordingly via an experimental API, but that seems like overkill for now.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants