Skip to content
This repository has been archived by the owner on Feb 24, 2018. It is now read-only.

Commit

Permalink
WebExt: Add minimal sidebar which is able to load+change CSS accordin…
Browse files Browse the repository at this point in the history
…g to settings (darrinhenein#13)
  • Loading branch information
Croydon committed Apr 30, 2017
1 parent 329adea commit fa51ec4
Show file tree
Hide file tree
Showing 14 changed files with 445 additions and 70 deletions.
10 changes: 2 additions & 8 deletions lib/verticaltabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@
var ioServices = require("resource://gre/modules/Services.jsm").Services.io;
var stylesheetUtils = require("sdk/stylesheet/utils");

//var tabsSDK = require("sdk/tabs");
//var tabsUtils = require("sdk/tabs/utils");
//var contentMod = require("sdk/content/mod");
//var Style = require("sdk/stylesheet/style").Style;

const NS_XUL = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
const TAB_DROP_TYPE = "application/x-moz-tabbrowser-tab";

Expand All @@ -29,7 +24,6 @@ var VerticalTabsReloaded = class VerticalTabsReloaded
this.window = window;
this.document = window.document;
this.webExtPreferences = webExtPreferences;
this.parsedStyle = undefined;
this.changedDisplayState = false;
this.unloaders = [];
this.init();
Expand Down Expand Up @@ -72,14 +66,14 @@ var VerticalTabsReloaded = class VerticalTabsReloaded
{
uri = ioServices.newURI(uri, null, null);
stylesheetUtils.loadSheet(this.window, uri);
this.debugOutput(uri);
// this.debugOutput(uri);
}

removeStylesheet(uri)
{
uri = ioServices.newURI(uri, null, null);
stylesheetUtils.removeSheet(this.window, uri);
this.debugOutput(uri);
// this.debugOutput(uri);
}

applyThemeStylesheet()
Expand Down
2 changes: 0 additions & 2 deletions webextension/data/status.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");

/**
* Tab's status color blind variant.
Expand Down
27 changes: 13 additions & 14 deletions webextension/data/template/basic/template_example.css
Original file line number Diff line number Diff line change
@@ -1,50 +1,49 @@
@import "../../template/basic/index.css";
@import "modifications.css";
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");

:root {
/* Tabbrowser */
--vtr-tabbrowser-background-color: #424F5A;

/* Tabbar, only used if no Firefox Theme installed */
--vtr-tabbar-height: 24px;
--vtr-tabbar-background-color: #f1f1f1;
--vtr-tabbar-background-color: #f1f1f1;

/* Single tab */
--vtr-tab-text-color: #fbfbfb;
--vtr-tab-background: transparent;
--vtr-tab-height: 28px;
--vtr-tab-min-height: 28px;
--vtr-tab-max-height: 28px;
--vtr-tab-height: 28px;
--vtr-tab-min-height: 28px;
--vtr-tab-max-height: 28px;
--vtr-tab-border: 0;
--vtr-tab-border-radius: 0;
--vtr-tab-border-left: 4px solid transparent;
--vtr-tab-border-bottom: 1px solid #5E6972;

/* Single tab selected */
--vtr-tab-selected-text-color: #fbfbfb;
--vtr-tab-selected-background: #343F48;
--vtr-tab-selected-font-weight: 600;
--vtr-tab-selected-text-shadow: none;
--vtr-tab-selected-border-left: 4px solid #ff9500;
--vtr-tab-selected-border-radius: 0;

/* Single tab pinned */
--vtr-tab-pinned-text-color: #fbfbfb;
--vtr-tab-pinned-background: #343F48;
--vtr-tab-pinned-font-weight: 600;
--vtr-tab-pinned-text-shadow: none;
--vtr-tab-pinned-border-left: 4px solid #ff9500;
--vtr-tab-pinned-border-radius: 0;
--vtr-tab-pinned-border-radius: 0;

/* Single tab hover */
--vtr-tab-hover-background: #5E6972;

/* Splitter/Separation between tabbar and website */
--vtr-splitter-background: #d6e5f5;
--vtr-splitter-width: 3px;
--vtr-splitter-border-left-size: 1px;
--vtr-splitter-border-left-color: #fcfcfc;
--vtr-splitter-border-left-color: #fcfcfc;
--vtr-splitter-border-right-size: 1px;
--vtr-splitter-border-right-color: #fcfcfc;
--vtr-splitter-border-right-color: #fcfcfc;
}
4 changes: 1 addition & 3 deletions webextension/data/theme/base.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");

