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

move footer icons to CSS bg images #3655

Merged
merged 3 commits into from
May 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 23 additions & 8 deletions client/src/ui/organisms/footer/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,31 @@
ul {
padding-inline-start: $base-spacing / 4;
}
}

svg {
height: 18px;
vertical-align: sub;
width: 18px;
.social-icon::before {
background-size: 18px;
content: "";
display: inline-block;
filter: invert(1);
height: 18px;
vertical-align: sub;
width: 18px;
}

path {
fill: #fff;
}
}
.twitter::before {
background: transparent url("~@mdn/dinocons/social/twitter.svg") 0 0
no-repeat;
}

.github::before {
background: transparent url("~@mdn/dinocons/brands/github-mark-small.svg") 0
0 no-repeat;
}

.instagram::before {
background: transparent url("~@mdn/dinocons/social/instagram.svg") 0 0
no-repeat;
}

.footer-license {
Expand Down
21 changes: 8 additions & 13 deletions client/src/ui/organisms/footer/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import * as React from "react";

import { ReactComponent as GithubIcon } from "@mdn/dinocons/brands/github-mark-small.svg";
import { ReactComponent as TwitterIcon } from "@mdn/dinocons/social/twitter.svg";
import { ReactComponent as InstagramIcon } from "@mdn/dinocons/social/instagram.svg";

import { useLocale } from "../../../hooks";
import { Logo } from "../../atoms/logo";
import "./index.scss";
Expand Down Expand Up @@ -76,22 +71,22 @@ export function Footer() {
<ul>
<li>
<a
className="social-icon twitter"
href="https://twitter.com/mozdevnet"
target="_blank"
rel="noopener noreferrer"
aria-label="Twitter"
>
<TwitterIcon />
<span className="visually-hidden">MDN on Twitter</span>
</a>
</li>
<li>
<a
className="social-icon github"
href="https://github.com/mdn/"
target="_blank"
rel="noopener noreferrer"
aria-label="Github"
>
<GithubIcon />
<span className="visually-hidden">MDN on Github</span>
</a>
</li>
</ul>
Expand All @@ -102,22 +97,22 @@ export function Footer() {
<ul>
<li>
<a
className="social-icon github"
href="https://twitter.com/mozilla"
target="_blank"
rel="noopener noreferrer"
aria-label="Twitter"
>
<TwitterIcon />
<span className="visually-hidden">Mozilla on Twitter</span>
</a>
</li>
<li>
<a
className="social-icon instagram"
href="https://www.instagram.com/mozillagram/"
target="_blank"
rel="noopener noreferrer"
aria-label="Instagram"
>
<InstagramIcon />
<span className="visually-hidden">Mozilla on Instagram</span>
</a>
</li>
</ul>
Expand Down