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 content and line-height in SVG font icons #4578

Merged
merged 2 commits into from
Jul 2, 2021
Merged

Conversation

javierm
Copy link
Member

@javierm javierm commented Jul 2, 2021

References

Background

In commit 4d49ec8 we replaced an @extend .fa- clause with a content: fa-content() clause.

With the @extend clause, the content: property appeared wherever the .fa- selector was defined, so we later overwrote it in our %svg-icon selector, which was defined later in the generated CSS.

Defining the property with content: fa-content(), on the other hand, caused the content: property to appear wherever we used the mixin with @include has-fa-icon. That meant our %svg-icon selector would appear before it, and would not overwrite it.

Objectives

  • Make sure SVG icons don't have an illegible character as content
  • Fix a line-height issue with SVG icons
  • Include font awesome mixins again so they're available to other Consul installations

Visual changes

Before these changes

There's a blank space between the bottom of the admin menu and the bottom of the browser window

After these changes

There's no blanck space between the bottom of the admin menu and the bottom of the browser window

Notes

We could modify a few things and make the code more complicate in order to avoid that. In this case, however, it's easier to add an !important flag; after all, it is indeed important that SVG icons have no content so screen readers don't try to announce illegible characters.

In commit 4d49ec8 we replaced an `@extend .fa-` clause with a
`content: fa-content()` clause.

With the `@extend` clause, the `content:` property appeared wherever the
`.fa-` selector was defined, so we later overwrote it in our `%svg-icon`
selector, which was defined later in the generated CSS.

Defining the property with `content: fa-content()`, on the other hand,
caused the `content:` property to appear wherever we used the mixin with
`@include has-fa-icon`. That meant our `%svg-icon` selector would appear
before it, and would not overwrite it.

We could modify a few things and make the code more complicate in order
to avoid that. In this case, however, it's easier to add an `!important`
flag; after all, it is indeed important that SVG icons have no content
so screen readers don't try to announce illegible characters.
@javierm javierm added the Bug label Jul 2, 2021
@javierm javierm self-assigned this Jul 2, 2021
@javierm javierm added this to Reviewing in Consul Democracy via automation Jul 2, 2021
We forgot to include this property when replacing our use of `%fa-icon`,
and it was causing the admin menu to have a blank space at the bottom.

So we're including it again to make sure nothing else breaks because of
this omition.
@javierm javierm changed the title Fix content property in SVG font icons Fix content and line-height in SVG font icons Jul 2, 2021
Consul Democracy automation moved this from Reviewing to Testing Jul 2, 2021
@javierm javierm merged commit 9f0858a into master Jul 2, 2021
@javierm javierm deleted the fix_font_icon_content branch July 2, 2021 17:16
Consul Democracy automation moved this from Testing to Release 1.4.0 Jul 2, 2021
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.

None yet

2 participants