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

Fix banner overlapping with other content #4080

Merged
merged 4 commits into from
Aug 12, 2020
Merged

Fix banner overlapping with other content #4080

merged 4 commits into from
Aug 12, 2020

Conversation

javierm
Copy link
Member

@javierm javierm commented Aug 10, 2020

References

Objectives

  • Fix banner content overlapping with other content
  • Align banner text like other elements on the page
  • Add default colors to banners created with our db:dev_seed task

Visual Changes

Before these changes:

The banner text is not aligned in the homepage
The banner contents overlap with the budget heading
The banner contents overlap with the help page heading

After these changes:

The banner text is aligned in the homepage
The banner contents does not overlap with the budget heading
The banner contents does not overlap with the help page heading

@javierm javierm self-assigned this Aug 10, 2020
@javierm javierm added this to Reviewing in Consul Democracy via automation Aug 10, 2020
@javierm javierm mentioned this pull request Aug 10, 2020
@taitus taitus self-assigned this Aug 12, 2020
Using HTML classes to apply styles to certain elements makes views
harder to customize.
In some sections we had negative top margins to compensate the header
bottom margin. However, when adding a banner between the header and
those sections, the negative margin caused the content of those sections
to overlap with the content of the banner.

Removing the negative margins when a banner is present solves the issue.
Unlike the rest of the page, it had no left margin nor padding
whatsoever.
Banners created through the admin form were getting the default color.
However, banners created by other means (like the `db:dev_seed` rake
task) were not getting these default values.

This feature was originally implemented when we were using Rails 4.
With Rails 5, we can provide default values to all new banners and
simplify the code at the same time thanks to its `attribute` method.

Now, when creating a new banner, instead of getting a blank space, we
get an empty line with the banner's default background color, which most
users won't know what it's about until they fill in the banner's title.
So we're not displaying the content of the banner when it's empty,
thanks to the `:empty` CSS pseudoclass.
Consul Democracy automation moved this from Reviewing to Testing Aug 12, 2020
@javierm javierm merged commit 3736610 into master Aug 12, 2020
Consul Democracy automation moved this from Testing to Release 1.2.0 Aug 12, 2020
@javierm javierm deleted the banner_margin branch August 12, 2020 16:25
@javierm javierm removed the 1.2 label Aug 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Broken banner styles for some pages
2 participants