/* Style the scrollbox for vertical arrangements. */
.tabbrowser-arrowscrollbox > scrollbox {
overflow-x: hidden !important;
Expand Down Expand Up @@ -93,7 +91,7 @@
.tabbrowser-tab:not([busy]) .tab-icon-image:not([src]):not([pinned]) {
display: -moz-box;
}

/* Make room for the close/max/min button on the right of the window */
/* XXX this should probably be per-OS, yes? */
/* XXX if I was smarter I'd find a way to make a swoop on the right side of the bar, under the window buttons */
Expand Down
27 changes: 13 additions & 14 deletions webextension/data/theme/dark/index.css
Original file line number Diff line number Diff line change
@@ -1,50 +1,49 @@
@import "../../template/basic/index.css";
@import "modifications.css";
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");

:root {
/* Tabbrowser */
--vtr-tabbrowser-background-color: #424F5A;

/* Tabbar, only used if no Firefox Theme installed */
--vtr-tabbar-height: 24px;
--vtr-tabbar-background-color: #f1f1f1;
--vtr-tabbar-background-color: #f1f1f1;

/* Single tab */
--vtr-tab-text-color: #fbfbfb;
--vtr-tab-background: transparent;
--vtr-tab-height: 28px;
--vtr-tab-min-height: 28px;
--vtr-tab-max-height: 28px;
--vtr-tab-height: 28px;
--vtr-tab-min-height: 28px;
--vtr-tab-max-height: 28px;
--vtr-tab-border: 0;
--vtr-tab-border-radius: 0;
--vtr-tab-border-left: 4px solid transparent;
--vtr-tab-border-bottom: 1px solid #5E6972;

/* Single tab selected */
--vtr-tab-selected-text-color: #fbfbfb;
--vtr-tab-selected-background: #343F48;
--vtr-tab-selected-font-weight: 600;
--vtr-tab-selected-text-shadow: none;
--vtr-tab-selected-border-left: 4px solid #ff9500;
--vtr-tab-selected-border-radius: 0;

/* Single tab pinned */
--vtr-tab-pinned-text-color: #fbfbfb;
--vtr-tab-pinned-background: #343F48;
--vtr-tab-pinned-font-weight: 600;
--vtr-tab-pinned-text-shadow: none;
--vtr-tab-pinned-border-left: 4px solid #2292D0;
--vtr-tab-pinned-border-radius: 0;
--vtr-tab-pinned-border-radius: 0;

/* Single tab hover */
--vtr-tab-hover-background: #5E6972;

/* Splitter/Separation between tabbar and website */
--vtr-splitter-background: #343F48;
--vtr-splitter-width: 3px;
--vtr-splitter-border-left-size: 0;
--vtr-splitter-border-left-color: #343F48;
--vtr-splitter-border-left-color: #343F48;
--vtr-splitter-border-right-size: 0;
--vtr-splitter-border-right-color: #343F48;
--vtr-splitter-border-right-color: #343F48;
}
2 changes: 0 additions & 2 deletions webextension/data/theme/darwin/index.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");

#nav-bar {
box-shadow: none;
}
Expand Down
25 changes: 12 additions & 13 deletions webextension/data/theme/light/index.css
Original file line number Diff line number Diff line change
@@ -1,50 +1,49 @@
@import "../../template/basic/index.css";
@import "modifications.css";
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");

:root {
/* Tabbrowser */
--vtr-tabbrowser-background-color: #FBFBFB;

/* Tabbar, only used if no Firefox Theme installed */
--vtr-tabbar-height: 24px;
--vtr-tabbar-background-color: #f1f1f1;
--vtr-tabbar-background-color: #f1f1f1;

/* Single tab */
--vtr-tab-text-color: #333333;
--vtr-tab-background: transparent;
--vtr-tab-height: 28px;
--vtr-tab-min-height: 28px;
--vtr-tab-max-height: 28px;
--vtr-tab-height: 28px;
--vtr-tab-min-height: 28px;
--vtr-tab-max-height: 28px;
--vtr-tab-border: 0;
--vtr-tab-border-radius: 0;
--vtr-tab-border-left: 4px solid transparent;
--vtr-tab-border-bottom: 1px solid #bbc3cc;

/* Single tab selected */
--vtr-tab-selected-text-color: #333333;
--vtr-tab-selected-background: #dadada;
--vtr-tab-selected-font-weight: 600;
--vtr-tab-selected-text-shadow: none;
--vtr-tab-selected-border-left: 4px solid #ff9500;
--vtr-tab-selected-border-radius: 0;

/* Single tab pinned */
--vtr-tab-pinned-text-color: #333333;
--vtr-tab-pinned-background: #dadada;
--vtr-tab-pinned-font-weight: 600;
--vtr-tab-pinned-text-shadow: none;
--vtr-tab-pinned-border-left: 4px solid #2292D0;
--vtr-tab-pinned-border-radius: 0;

/* Single tab hover */
--vtr-tab-hover-background: #ebebeb;

/* Splitter/Separation between tabbar and website */
--vtr-splitter-background: #ebebeb;
--vtr-splitter-width: 3px;
--vtr-splitter-border-left-size: 0;
--vtr-splitter-border-left-color: #ebebeb;
--vtr-splitter-border-left-color: #ebebeb;
--vtr-splitter-border-right-size: 0;
--vtr-splitter-border-right-color: #ebebeb;
--vtr-splitter-border-right-color: #ebebeb;
}
2 changes: 0 additions & 2 deletions webextension/data/theme/linux/index.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");

.tabbrowser-tabs {
margin: 1px 0 0 0 !important;
padding: 0 !important;
Expand Down
1 change: 0 additions & 1 deletion webextension/data/theme/windows/index.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
@import "variable.css";
@import "tab.css";
@import "tabbrowser.css";
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");

/* Seperator between tabbar and website */
#verticaltabs-splitter {
Expand Down
Loading

0 comments on commit fa51ec4

Please sign in to comment.