New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Re-add base styling for footer actions to support simple customisations #11751
Re-add base styling for footer actions to support simple customisations #11751
Conversation
Manage this branch in SquashTest this branch here: https://lb-fix11629-better-base-stylin-yj2pe.squash.io |
@lb- I wonder if the extra actions should be inline, to the right of the primary actions as we had up to 6.0? |
@zerolab the new max width makes this very tight except for maybe one added button. |
5ee324d
to
3f7b9f0
Compare
Ah, that's unfortunate. |
OK so should we close this PR or still attempt to account for a 'basic' usage here? |
@lb- this PR is an improvement over what we have now, so we should keep it. Sorry if I was unclear |
Regarding the max width, I haven't checked if this is possible, but we might be able to set the max width on just the dropdown, while using something like fit-content for the container. That might allow us to keep the max width in most cases, but still allowing additional items to appear with enough width side-by-side. |
3f7b9f0
to
138f441
Compare
138f441
to
09b30da
Compare
09b30da
to
8639000
Compare
- Fixes wagtail#11629 - Relates to clean up done as part of wagtail#11629 which removed a lot of styling for footer actions which appeared to be unused. - Re-add some base styling to support the ability for basic customisations where buttons are added within the `extra_footer_actions` block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @lb-!
This is a solid base for reinstating the styles, but I noticed a few issues. I have made the fixes locally, I'll push them to your branch and double check. If I don't find any more issues, I think I'll merge this so we can unblock external packages like wagtail-content-import.
client/scss/components/_footer.scss
Outdated
gap: theme('spacing.2'); | ||
grid-auto-flow: column; | ||
|
||
> * { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I've seen we're only doing this to reset the default .button
styles, so I think it's better to apply this more conservatively, e.g.
> * { | |
> .button { |
// Support basic layout support for items added via `extra_footer_actions` | ||
|
||
align-items: stretch; | ||
display: grid; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I understand, this allows us to remove the w-grid
from these:
<nav class="actions actions--primary footer__container w-grid" aria-label="{% trans 'Actions' %}"> |
<nav class="actions actions--primary footer__container w-grid" aria-label="{% trans 'Actions' %}"> |
which were added after #11456 (comment).
client/scss/components/_footer.scss
Outdated
|
||
> * { | ||
// Reset the margin on any .button sibling elements | ||
height: auto; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately this causes the button to be very small when there's no dropdown (e.g. when the page is locked)
and the button to be very large when it has an icon (due to missing height
set for the icon):
I think we have to define our own height here instead of relying on the dropdown's button height, which in turn relies on the default .button
height of 3em
or the $text-input-height
:
min-height: $text-input-height; |
Unfortunately, 42px or 2.625rem (the current height, which is also $text-input-height
) is not defined in our spacing tokens. We can either add it as spacing[10.5]
and use it, or use $text-input-height
instead.
Since we already use $text-input-height
in _dropdown-button.scss
, I think we can use it here too. It would be nice to add it as spacing[10.5]
in the future though, as it seems we use this value in quite a few places.
8639000
to
ee4b699
Compare
@@ -103,6 +125,7 @@ | |||
|
|||
.icon { | |||
width: theme('spacing.4'); | |||
height: theme('spacing.4'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<nav class="actions actions--primary footer__container w-grid" aria-label="{% trans 'Actions' %}"> | ||
<nav class="actions actions--primary footer__container" aria-label="{% trans 'Actions' %}"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// - set height responsively | ||
// - add a margin when there is a .button sibling | ||
// Unset these styles in favor of a fixed height and the grid gap | ||
height: $text-input-height; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about cases where one wraps that .button
in a form? wagtail-localize used to do that for the additional buttons (a la "import from local file")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, OK, good point. I wanted to remove the >
but was afraid it would be risky.
The main dropdown action button from Wagtail is also wrapped inside another element, and without removing the >
this technically still uses the default styles from .button
(see bottom right), but the _dropdown-button.scss
has its own min-height
styles to handle the case for smaller screens so that it uses this same height instead of the smaller one:
I think it should be safe to remove the >
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for checking!
localize is a bit special in that it replaces the edit form with its React bits (one more reason to rewrite with good old panels).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks everyone. A great solution in the end.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Team work! Thank you @lb- and @laymonage ❤️
ee4b699
to
2d7429d
Compare
2d7429d
to
f941b45
Compare
Thanks @zerolab and @laymonage |
Overview
extra_footer_actions
needs better styling #11629extra_footer_actions
block.I'd recommend we also include this in
6.0.2
as it will help packages update to support Wagtail 6.0* easier.Details
The PR referenced above did a lot of incredible work to clean up the complex styles in the footer, but it appears that some of that made basic customisations much easier.
This PR proposes we add some bare minimum styling back to support the common use case of showing a few buttons in the
extra_footer_actions
block.Testing
Follow the steps in #11629 (comment)
Before
After