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 octicon sizing #1132

Merged
merged 2 commits into from
Mar 29, 2020
Merged

Fix octicon sizing #1132

merged 2 commits into from
Mar 29, 2020

Conversation

dvrylc
Copy link
Contributor

@dvrylc dvrylc commented Mar 17, 2020

• [X] Bug fix

Fixes #1096.

What is the rationale for this request?

Currently, icons are sized by using CSS classes (fa-2x for example) that set the font-size property. Since octicons are not font-based but rather SVG-based, this style does not affect them, causing them to be incorrectly sized.

Screen Shot 2020-03-17 at 11 50 59 PM

Screen Shot 2020-03-18 at 11 30 36 AM

What changes did you make? (Give an overview)

This PR sets the height and width for octicons to 1em, allowing them to inherit their parent container's font size as its dimensions.

Screen Shot 2020-03-17 at 11 51 40 PM

Screen Shot 2020-03-18 at 11 29 59 AM

Testing instructions:

  1. Use an octicon where you would expect it to be a different size. Some examples are:
    • Headings
    • Box icon with a custom icon-size
  2. The size of the octicon should match where it's used

Credits

Proposed commit message: (wrap lines at 72 characters)

Fix octicon sizing

@ang-zeyu
Copy link
Contributor

How about simply

.octicon {
  width: 1em,
  height: 1em,
}

?

This would allow it to be responsive in any container instead of just headings.
It would likely fix #1128 as well

@dvrylc
Copy link
Contributor Author

dvrylc commented Mar 18, 2020

.octicon {
  width: 1em,
  height: 1em,
}

Oh right that makes sense, thanks!

@dvrylc dvrylc changed the title Fix sizes for octicons in headings Fix octicon sizing Mar 18, 2020
@yamgent yamgent merged commit de21751 into MarkBind:master Mar 29, 2020
@yamgent yamgent added this to the v2.12.1 milestone Mar 29, 2020
marvinchin pushed a commit that referenced this pull request Apr 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Octicons: support icon-size property
3 participants