Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ScottDugas
Created May 24, 2012 18:47
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ScottDugas/2783434 to your computer and use it in GitHub Desktop.
Save ScottDugas/2783434 to your computer and use it in GitHub Desktop.
Stylish that colors the entire Trello card based on labels
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("trello.com") {
/* Highlight cards
* These must go in the same order
* as the hiding labels
* Note, there ordering is important, the colors at the bottom will take precedence over those at the top
*/
div.list-card.purple-label {
background: plum !important;
}
div.list-card.green-label {
background: paleGreen !important;
}
div.list-card.yellow-label {
background: LightGoldenrodYellow !important;
}
div.list-card.orange-label {
background: orange !important;
}
div.list-card.blue-label {
background: lightBlue !important;
}
div.list-card.red-label {
background: indianRed !important;
}
/* Hide label of highlighted color
* This was generated with the following ruby code:
colors = %w[purple green yellow orange blue red]
colors.each do |card|
colors.each do |label|
if (card == label)
puts <<EOS
div.list-card.#{card}-label .card-label.#{label}-label {
display: none !important;
}
EOS
else
puts <<EOS
div.list-card.#{card}-label .card-label.#{label}-label {
display: block !important;
}
EOS
end
end
end
*/
div.list-card.purple-label .card-label.purple-label {
display: none !important;
}
div.list-card.purple-label .card-label.green-label {
display: block !important;
}
div.list-card.purple-label .card-label.yellow-label {
display: block !important;
}
div.list-card.purple-label .card-label.orange-label {
display: block !important;
}
div.list-card.purple-label .card-label.blue-label {
display: block !important;
}
div.list-card.purple-label .card-label.red-label {
display: block !important;
}
div.list-card.green-label .card-label.purple-label {
display: block !important;
}
div.list-card.green-label .card-label.green-label {
display: none !important;
}
div.list-card.green-label .card-label.yellow-label {
display: block !important;
}
div.list-card.green-label .card-label.orange-label {
display: block !important;
}
div.list-card.green-label .card-label.blue-label {
display: block !important;
}
div.list-card.green-label .card-label.red-label {
display: block !important;
}
div.list-card.yellow-label .card-label.purple-label {
display: block !important;
}
div.list-card.yellow-label .card-label.green-label {
display: block !important;
}
div.list-card.yellow-label .card-label.yellow-label {
display: none !important;
}
div.list-card.yellow-label .card-label.orange-label {
display: block !important;
}
div.list-card.yellow-label .card-label.blue-label {
display: block !important;
}
div.list-card.yellow-label .card-label.red-label {
display: block !important;
}
div.list-card.orange-label .card-label.purple-label {
display: block !important;
}
div.list-card.orange-label .card-label.green-label {
display: block !important;
}
div.list-card.orange-label .card-label.yellow-label {
display: block !important;
}
div.list-card.orange-label .card-label.orange-label {
display: none !important;
}
div.list-card.orange-label .card-label.blue-label {
display: block !important;
}
div.list-card.orange-label .card-label.red-label {
display: block !important;
}
div.list-card.blue-label .card-label.purple-label {
display: block !important;
}
div.list-card.blue-label .card-label.green-label {
display: block !important;
}
div.list-card.blue-label .card-label.yellow-label {
display: block !important;
}
div.list-card.blue-label .card-label.orange-label {
display: block !important;
}
div.list-card.blue-label .card-label.blue-label {
display: none !important;
}
div.list-card.blue-label .card-label.red-label {
display: block !important;
}
div.list-card.red-label .card-label.purple-label {
display: block !important;
}
div.list-card.red-label .card-label.green-label {
display: block !important;
}
div.list-card.red-label .card-label.yellow-label {
display: block !important;
}
div.list-card.red-label .card-label.orange-label {
display: block !important;
}
div.list-card.red-label .card-label.blue-label {
display: block !important;
}
div.list-card.red-label .card-label.red-label {
display: none !important;
}
}
@float-mode
Copy link

It seems like this no longer works with the most recent trello site...

@chmac
Copy link

chmac commented May 23, 2014

Yeah, trello.com today generates a <div class="list-card js-member-droppable ui-droppable"> whether the card has a label or not.

Looks like this without a label:

<div class="list-card js-member-droppable ui-droppable">
    <div class="list-card-labels clearfix js-card-labels"></div>
    ...
</div>

Or this with:

<div class="list-card js-member-droppable ui-droppable">
    <div class="list-card-labels clearfix js-card-labels">
        <span class="card-label card-label-green" title="green label (default)">  &nbsp; </span>
    </div>
    ...
</div>

Probably possible to do something with Greasemonkey based on this, jQuery is available...

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