Skip to content

Commit e264750

Browse files
authored
refactor: Remove Font Awesome dependency and use inline SVGs (#69)
- Replaced Font Awesome with custom inline SVGs for social and external link icons. - Removed `@fortawesome/fontawesome-free` package and related SCSS imports. - Updated CSP rules to support additional Google Analytics domains. - Adjusted social link icon styles using filters for consistency. - Simplified Webpack configuration for SVG handling.
1 parent 5f59683 commit e264750

File tree

10 files changed

+11
-37
lines changed

10 files changed

+11
-37
lines changed

package-lock.json

Lines changed: 0 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
"webpack-dev-server": "^5.0.0"
5555
},
5656
"dependencies": {
57-
"@fortawesome/fontawesome-free": "^6.7.1",
5857
"firebase": "^11.0.0"
5958
}
6059
}
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading

src/scss/_fontawesome.scss

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/scss/index.scss

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
@use "poppins";
2-
@use "fontawesome";
32
@use "variables" as *;
43

54
// Reset
@@ -97,22 +96,18 @@ h1 {
9796
.clazz-social-link-container {
9897
a {
9998
display: inline-block;
100-
color: $primary-color;
99+
filter: brightness(0) saturate(100%) invert(34%) sepia(3%) saturate(2463%) hue-rotate(176deg) brightness(90%) contrast(90%);
101100
padding: calc($gap /2 ) $gap;
102101
transition: color 0.3s ease;
103102
&:visited {
104-
color: $primary-color;
103+
filter: brightness(0) saturate(100%) invert(34%) sepia(3%) saturate(2463%) hue-rotate(176deg) brightness(90%) contrast(90%);
105104
}
106105
&:hover {
107-
color: $hover-color;
106+
filter: brightness(0) saturate(100%) invert(60%) sepia(53%) saturate(460%) hue-rotate(94deg) brightness(88%) contrast(94%);
108107
}
109108
}
110109
}
111110

112-
.fa-2xl {
113-
line-height: 1;
114-
}
115-
116111
// Footer
117112
footer {
118113
display: flex;

src/views/index.ejs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
<meta property="og:image:height" content="1269" />
1818
<link rel="preload" href="../assets/fonts/Poppins-Bold-latin.woff2" as="font" type="font/woff2" crossorigin />
1919
<link rel="preload" href="../assets/fonts/Poppins-Regular-latin.woff2" as="font" type="font/woff2" crossorigin />
20-
<link rel="preload" href="../../node_modules/@fortawesome/fontawesome-free/webfonts/fa-brands-400.woff2" as="font" type="font/woff2" crossorigin />
21-
<link rel="preload" href="../../node_modules/@fortawesome/fontawesome-free/webfonts/fa-solid-900.woff2" as="font" type="font/woff2" crossorigin />
2220
<link rel="canonical" href="<%- baseUrl %>" />
2321
<script type="application/ld+json">
2422
{
@@ -56,13 +54,13 @@
5654
<% socialLinks.forEach(function(link) { %>
5755
<div class="clazz-social-link-container">
5856
<a href="<%- link.url %>" aria-label="Visit <%= link.name %>" target="_blank" rel="noopener noreferrer ugc">
59-
<i class="fa-brands fa-<%- link.icon %> fa-2xl"></i>
57+
<%- include(`../assets/images/fa6-brands-${link.icon}.svg`) %>
6058
</a>
6159
</div>
6260
<% }); %>
6361
<div class="clazz-social-link-container">
6462
<a class="clazz-copy-link" href="#" aria-label="Copy link" rel="noopener">
65-
<i class="fa-solid fa-arrow-up-right-from-square fa-2xl"></i>
63+
<%- include(`../assets/images/fa6-solid-arrow-up-right-from-square.svg`) %>
6664
</a>
6765
</div>
6866
</div>

webpack.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ module.exports = {
4545
module: {
4646
rules: [
4747
{
48-
test: /\.(png|jpg|jpeg|gif|svg|webp)$/i,
48+
test: /\.(png|jpg|jpeg|gif|webp)$/i,
4949
type: 'asset/resource',
5050
},
5151
{
@@ -189,7 +189,7 @@ module.exports = {
189189
'style-src': ["'self'"],
190190
'img-src': ["'self'"],
191191
'font-src': ["'self'"],
192-
'connect-src': ["'self'", "https://google-analytics.com", "https://firebase.googleapis.com", "https://firebaseinstallations.googleapis.com"],
192+
'connect-src': ["'self'", "https://*.google-analytics.com", "https://firebase.googleapis.com", "https://firebaseinstallations.googleapis.com"],
193193
},
194194
{
195195
hashingMethod: 'sha256',

0 commit comments

Comments
 (0)