Skip to content

Typography components with <hX> tags color is being defined by WP Core styles #11159

@benbowler

Description

@benbowler

Bug Description

First noted by @kelvinballoo as part of the QA, h1 and h2 titles have the wrong color in some cases.

Looking at this in more detail, after removing the googlesitekit-heading-X classes, the WP Core styles for headings take precedence:

eg. for the "Settings" heading on the main plugin settings page the color is being taken from the WP Core styles for h1 tags.

Image Image

The expected behaviour for headings without a specific color override would be to take the default color defined in on the .googlesitekit-plugin class:

However the heading tag styles are higher specificity that this general class.


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • The plugin default styles should define a default font color for each heading tag h1, h2, h3, h4, h5, h6 with higher specificity than the WordPress heading styles based on the plugin design guidelines.
  • Typography components which use these heading tags, which have no additional style overrides, should display with these default font colors in the dashboard.

Implementation Brief

  • Update assets/sass/base/_defaults.scss:
    • Remove the previous definitions of h3 and h6 styles as these should all be handled by the typography styles now:
    • h3,
      h6 {
      color: $c-surfaces-on-surface;
      font-family: $f-secondary;
      line-height: 1.16;
      }
    • Add a css block for h1, h2, h3, h4, h5 and h6, setting only color: $c-primary; as all other styles are handled by the Typography component.

Test Coverage

  • Some VRTs may need to be updated, no addition test coverage required.

QA Brief

  • Verify that Settings heading in settings screens (as reported in the issue) has primary color (#161b18)
  • Do a general smoke testing

Changelog entry

  • Fix color issues for hX tags created by the Typography component.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Medium priorityTeam SIssues for Squad 1Type: BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions