-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TASK] Create consumable icons for chrome and use them
The generate-icons.js takes care of the different pngs created using sharp, while on it also changed the lit imports so no warning about deprecated imports is thrown which was caused an error in chrome.
- Loading branch information
Showing
26 changed files
with
669 additions
and
321 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1 @@ | ||
{ | ||
"openButton": { | ||
"message": "Open in GitPod", | ||
"description": "Open current patch in GitPod." | ||
} | ||
} | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
const sharp = require('sharp') | ||
const fs = require('fs') | ||
const path = require('path') | ||
const glob = require('glob') | ||
|
||
const iconsFolder = path.join(__dirname, 'icons/') | ||
const iconsTargetFolder = path.join(__dirname, './dist/icons/') | ||
|
||
// Create target folder if does not exist | ||
const dir = path.join(iconsTargetFolder) | ||
if (!fs.existsSync(dir)) { | ||
fs.mkdirSync(dir, 0o744) | ||
} | ||
|
||
// Get files to process | ||
glob(path.join(iconsFolder, '**/*.svg'), function (er, files) { | ||
files.forEach((file) => { | ||
renderIcon(file) | ||
}) | ||
}) | ||
|
||
// Generate icon sizes | ||
function renderIcon(file, sizes = [48, 96]) { | ||
const filename = path.parse(path.basename(file)) | ||
|
||
sizes.forEach((size) => { | ||
sharp(file) | ||
.rotate() | ||
.resize(size) | ||
.png() | ||
.toFile(path.join(iconsTargetFolder, filename.name + '-' + size + '.png')) | ||
.catch(err => { | ||
console.log('Could not write file ...', err) | ||
}) | ||
}) | ||
} |
File renamed without changes
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
@font-face { | ||
font-family: Share; | ||
src: url("fonts/Share-Regular.woff") format("woff"); | ||
font-weight: normal; | ||
font-style: normal; | ||
font-weight: normal; | ||
src: url('fonts/Share-Regular.woff') format('woff'); | ||
} | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
@function spacer($name) { | ||
@return map-get($spacers, $name); | ||
} | ||
|
||
@function font($name) { | ||
@return map-get($font-sizes, $name); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
@import "font"; | ||
@import "variables"; | ||
@import "mixins"; | ||
@import "functions"; | ||
@import 'font'; | ||
@import 'variables'; | ||
@import 'mixins'; | ||
@import 'functions'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.