Skip to content

Instantly share code, notes, and snippets.

@tetrapus
Last active July 2, 2018 13:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tetrapus/880a649865dd735e42234234947023b6 to your computer and use it in GitHub Desktop.
Save tetrapus/880a649865dd735e42234234947023b6 to your computer and use it in GitHub Desktop.
Coloured tabs for TST
@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
/* override base tab color */
:root:root {
--color-100: white;
}
/* Plain */
.tabbrowser-tab {
--color-main: var(--color-100);
--color-text: black;
--color-highlight: var(--color-800);
}
/* Pinned */
.tabbrowser-tab[pinned="true"] {
--color-main: var(--color-400);
}
/* Selected */
.tabbrowser-tab[visuallyselected="true"] {
--color-main: var(--color-800);
--color-text: white;
}
/* Hover */
.tabbrowser-tab:not([visuallyselected="true"]):not([pinned]):hover {
--color-main: var(--color-600);
--color-text: white;
}
/* Pinned Hover */
.tabbrowser-tab:not([visuallyselected="true"])[pinned]:not([titlechanged]):hover {
--color-main: var(--color-600);
--color-text: white;
}
.tabbrowser-tabs[treestyletab-style~="color"]:not([treestyletab-tabbar-position="top"])
tab.tabbrowser-tab.tabbrowser-tab.tabbrowser-tab.tabbrowser-tab.tabbrowser-tab {
background-color: var(--color-main) !important;
color: var(--color-text) !important;
border-width: 0px !important;
min-height: 32px !important;
-moz-border-bottom-colors: none !important;
-moz-border-top-colors: none !important;
-moz-border-left-colors: none !important;
-moz-border-right-colors: none !important;
border-left-width: 2px !important;
border-left-color: var(--color-highlight) !important;
}
.tab-icon-image {
box-shadow: 0px 0px 3px white !important;
background-color: white !important;
min-height: 20px !important;
min-width: 20px !important;
padding: 2px !important;
}
.tabbrowser-tabs:not([treestyletab-tabbar-position="top"])
tab.tabbrowser-tab.tabbrowser-tab.tabbrowser-tab.tabbrowser-tab.tabbrowser-tab[pinned="true"] {
min-height: 36px !important;
min-width: 36px !important;
padding: 4px !important;
border-color: var(--color-highlight) !important;
border-top-width: 2px !important;
border-left-width: 0px !important;
border-right-width: 0px !important;
}
.tabbrowser-tabs[treestyletab-mode="vertical"]
.tabbrowser-tab.tabbrowser-tab.tabbrowser-tab.tabbrowser-tab[titlechanged][pinned]:not([visuallyselected="true"]) {
background-image: none !important;
}
@keyframes blinker {
0% { opacity: 0.8; border-radius: 4px; }
20% { opacity: inherit; border-radius: inherit; }
80% { opacity: inherit; border-radius: inherit; }
100% { opacity: 0.8; border-radius: 4px; }
}
.tabbrowser-tabs[treestyletab-mode="vertical"]
.tabbrowser-tab.tabbrowser-tab.tabbrowser-tab.tabbrowser-tab[titlechanged]:not([pinned]):not([visuallyselected="true"]) {
box-shadow: 124px 0px 100px -80px var(--color-highlight) inset !important;
}
.tabbrowser-tabs[treestyletab-mode="vertical"]
.tabbrowser-tab.tabbrowser-tab.tabbrowser-tab.tabbrowser-tab[titlechanged]:not([visuallyselected="true"]) .tab-icon-image {
animation: blinker 3s linear infinite;
}
.tabbrowser-tabs[treestyletab-mode="vertical"]
.tabbrowser-tab.tabbrowser-tab.tabbrowser-tab.tabbrowser-tab[pinned][titlechanged]:not([visuallyselected="true"]) .tab-icon-image {
box-shadow: 0px 0px 16px 8px white !important;
}
.tabbrowser-tabs[treestyletab-mode="vertical"]
.tabbrowser-tab.tabbrowser-tab.tabbrowser-tab.tabbrowser-tab[pinned][titlechanged]:not([visuallyselected="true"]):hover {
background-color: white !important;
color: black !important;
transition: all 0.2s ease;
}
/* Pending tabs */
.tabbrowser-tab.tabbrowser-tab.tabbrowser-tab.tabbrowser-tab.tabbrowser-tab.tabbrowser-tab.tabbrowser-tab.tabbrowser-tab[pending] {
font-style: italic;
}
.tabbrowser-tab.tabbrowser-tab.tabbrowser-tab.tabbrowser-tab.tabbrowser-tab.tabbrowser-tab.tabbrowser-tab.tabbrowser-tab[pending]:not(:hover) {
background-color: #eceff1 !important;
}
.tabbrowser-tab.tabbrowser-tab.tabbrowser-tab.tabbrowser-tab.tabbrowser-tab.tabbrowser-tab.tabbrowser-tab.tabbrowser-tab[pending]:not(:hover) .tab-icon-image {
background: none !important;
box-shadow: none !important;
filter: grayscale(100%);
}
/* Begin themes */
[image*="mail"], [theme="red"] {
--color-50: #ffebee;
--color-100: #ffcdd2;
--color-200: #ef9a9a;
--color-300: #e57373;
--color-400: #ef5350;
--color-500: #f44336;
--color-600: #e53935;
--color-700: #d32f2f;
--color-800: #c62828;
--color-900: #b71c1c;
--color-a100: #ff8a80;
--color-a200: #ff5252;
--color-a400: #ff1744;
--color-a700: #d50000;
}
[theme="pink"] {
--color-50: #fce4ec;
--color-100: #f8bbd0;
--color-200: #f48fb1;
--color-300: #f06292;
--color-400: #ec407a;
--color-500: #e91e63;
--color-600: #d81b60;
--color-700: #c2185b;
--color-800: #ad1457;
--color-900: #880e4f;
--color-a100: #ff80ab;
--color-a200: #ff4081;
--color-a400: #f50057;
--color-a700: #c51162;
}
[theme="purple"] {
--color-50: #f3e5f5;
--color-100: #e1bee7;
--color-200: #ce93d8;
--color-300: #ba68c8;
--color-400: #ab47bc;
--color-500: #9c27b0;
--color-600: #8e24aa;
--color-700: #7b1fa2;
--color-800: #6a1b9a;
--color-900: #4a148c;
--color-a100: #ea80fc;
--color-a200: #e040fb;
--color-a400: #d500f9;
--color-a700: #aa00ff;
}
[theme="deep purple"] {
--color-50: #ede7f6;
--color-100: #d1c4e9;
--color-200: #b39ddb;
--color-300: #9575cd;
--color-400: #7e57c2;
--color-500: #673ab7;
--color-600: #5e35b1;
--color-700: #512da8;
--color-800: #4527a0;
--color-900: #311b92;
--color-a100: #b388ff;
--color-a200: #7c4dff;
--color-a400: #651fff;
--color-a700: #6200ea;
}
[image*="facebook"], [theme="indigo"] {
--color-50: #e8eaf6;
--color-100: #c5cae9;
--color-200: #9fa8da;
--color-300: #7986cb;
--color-400: #5c6bc0;
--color-500: #3f51b5;
--color-600: #3949ab;
--color-700: #303f9f;
--color-800: #283593;
--color-900: #1a237e;
--color-a100: #8c9eff;
--color-a200: #536dfe;
--color-a400: #3d5afe;
--color-a700: #304ffe;
}
[image*="calendar"], [theme="blue"] {
--color-50: #e3f2fd;
--color-100: #bbdefb;
--color-200: #90caf9;
--color-300: #64b5f6;
--color-400: #42a5f5;
--color-500: #2196f3;
--color-600: #1e88e5;
--color-700: #1976d2;
--color-800: #1565c0;
--color-900: #0d47a1;
--color-a100: #82b1ff;
--color-a200: #448aff;
--color-a400: #2979ff;
--color-a700: #2962ff;
}
[image*="messenger"], [theme="light blue"] {
--color-50: #e1f5fe;
--color-100: #b3e5fc;
--color-200: #81d4fa;
--color-300: #4fc3f7;
--color-400: #29b6f6;
--color-500: #03a9f4;
--color-600: #039be5;
--color-700: #0288d1;
--color-800: #0277bd;
--color-900: #01579b;
--color-a100: #80d8ff;
--color-a200: #40c4ff;
--color-a400: #00b0ff;
--color-a700: #0091ea;
}
[image*="reddit"], [theme="cyan"] {
--color-50: #e0f7fa;
--color-100: #b2ebf2;
--color-200: #80deea;
--color-300: #4dd0e1;
--color-400: #26c6da;
--color-500: #00bcd4;
--color-600: #00acc1;
--color-700: #0097a7;
--color-800: #00838f;
--color-900: #006064;
--color-a100: #84ffff;
--color-a200: #18ffff;
--color-a400: #00e5ff;
--color-a700: #00b8d4;
}
[theme="teal"] {
--color-50: #e0f2f1;
--color-100: #b2dfdb;
--color-200: #80cbc4;
--color-300: #4db6ac;
--color-400: #26a69a;
--color-500: #009688;
--color-600: #00897b;
--color-700: #00796b;
--color-800: #00695c;
--color-900: #004d40;
--color-a100: #a7ffeb;
--color-a200: #64ffda;
--color-a400: #1de9b6;
--color-a700: #00bfa5;
}
[theme="green"] {
--color-50: #e8f5e9;
--color-100: #c8e6c9;
--color-200: #a5d6a7;
--color-300: #81c784;
--color-400: #66bb6a;
--color-500: #4caf50;
--color-600: #43a047;
--color-700: #388e3c;
--color-800: #2e7d32;
--color-900: #1b5e20;
--color-a100: #b9f6ca;
--color-a200: #69f0ae;
--color-a400: #00e676;
--color-a700: #00c853;
}
[image*="hangouts"], [theme="light green"] {
--color-50: #f1f8e9;
--color-100: #dcedc8;
--color-200: #c5e1a5;
--color-300: #aed581;
--color-400: #9ccc65;
--color-500: #8bc34a;
--color-600: #7cb342;
--color-700: #689f38;
--color-800: #558b2f;
--color-900: #33691e;
--color-a100: #ccff90;
--color-a200: #b2ff59;
--color-a400: #76ff03;
--color-a700: #64dd17;
}
[theme="lime"] {
--color-50: #f9fbe7;
--color-100: #f0f4c3;
--color-200: #e6ee9c;
--color-300: #dce775;
--color-400: #d4e157;
--color-500: #cddc39;
--color-600: #c0ca33;
--color-700: #afb42b;
--color-800: #9e9d24;
--color-900: #827717;
--color-a100: #f4ff81;
--color-a200: #eeff41;
--color-a400: #c6ff00;
--color-a700: #aeea00;
}
[theme="yellow"] {
--color-50: #fffde7;
--color-100: #fff9c4;
--color-200: #fff59d;
--color-300: #fff176;
--color-400: #ffee58;
--color-500: #ffeb3b;
--color-600: #fdd835;
--color-700: #fbc02d;
--color-800: #f9a825;
--color-900: #f57f17;
--color-a100: #ffff8d;
--color-a200: #ffff00;
--color-a400: #ffea00;
--color-a700: #ffd600;
}
[image*="music"], [theme="amber"] {
--color-50: #fff8e1;
--color-100: #ffecb3;
--color-200: #ffe082;
--color-300: #ffd54f;
--color-400: #ffca28;
--color-500: #ffc107;
--color-600: #ffb300;
--color-700: #ffa000;
--color-800: #ff8f00;
--color-900: #ff6f00;
--color-a100: #ffe57f;
--color-a200: #ffd740;
--color-a400: #ffc400;
--color-a700: #ffab00;
}
[theme="orange"] {
--color-50: #fff3e0;
--color-100: #ffe0b2;
--color-200: #ffcc80;
--color-300: #ffb74d;
--color-400: #ffa726;
--color-500: #ff9800;
--color-600: #fb8c00;
--color-700: #f57c00;
--color-800: #ef6c00;
--color-900: #e65100;
--color-a100: #ffd180;
--color-a200: #ffab40;
--color-a400: #ff9100;
--color-a700: #ff6d00;
}
[theme="deep orange"] {
--color-50: #fbe9e7;
--color-100: #ffccbc;
--color-200: #ffab91;
--color-300: #ff8a65;
--color-400: #ff7043;
--color-500: #ff5722;
--color-600: #f4511e;
--color-700: #e64a19;
--color-800: #d84315;
--color-900: #bf360c;
--color-a100: #ff9e80;
--color-a200: #ff6e40;
--color-a400: #ff3d00;
--color-a700: #dd2c00;
}
[theme="brown"] {
--color-50: #efebe9;
--color-100: #d7ccc8;
--color-200: #bcaaa4;
--color-300: #a1887f;
--color-400: #8d6e63;
--color-500: #795548;
--color-600: #6d4c41;
--color-700: #5d4037;
--color-800: #4e342e;
--color-900: #3e2723;
}
[theme="grey"] {
--color-50: #fafafa;
--color-100: #f5f5f5;
--color-200: #eeeeee;
--color-300: #e0e0e0;
--color-400: #bdbdbd;
--color-500: #9e9e9e;
--color-600: #757575;
--color-700: #616161;
--color-800: #424242;
--color-900: #212121;
}
[theme="inactive"] {
--color-50: #fafafa;
--color-100: #f5f5f5;
--color-200: #f0f0f0;
--color-300: #e5e5e5;
--color-400: #e0e0e0;
--color-500: #d5d5d5;
--color-600: #d0d0d0;
--color-700: #c5c5c5;
--color-800: #c0c0c0;
--color-900: #b5b5b5;
}
:root, [theme="blue grey"] {
--color-50: #eceff1;
--color-100: #cfd8dc;
--color-200: #b0bec5;
--color-300: #90a4ae;
--color-400: #78909c;
--color-500: #607d8b;
--color-600: #546e7a;
--color-700: #455a64;
--color-800: #37474f;
--color-900: #263238;
}
@MurzNN
Copy link

MurzNN commented Jul 2, 2018

Thanks for the css rules!

TST provide API for other extensions, so instead of css file will be better to provide separate plugin extension for Tree Style Tabs with configurable rules of coloring.

For colorize tabs in Tree Style Tabs extension there are exists fork: https://github.com/meph1570/treestyletab that do this thing, but seems it is abandoned, and better way is provide separate extension, that use TST API instead of fork.

Can you convert your css rules to separate extension and apply this rules dynamically via TST API?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment