Skip to content

Instantly share code, notes, and snippets.

@elliotboney
Forked from NigelThorne/styler.css
Last active August 29, 2015 14:06
Show Gist options
  • Save elliotboney/8473802b14104db47ccb to your computer and use it in GitHub Desktop.
Save elliotboney/8473802b14104db47ccb to your computer and use it in GitHub Desktop.
/* I use Stylish (a chome addin) to set these styles
* URLs on the domain workflowy
*/
.next-row {
border: 2px solid #46A546 !important;
border-top-left-radius:0.5em;
background-color: #CCFFCC !important;
}
.next {
background-color: #46A546 !important;
}
.blocked-row {
border: 2px solid #4646A5 !important;
border-bottom-left-radius:1em;
background-color: #CCCCFF !important;
}
.blocked {
background-color: #4646A5 !important;
}
.urgent-row {
border: 3px solid #A54646 !important;
border-top-left-radius:1em;
color: #A54646;
background-color: #FFCCCC !important;
}
.urgent {
background-color: #A54646 !important;
}
// ==UserScript==
// @name WorkflowyStylableTags
// @description Gives each tag it's own css style, so you can style them with Stylish. I use Blank Canvas to manage my userscripts in Chrome.
// @author Nigel Thorne
// @include http*://*workflowy.com/*
// @version 1.0
// ==/UserScript==
String.prototype.endsWith = function(suffix) {
return this.indexOf(suffix, this.length - suffix.length) !== -1;
};
var customClasses = function(index, old){
var classes = old.split(" ");
var custom = [];
for( i = 0; i < classes.length; i++){
if(classes[i].endsWith("-row")){ custom.push(classes[i]);};
if(classes[i].endsWith("-span")){ custom.push(classes[i]);};
};
return custom.join(" ");
}
setInterval(function(){
$('.name').removeClass(customClasses);
$('.content').removeClass(customClasses );
$('span > .contentTagText').map( function(){
var x = $(this).text();
$(this).parent('.contentTag').addClass(x).parent().addClass(x+"-span").parent().addClass(x+"-row");}
);
},100);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment