mirror of
https://github.com/zen-browser/desktop.git
synced 2025-09-05 19:08:18 +00:00
Add feature: Prepend '#' to custom colours for themes
This commit is contained in:
@@ -363,13 +363,16 @@
|
||||
}
|
||||
|
||||
async addCustomColor() {
|
||||
let color = this.customColorInput.value;
|
||||
|
||||
const color = this.customColorInput.value;
|
||||
if (!color) {
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Add '#' prefix if it's missing and the input appears to be a hex color
|
||||
if (!color.startsWith('#') && /^[0-9A-Fa-f]{3,6}$/.test(color)) {
|
||||
color = '#' + color;
|
||||
}
|
||||
|
||||
// can be any color format, we just add it to the list as a dot, but hidden
|
||||
const dot = document.createElement('div');
|
||||
|
Reference in New Issue
Block a user