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

Pull in bookmark icon in a less intrusive way #9

Closed
longhotsummer opened this issue Oct 18, 2021 · 1 comment · Fixed by #271
Closed

Pull in bookmark icon in a less intrusive way #9

longhotsummer opened this issue Oct 18, 2021 · 1 comment · Fixed by #271

Comments

@longhotsummer
Copy link
Contributor

Currently (see #4) we pull in the bookmark icon when decorating internal refs by linking to the entire fontawesome CSS.
There's got to be a cleaner way to do this that doesn't trample on any existing fontawesome icons used in the site.

Is there a better way to do this? We can pull in an SVG from fontawesome, can we easily inject that into CSS using :after etc.?

@longhotsummer
Copy link
Contributor Author

We can use this SVG directly in CSS and not pull in everything:

.whatever::before {
  display: inline-block;
  content: "";
  vertical-align: -.125em;
  background-image: url("data:image/svg+xml,<svg viewBox='0 0 16 16' fill='%23333' xmlns="http://www.w3.org/2000/svg"><path d="M2 2v13.5a.5.5 0 0 0 .74.439L8 13.069l5.26 2.87A.5.5 0 0 0 14 15.5V2a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2z"/></svg>");
  background-repeat: no-repeat;
  background-size: 1rem 1rem;
}

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 a pull request may close this issue.

1 participant