Skip to content
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

sets full-page alert banner to center align, adds ::backdrop #360

Closed
wants to merge 1 commit into from

Conversation

markconroy
Copy link
Member

@markconroy markconroy commented Aug 5, 2024

Closes localgovdrupal/localgov_base#580

What does this change?

We have - in localgov_base - a CSS property for

*,
*::before,
*::after {
  margin-top: 0;
}

This means in localgov_base our full page alert banner is placed horizontally centered, but vertically at the top since the default margin: auto for dialog is overridden.

It's worse for localgov_scarfolk since we have an override to say

.localgov-alert-banner {
  margin: var(--spacing);
}

This means the alert banner is at the top left of the page, with 1rem of spacing around it.

This PR adds the default margin: auto back to the alert banner if the banner is a dialog element.

It also adds a ::backdrop property so we can have the rest of the page faded out behind the dialog.

How to test

Create a full page alert banner, be delighted.

Images

Before:

Screenshot 2024-08-05 at 14 55 35

After:

Screenshot 2024-08-05 at 15 37 03


Thanks to Big Blue Door for sponsoring my time to work on this.

@andybroomfield
Copy link
Contributor

@markconroy Do you want to target this as a bugfix release to 1.7 or as part of the 1.8 refactor?

@markconroy
Copy link
Member Author

I don't mind which really. It will affect both versions so probably worth committing to one version and cherry picking to the other.

Comment on lines +11 to +17
dialog.localgov-alert-banner {
margin: auto;
}

dialog.localgov-alert-banner::backdrop {
background-color: rgba(0, 0, 0, 0.8);
}
Copy link
Contributor

@andybroomfield andybroomfield Aug 5, 2024

Choose a reason for hiding this comment

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

I think this should go in full screen alert banner module, not the main stylesheet.

/modules/localgov_alert_banner_full_page/css/full-page-alert-banner-layout.css or full-page-alert-banner-theme.css.

@andybroomfield
Copy link
Contributor

Seems fine in Olleivo though, so @markconroy are we sure we don't want to place this in localgov_base instead.
Note: one of the refactor plans is to make CSS optional, so it could be that localgov_base disables the alert banner styles and provides it's own anyway?

@andybroomfield
Copy link
Contributor

Noting the PHPStan fail is fixed in the 1.8.x branch.

@markconroy
Copy link
Member Author

Good idea, let's move this to localgov_base

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Full page alert banner does not cover the full page
2 participants