Problem/Motivation

I created #2400233: Add reusable heading classes to Bartik for Bartik to apply part of the existing work in this Seven issue #2028053: Add typographic styles, components, and utility classes. From looking at the CSS I realised that the classes "header-a", "header-b" etc were used instead of "heading-a", "heading-b" for the reusable heading classes. These are definitely heading classes and nothing to do with header, so the naming was a mistake that was never picked up on.

From Seven's elements.css

h1,
h2,
h3,
h4,
h5,
h6,
.header-a,
.header-b,
.header-c,
.header-d,
.header-e,
.header-f {
  font-weight: bold;
  margin: 10px 0;
}

Documentation to back up my point https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements

Proposed resolution

To make the default themes consistent and provide a unified good example in core for contrib themes, we should amend the class names in Seven.

Please change all instances of "header-..." to "heading-..."

Remaining tasks

Write a patch.
Review the patch.

User interface changes

none

API changes

n/a

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Task because Seven's UI is not broken because of this, it's just fixing the naming convention of the code.
Issue priority Not critical because it's a code cleanup task but needed to keep Seven and Bartik consistent and a good example for contrib.
Unfrozen changes Unfrozen because it only changes CSS
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

emma.maria’s picture

Issue summary: View changes
emma.maria’s picture

Issue summary: View changes
er.pushpinderrana’s picture

Status: Active » Needs review
FileSize
805 bytes

Changed all instances of "header-..." to "heading-..." in attached patch.

emma.maria’s picture

Issue summary: View changes
emma.maria’s picture

Status: Needs review » Reviewed & tested by the community

The patch applies cleanly with no errors and contains all of the work required and there are no other instances of .header- in Seven. Thanks @er.pushpinderrana!

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/themes/seven/css/base/elements.css
@@ -36,37 +36,37 @@ h3,
-.header-a,
-.header-b,
-.header-c,
-.header-d,
-.header-e,
-.header-f {
+.heading-a,
+.heading-b,
+.heading-c,
+.heading-d,
+.heading-e,
+.heading-f {

Considering these classes are not used perhaps a comment is order to explain why we have them - so we won't remove them in some clean up.

Katiemouse’s picture

Status: Needs work » Needs review
Issue tags: +CatalystAcademy
FileSize
1.04 KB
553 bytes

Hi, I am in high school and this is my first contribution to Drupal core. I have tried to do the suggested comment above. Attached is the patch and interdiff. :)

gvso’s picture

Hi @Katiemouse! Great to hear that, let's wait for @alexpott. Did you notice that #2400233 needs the same? So, that can be your second contribution :)

Katiemouse’s picture

Thank you :) I'm working on it now :)

LewisNyman’s picture

Status: Needs review » Needs work
  1. +++ b/core/themes/seven/css/base/elements.css
    @@ -36,37 +36,44 @@ h3,
    + * Classes '.heading-a' - '.heading-f' are not currently in use; they are still
    + * included in stylesheet to keep Seven and Bartik consistent and good examples
    + * of easy to configure base styles.
    

    I am being picky but I would like to change the comment here. I think they will be used in the future so maybe we should just define their purpose instead of just that they aren't used.

    How about:
    "Reusable heading classes are included to help modules change the styling of headings on a page without affecting accessibility."

  2. +++ b/core/themes/seven/css/base/elements.css
    @@ -36,37 +36,44 @@ h3,
    + * @see https://www.drupal.org/node/2400233
    

    I don't think we need to link to the other issue.

Also, I've never seen us place a comment between selectors, can we put it above the h1, h2, h3 selectors please? Thanks!

emma.maria’s picture

Status: Needs work » Needs review
FileSize
1 KB
777 bytes

This issue hasn't moved in a while.

Here's a new patch and interdiff. I have changed the comment text as per #10 and moved the comment above the selectors with a space above as per the CSS formatting standards.

LewisNyman’s picture

Status: Needs review » Reviewed & tested by the community

Perfect, thank you.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 11: drupal8-reuse-heading-class-2402061-11.patch, failed testing.

emma.maria’s picture

Status: Needs work » Reviewed & tested by the community

Putting the status back as testbot had a wobbly.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

CSS changes are not subject to beta evaluation. Committed 7500715 and pushed to 8.0.x. Thanks!

  • alexpott committed 7500715 on 8.0.x
    Issue #2402061 by emma.maria, Katiemouse, er.pushpinderrana: Reusable...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.