-
Notifications
You must be signed in to change notification settings - Fork 30
New command: android-png-icons #1184
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
base: main
Are you sure you want to change the base?
Conversation
|
cc: @Olipro |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great - once security has okay'd sharp lets land it!
Usage: npm run android-png-icons -- <icon_name.svg> [new_color]
8ce6d41 to
7865dff
Compare
|
👋 Thanks for Submitting! This PR is available for preview at the link below. ✅ PR tip preview: https://1184.pr.nala.bravesoftware.com/ - ./tokens/css/variables-android.old.css: 7390 bytes
+ ./tokens/css/variables-android.css: 7390 bytes
---
- ./tokens/css/variables-browser.old.css: 6644 bytes
+ ./tokens/css/variables-browser.css: 6644 bytes
---
- ./tokens/css/variables-ios.old.css: 8180 bytes
+ ./tokens/css/variables-ios.css: 8180 bytes
---
- ./tokens/css/variables-marketing.old.css: 13501 bytes
+ ./tokens/css/variables-marketing.css: 13501 bytes
---
- ./tokens/css/variables-news.old.css: 526 bytes
+ ./tokens/css/variables-news.css: 526 bytes
---
- ./tokens/css/variables-newtab.old.css: 1933 bytes
+ ./tokens/css/variables-newtab.css: 1933 bytes
---
- ./tokens/css/variables-search.old.css: 2409 bytes
+ ./tokens/css/variables-search.css: 2409 bytes
---
- ./tokens/css/variables-web3.old.css: 893 bytes
+ ./tokens/css/variables-web3.css: 893 bytes
---
- ./tokens/css/variables.old.css: 124825 bytes
+ ./tokens/css/variables.css: 124825 bytes
Variables Diff: variables-android.diff--- ./tokens/css/variables-android.old.css 2025-09-10 12:03:15.177357019 +0000
+++ ./tokens/css/variables-android.css 2025-09-10 12:02:38.317892103 +0000
@@ -1,6 +1,6 @@
/**
* Do not edit directly
- * Generated on Mon Sep 08 2025 21:39:49 GMT+0000 (Coordinated Universal Time)
+ * Generated on Wed Sep 10 2025 12:02:38 GMT+0000 (Coordinated Universal Time)
*/
:root {
Variables Diff: variables-browser.diff--- ./tokens/css/variables-browser.old.css 2025-09-10 12:03:15.588362169 +0000
+++ ./tokens/css/variables-browser.css 2025-09-10 12:02:38.306891960 +0000
@@ -1,6 +1,6 @@
/**
* Do not edit directly
- * Generated on Mon Sep 08 2025 21:39:49 GMT+0000 (Coordinated Universal Time)
+ * Generated on Wed Sep 10 2025 12:02:38 GMT+0000 (Coordinated Universal Time)
*/
:root {
Variables Diff: variables-ios.diff--- ./tokens/css/variables-ios.old.css 2025-09-10 12:03:15.821365084 +0000
+++ ./tokens/css/variables-ios.css 2025-09-10 12:02:38.332892299 +0000
@@ -1,6 +1,6 @@
/**
* Do not edit directly
- * Generated on Mon Sep 08 2025 21:39:49 GMT+0000 (Coordinated Universal Time)
+ * Generated on Wed Sep 10 2025 12:02:38 GMT+0000 (Coordinated Universal Time)
*/
:root {
Variables Diff: variables-marketing.diff--- ./tokens/css/variables-marketing.old.css 2025-09-10 12:03:16.067368167 +0000
+++ ./tokens/css/variables-marketing.css 2025-09-10 12:02:38.349892520 +0000
@@ -1,6 +1,6 @@
/**
* Do not edit directly
- * Generated on Mon Sep 08 2025 21:39:49 GMT+0000 (Coordinated Universal Time)
+ * Generated on Wed Sep 10 2025 12:02:38 GMT+0000 (Coordinated Universal Time)
*/
:root {
Variables Diff: variables-news.diff--- ./tokens/css/variables-news.old.css 2025-09-10 12:03:16.307371174 +0000
+++ ./tokens/css/variables-news.css 2025-09-10 12:02:38.382892951 +0000
@@ -1,6 +1,6 @@
/**
* Do not edit directly
- * Generated on Mon Sep 08 2025 21:39:49 GMT+0000 (Coordinated Universal Time)
+ * Generated on Wed Sep 10 2025 12:02:38 GMT+0000 (Coordinated Universal Time)
*/
:root {
Variables Diff: variables-newtab.diff--- ./tokens/css/variables-newtab.old.css 2025-09-10 12:03:16.522373868 +0000
+++ ./tokens/css/variables-newtab.css 2025-09-10 12:02:38.389893042 +0000
@@ -1,6 +1,6 @@
/**
* Do not edit directly
- * Generated on Mon Sep 08 2025 21:39:49 GMT+0000 (Coordinated Universal Time)
+ * Generated on Wed Sep 10 2025 12:02:38 GMT+0000 (Coordinated Universal Time)
*/
:root {
Variables Diff: variables-search.diff--- ./tokens/css/variables-search.old.css 2025-09-10 12:03:16.729376459 +0000
+++ ./tokens/css/variables-search.css 2025-09-10 12:02:38.377892886 +0000
@@ -1,6 +1,6 @@
/**
* Do not edit directly
- * Generated on Mon Sep 08 2025 21:39:49 GMT+0000 (Coordinated Universal Time)
+ * Generated on Wed Sep 10 2025 12:02:38 GMT+0000 (Coordinated Universal Time)
*/
:root {
Variables Diff: variables-web3.diff--- ./tokens/css/variables-web3.old.css 2025-09-10 12:03:16.842377876 +0000
+++ ./tokens/css/variables-web3.css 2025-09-10 12:02:38.393893094 +0000
@@ -1,6 +1,6 @@
/**
* Do not edit directly
- * Generated on Mon Sep 08 2025 21:39:49 GMT+0000 (Coordinated Universal Time)
+ * Generated on Wed Sep 10 2025 12:02:38 GMT+0000 (Coordinated Universal Time)
*/
@media (prefers-color-scheme: light) {
Variables Diff: variables.diff--- ./tokens/css/variables.old.css 2025-09-10 12:03:17.181382124 +0000
+++ ./tokens/css/variables.css 2025-09-10 12:02:38.177890277 +0000
@@ -1,6 +1,6 @@
/**
* Do not edit directly
- * Generated on Mon Sep 08 2025 21:39:49 GMT+0000 (Coordinated Universal Time)
+ * Generated on Wed Sep 10 2025 12:02:38 GMT+0000 (Coordinated Universal Time)
*/
:root {
|
| import path from 'path' | ||
| import sharp from 'sharp' | ||
|
|
||
| const ICONS_FOLDER = 'icons/' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, so this will only resolve when the script is run from the root dir of leo - I think the other scripts get away with this 'cause they're always run as part of the prepare script, but yours will end up being run by a target in brave-core.
We should make sure this path is relative to this script, rather than the CWD:
// something like this, I think
const filename = fileURLToPath(import.meta.url)
const dirname = path.dirname(filename)
const iconsFolder = path.join(dirname, '..', '..', 'icons')
This repository has all icons set in svg format.
Now there is already
android-iconscommand which is applied duringbuildcommand and it generates Android xml drawable.The moment here that Chromium still has bunch of icons which are still png bitmaps. If we need to replace them with own images, we should use also the same format to avoid bunch of direct gn/gni patches.
This PR adds command
android-png-iconswhich converts svg into pngs ofxxxhdpi/xxhdpi/xhdpi/hdpi/mdpiresolutions.Example
generates these files ready to replace the Chromium's pngs