Skip to content

Commit

Permalink
Remove retired theme aliases (mdn#430)
Browse files Browse the repository at this point in the history
* Remove required theme aliases

Replaced uses of headerURL, accentcolor, and textcolor with theme_frame, frame, and tab_background_text. Tested and confirmed all extensions working as expected.

* Fixed another reference to headerURL

Co-authored-by: Richard Bloor <rbloor@atlassian.com>
  • Loading branch information
rebloor and Richard Bloor authored Mar 24, 2020
1 parent 177f603 commit 0d46482
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 16 deletions.
12 changes: 6 additions & 6 deletions dynamic-theme/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ var currentTheme = '';
const themes = {
'day': {
images: {
headerURL: 'sun.jpg',
theme_frame: 'sun.jpg',
},
colors: {
accentcolor: '#CF723F',
textcolor: '#111',
frame: '#CF723F',
tab_background_text: '#111',
}
},
'night': {
images: {
headerURL: 'moon.jpg',
theme_frame: 'moon.jpg',
},
colors: {
accentcolor: '#000',
textcolor: '#fff',
frame: '#000',
tab_background_text: '#fff',
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion examples.json
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@
"name": "theme-switcher"
},
{
"description": "A collection of themes illustrating:<ul><li>weta_fade: a basic theme employing a single image specified in <code>headerURL:</code>.</li><li>weta_fade_chrome: the weta_fade theme implemented with Chrome compatible manifest keys.</li><li>weta_tiled: a theme using a tiled image.</li><li>weta_mirror: a theme using multiple images and aligning those images in the header.</li><li>animated: use of an animated PNG.</li></ul>",
"description": "A collection of themes illustrating:<ul><li>weta_fade: a basic theme employing a single image specified in <code>theme_frame:</code>.</li><li>weta_fade_chrome: the weta_fade theme implemented with Chrome compatible manifest keys.</li><li>weta_tiled: a theme using a tiled image.</li><li>weta_mirror: a theme using multiple images and aligning those images in the header.</li><li>animated: use of an animated PNG.</li></ul>",
"javascript_apis": [],
"name": "themes"
},
Expand Down
6 changes: 3 additions & 3 deletions private-browsing-theme/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ function themeWindow(window) {
if (window.incognito) {
browser.theme.update(window.id, {
images: {
headerURL: "",
theme_frame: "",
},
colors: {
accentcolor: "black",
textcolor: "white",
frame: "black",
tab_background_text: "white",
toolbar: "#333",
toolbar_text: "white"
}
Expand Down
2 changes: 1 addition & 1 deletion theme-integrated-sidebar/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ How to use the browser.theme.getCurrent(), browser.theme.onUpdated and the sideb

## Instructions to try this

- Install a WebExtension theme that sets `accentcolor`, `toolbar` or `toolbar_text`
- Install a WebExtension theme that sets `frame`, `toolbar` or `toolbar_text`
- Install this extension
- The sidebar should then use colors from the WebExtension theme
5 changes: 2 additions & 3 deletions theme-integrated-sidebar/sidebar.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
function setSidebarStyle(theme) {
const myElement = document.getElementById("myElement");

// colors.frame and colors.accentcolor are aliases
if (theme.colors && (theme.colors.accentcolor || theme.colors.frame)) {
if (theme.colors && theme.colors.frame) {
document.body.style.backgroundColor =
theme.colors.accentcolor || theme.colors.frame;
theme.colors.frame;
} else {
document.body.style.backgroundColor = "white";
}
Expand Down
2 changes: 1 addition & 1 deletion themes/animated/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## What it does

Employs an animated PNG image as the headerURL image in a theme.
Employs an animated PNG image as the theme_frame image in a theme.

## What it shows

Expand Down
2 changes: 1 addition & 1 deletion themes/weta_fade/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## What it does

Employs a PNG image as the headerURL image in a theme.
Employs a PNG image as the theme_frame image in a theme.

## What it shows

Expand Down

0 comments on commit 0d46482

Please sign in to comment.