Skip to content

Commit

Permalink
demo: theme-dependant SVG favicon
Browse files Browse the repository at this point in the history
  • Loading branch information
sneas committed Jun 14, 2021
1 parent f17230c commit d29e14c
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
23 changes: 23 additions & 0 deletions public/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<link
rel="icon"
type="image/svg+xml"
href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 width=%22256%22 height=%22256%22 viewBox=%220 0 100 100%22><rect width=%22100%22 height=%22100%22 rx=%220%22 fill=%22%2383a5d5%22></rect><path fill=%22%23fff%22 d=%22M54.22 18.01L54.22 81.99L45.78 81.99L45.78 18.01L54.22 18.01Z%22></path></svg>"
href="<%=require('./favicon.svg')%>"
/>
<link
rel="stylesheet"
Expand Down
7 changes: 7 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ const commonConfig = {
test: /src\/.+\.html/,
loader: 'html-loader',
},
{
test: /favicon\.svg?$/,
loader: 'file-loader',
options: {
esModule: false,
},
},
],
},
resolve: {
Expand Down

0 comments on commit d29e14c

Please sign in to comment.