Skip to content

Standardize page title bottom margin styling

What does this MR do?

This MR fixes a styling bug / code debt found while working on this MR, where it was breaking the styling on /root/test1/-/wikis/PAGE/history.

It removes the unnecessary and problematic &:last-child from the page-title class in typography.css:

.page-title {
  margin: #{2 * $grid-size} 0;
  line-height: 1.3;
  font-size: 1.25em;
  font-weight: $gl-font-weight-bold;

  &:last-child {
    margin-bottom: 0;
  }

  &.with-button {
    line-height: 34px;
  }

}

This was originally added in this commit.

There's nothing else in the commit, and it's not clear why is was originally needed.

However, it has caused clearly caused problems over the years, and I found two unnecessary workarounds dealing with it, which were able to be deleted.

This change also fixes a couple of other places where it was causing incorrect styling which hadn't been found/addressed.

Summary of changes

  1. Delete the unnecessary last-child style
  2. Delete two unnecessary workarounds for it.
  3. Removes margin-top from two <hr> tags which are directly below page-title elements.

Due Diligence Code Review

Before removing this, it was necessary to identify all the existing places where a .page-title:last-child selector currently matches, and load the page in dev to make sure that the removal of the last-child rule didn't break it.

So, I did a search of the codebase, and all the following were found via a regex search in RubyMine for page-title[^-] with file mask !*css*,!*spec*.

Then, I reviewed every one to see if the relevant element was the last child in the containing element, and came up with the following list, which contains the code location, path in GDK dev, and any relevant explanation.

Existing places where a .page-title:last-child selector currently matches:

The following were found via a regex search in RubyMine for page-title[^-] with file mask !*css*,!*spec*.

Screenshots (strongly suggested)

Here's an example of what the Wiki history page header in this MR will look like unless we make this fix, or add yet another unnecessary workaround:

broken-wiki-history-spacing

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Related Issues and MRs

Edited by Chad Woolley

Merge request reports