Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We have widely used heading mixins for setting heading sizes. The
heading-1
-heading-6
mixins set font and line height sizing, and add bottom margin. Theh1
-h6
mixins extend theheading-
mixins and add top margin, and forh4
and up, add responsive styling for mobile sizes.The heading mixins are either used as the standalone headings, or as the extended responsive version. In several uses, the margin of the heading is overridden. This is done by calling the mixin and then adding a separate margin property below the mixin to override the mixin. Additionally, rarely the text weight also gets overridden (e.g. on the h2 on the homepage 50-50 hero).
Sass has deprecated placing declarations below mixins (see https://sass-lang.com/documentation/breaking-changes/mixed-decls/), to align with the direction the CSS standard is going. We can still do this by wrapping the declaration in
& { … }
, but ultimately this generates a redundant selector block, so it's probably best to refactor things so that the mixins can be placed last.This PR merges the
h1
-h6
mixins into theheading-1
-heading-6
mixins so there is only one set of heading mixins to be dealing with. It makes these mixins take several arguments to remove the top or bottom margin, specify if its responsive or not (if it's heading-4 or larger), and whether the font-weight can be adjusted (if it'sheading-2
-heading-4
—this is based on real-world usage of this override).Changes
h1
-h6
mixins and merge them into theheading-1
-heading-6
mixins.Testing
At minimum
@include h1
-@include h6
should map to@include heading-1
-@include heading-6
.@include heading-1
-@include heading-4
, should map to@include heading-1($is-responsive: false)
-@include heading-4($is-responsive: false)
.Heading 5 and 6 don't have responsive styles, so
@include heading-5
/@include heading-6
should be unchanged.Notes