| 1 |
/* Tablesorter Custom LESS Theme by Rob Garrison |
| 2 |
|
| 3 |
To create your own theme, modify the code below and run it through |
| 4 |
a LESS compiler, like this one: http://leafo.net/lessphp/editor.html |
| 5 |
or download less.js from http://lesscss.org/ |
| 6 |
|
| 7 |
Test out these custom less files live |
| 8 |
Basic Theme : http://codepen.io/Mottie/pen/eqBbn |
| 9 |
Bootstrap : http://codepen.io/Mottie/pen/Ltzpi |
| 10 |
Metro Style : http://codepen.io/Mottie/pen/gCslk |
| 11 |
Basic SCSS : http://codepen.io/Mottie/pen/LbXdNR |
| 12 |
|
| 13 |
*/ |
| 14 |
|
| 15 |
/*** theme ***/ |
| 16 |
@theme : tablesorter-custom; |
| 17 |
|
| 18 |
/*** fonts ***/ |
| 19 |
@tableHeaderFont : 11px 'trebuchet ms', verdana, arial; |
| 20 |
@tableBodyFont : 11px 'trebuchet ms', verdana, arial; |
| 21 |
|
| 22 |
/*** color definitions ***/ |
| 23 |
/* for best results, only change the hue (120), |
| 24 |
leave the saturation (60%) and luminosity (75%) alone |
| 25 |
pick the color from here: http://hslpicker.com/#99E699 */ |
| 26 |
@headerBackground : hsl(120, 60%, 75%); |
| 27 |
@borderAndBackground : #cdcdcd; |
| 28 |
@overallBorder : @borderAndBackground 1px solid; |
| 29 |
@headerTextColor : #000; |
| 30 |
|
| 31 |
@bodyBackground : #fff; |
| 32 |
@bodyTextColor : #000; |
| 33 |
|
| 34 |
@headerAsc : darken(spin(@headerBackground, 5), 10%); /* darken(@headerBackground, 10%); */ |
| 35 |
@headerDesc : lighten(spin(@headerBackground, -5), 10%); /* desaturate(@headerAsc, 5%); */ |
| 36 |
|
| 37 |
@captionBackground : #fff; /* it might be best to match the document body background color here */ |
| 38 |
@errorBackground : #e6bf99; /* ajax error message (added to thead) */ |
| 39 |
|
| 40 |
@filterCellBackground : #eee; |
| 41 |
@filterElementTextColor: #333; |
| 42 |
@filterElementBkgd : #fff; |
| 43 |
@filterElementBorder : 1px solid #bbb; |
| 44 |
@filterTransitionTime : 0.1s; |
| 45 |
@filterRowHiddenHeight : 4px; /* becomes height using padding (so it's divided by 2) */ |
| 46 |
|
| 47 |
@overallPadding : 4px; |
| 48 |
/* 20px should be slightly wider than the icon width to avoid overlap */ |
| 49 |
@headerPadding : 4px 20px 4px 4px; |
| 50 |
|
| 51 |
/* url(icons/loading.gif); */ |
| 52 |
@processingIcon : url('data:image/gif;base64,R0lGODlhFAAUAKEAAO7u7lpaWgAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQBCgACACwAAAAAFAAUAAACQZRvoIDtu1wLQUAlqKTVxqwhXIiBnDg6Y4eyx4lKW5XK7wrLeK3vbq8J2W4T4e1nMhpWrZCTt3xKZ8kgsggdJmUFACH5BAEKAAIALAcAAAALAAcAAAIUVB6ii7jajgCAuUmtovxtXnmdUAAAIfkEAQoAAgAsDQACAAcACwAAAhRUIpmHy/3gUVQAQO9NetuugCFWAAAh+QQBCgACACwNAAcABwALAAACE5QVcZjKbVo6ck2AF95m5/6BSwEAIfkEAQoAAgAsBwANAAsABwAAAhOUH3kr6QaAcSrGWe1VQl+mMUIBACH5BAEKAAIALAIADQALAAcAAAIUlICmh7ncTAgqijkruDiv7n2YUAAAIfkEAQoAAgAsAAAHAAcACwAAAhQUIGmHyedehIoqFXLKfPOAaZdWAAAh+QQFCgACACwAAAIABwALAAACFJQFcJiXb15zLYRl7cla8OtlGGgUADs='); |
| 53 |
|
| 54 |
/* zebra striping */ |
| 55 |
.allRows { |
| 56 |
background-color: @bodyBackground; |
| 57 |
color: @bodyTextColor; |
| 58 |
} |
| 59 |
.evenRows { |
| 60 |
background-color: lighten(@headerBackground, 40%); |
| 61 |
color: @bodyTextColor; |
| 62 |
} |
| 63 |
.oddRows { |
| 64 |
background-color: lighten(@headerBackground, 20%); |
| 65 |
} |
| 66 |
|
| 67 |
/* hovered rows */ |
| 68 |
.oddHovered { |
| 69 |
background-color: desaturate(@headerBackground, 60%); |
| 70 |
color: @bodyTextColor; |
| 71 |
} |
| 72 |
.evenHovered { |
| 73 |
background-color: lighten( desaturate(@headerBackground, 60%), 10% ); |
| 74 |
color: @bodyTextColor; |
| 75 |
} |
| 76 |
|
| 77 |
/* Columns widget */ |
| 78 |
@primaryOdd : spin(@headerBackground, 10); /* saturate( darken( desaturate(@headerBackground, 10%), 10% ), 30%); */ |
| 79 |
@primaryEven : lighten( @primaryOdd, 10% ); |
| 80 |
@secondaryOdd : @primaryEven; |
| 81 |
@secondaryEven : lighten( @primaryEven, 5% ); |
| 82 |
@tertiaryOdd : @secondaryEven; |
| 83 |
@tertiaryEven : lighten( @secondaryEven, 5% ); |
| 84 |
|
| 85 |
/* Filter widget transition */ |
| 86 |
.filterWidgetTransition { |
| 87 |
-webkit-transition: line-height @filterTransitionTime ease; |
| 88 |
-moz-transition: line-height @filterTransitionTime ease; |
| 89 |
-o-transition: line-height @filterTransitionTime ease; |
| 90 |
transition: line-height @filterTransitionTime ease; |
| 91 |
} |
| 92 |
|
| 93 |
/*** Arrows ***/ |
| 94 |
@arrowPosition : right 5px center; |
| 95 |
|
| 96 |
/* black */ |
| 97 |
@unsortedBlack : url(data:image/gif;base64,R0lGODlhFQAJAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAkAAAIXjI+AywnaYnhUMoqt3gZXPmVg94yJVQAAOw==); |
| 98 |
@sortAscBlack : url(data:image/gif;base64,R0lGODlhFQAEAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAQAAAINjI8Bya2wnINUMopZAQA7); |
| 99 |
@sortDescBlack : url(data:image/gif;base64,R0lGODlhFQAEAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAQAAAINjB+gC+jP2ptn0WskLQA7); |
| 100 |
|
| 101 |
/* white */ |
| 102 |
@unsortedWhite : url(data:image/gif;base64,R0lGODlhFQAJAIAAAP///////yH5BAEAAAEALAAAAAAVAAkAAAIXjI+AywnaYnhUMoqt3gZXPmVg94yJVQAAOw==); |
| 103 |
@sortAscWhite : url(data:image/gif;base64,R0lGODlhFQAEAIAAAP///////yH5BAEAAAEALAAAAAAVAAQAAAINjI8Bya2wnINUMopZAQA7); |
| 104 |
@sortDescWhite : url(data:image/gif;base64,R0lGODlhFQAEAIAAAP///////yH5BAEAAAEALAAAAAAVAAQAAAINjB+gC+jP2ptn0WskLQA7); |
| 105 |
|
| 106 |
/* automatically choose the correct arrow/text color */ |
| 107 |
.headerText (@a) when (lightness(@a) >= 50%) { |
| 108 |
color: @headerTextColor; |
| 109 |
} |
| 110 |
.headerText (@a) when (lightness(@a) < 50%) { |
| 111 |
color: lighten(@headerTextColor, 90%); |
| 112 |
} |
| 113 |
.unsorted (@a) when (lightness(@a) >= 50%) { |
| 114 |
background-image: @unsortedBlack; |
| 115 |
} |
| 116 |
.unsorted (@a) when (lightness(@a) < 50%) { |
| 117 |
background-image: @unsortedWhite; |
| 118 |
} |
| 119 |
.sortAsc (@a) when (lightness(@a) >= 50%) { |
| 120 |
background-image: @sortAscBlack; |
| 121 |
} |
| 122 |
.sortAsc (@a) when (lightness(@a) < 50%) { |
| 123 |
background-image: @sortAscWhite; |
| 124 |
} |
| 125 |
.sortDesc (@a) when (lightness(@a) >= 50%) { |
| 126 |
background-image: @sortDescBlack; |
| 127 |
} |
| 128 |
.sortDesc (@a) when (lightness(@a) < 50%) { |
| 129 |
background-image: @sortDescWhite; |
| 130 |
} |
| 131 |
|
| 132 |
/* variable theme name - requires less.js 1.3+; |
| 133 |
or just replace (!".@{theme}") with the contents of @theme |
| 134 |
*/ |
| 135 |
.@{theme} { |
| 136 |
font: @tableBodyFont; |
| 137 |
background-color: @borderAndBackground; |
| 138 |
margin: 10px 0 15px; |
| 139 |
width: 100%; |
| 140 |
text-align: left; |
| 141 |
border-spacing: 0; |
| 142 |
border: @overallBorder; |
| 143 |
border-width: 1px 0 0 1px; |
| 144 |
|
| 145 |
th, td { |
| 146 |
border: @overallBorder; |
| 147 |
border-width: 0 1px 1px 0; |
| 148 |
} |
| 149 |
|
| 150 |
/* style th's outside of the thead */ |
| 151 |
th, thead td { |
| 152 |
font: @tableHeaderFont; |
| 153 |
font-weight: bold; |
| 154 |
background-color: @headerBackground; |
| 155 |
.headerText(@headerBackground); |
| 156 |
border-collapse: collapse; |
| 157 |
padding: @overallPadding; |
| 158 |
} |
| 159 |
|
| 160 |
tbody td, tfoot th, tfoot td { |
| 161 |
padding: @overallPadding; |
| 162 |
vertical-align: top; |
| 163 |
} |
| 164 |
|
| 165 |
/* style header */ |
| 166 |
.tablesorter-header { |
| 167 |
.unsorted(@headerBackground); |
| 168 |
background-repeat: no-repeat; |
| 169 |
background-position: @arrowPosition; |
| 170 |
padding: @headerPadding; |
| 171 |
cursor: pointer; |
| 172 |
} |
| 173 |
|
| 174 |
.tablesorter-header.sorter-false { |
| 175 |
background-image: none; |
| 176 |
cursor: default; |
| 177 |
padding: @overallPadding; |
| 178 |
} |
| 179 |
|
| 180 |
.tablesorter-headerAsc { |
| 181 |
background-color: @headerAsc; |
| 182 |
.sortAsc(@headerBackground); |
| 183 |
} |
| 184 |
|
| 185 |
.tablesorter-headerDesc { |
| 186 |
background-color: @headerDesc; |
| 187 |
.sortDesc(@headerBackground); |
| 188 |
} |
| 189 |
|
| 190 |
/* tfoot */ |
| 191 |
tfoot .tablesorter-headerAsc, |
| 192 |
tfoot .tablesorter-headerDesc { |
| 193 |
/* remove sort arrows from footer */ |
| 194 |
background-image: none; |
| 195 |
} |
| 196 |
|
| 197 |
/* optional disabled input styling */ |
| 198 |
.disabled { |
| 199 |
opacity: 0.5; |
| 200 |
filter: alpha(opacity=50); |
| 201 |
cursor: not-allowed; |
| 202 |
} |
| 203 |
|
| 204 |
/* body */ |
| 205 |
tbody { |
| 206 |
|
| 207 |
td { |
| 208 |
.allRows; |
| 209 |
padding: @overallPadding; |
| 210 |
vertical-align: top; |
| 211 |
} |
| 212 |
|
| 213 |
/* Zebra Widget - row alternating colors */ |
| 214 |
tr.odd > td { |
| 215 |
.oddRows; |
| 216 |
} |
| 217 |
tr.even > td { |
| 218 |
.evenRows; |
| 219 |
} |
| 220 |
|
| 221 |
} |
| 222 |
|
| 223 |
/* hovered row colors |
| 224 |
you'll need to add additional lines for |
| 225 |
rows with more than 2 child rows |
| 226 |
*/ |
| 227 |
tbody > tr.hover td, |
| 228 |
tbody > tr:hover td, |
| 229 |
tbody > tr:hover + tr.tablesorter-childRow > td, |
| 230 |
tbody > tr:hover + tr.tablesorter-childRow + tr.tablesorter-childRow > td, |
| 231 |
tbody > tr.even.hover > td, |
| 232 |
tbody > tr.even:hover > td, |
| 233 |
tbody > tr.even:hover + tr.tablesorter-childRow > td, |
| 234 |
tbody > tr.even:hover + tr.tablesorter-childRow + tr.tablesorter-childRow > td { |
| 235 |
.evenHovered; |
| 236 |
} |
| 237 |
tbody > tr.odd.hover > td, |
| 238 |
tbody > tr.odd:hover > td, |
| 239 |
tbody > tr.odd:hover + tr.tablesorter-childRow > td, |
| 240 |
tbody > tr.odd:hover + tr.tablesorter-childRow + tr.tablesorter-childRow > td { |
| 241 |
.oddHovered; |
| 242 |
} |
| 243 |
|
| 244 |
/* table processing indicator - indeterminate spinner */ |
| 245 |
.tablesorter-processing { |
| 246 |
background-image: @processingIcon; |
| 247 |
background-position: center center; |
| 248 |
background-repeat: no-repeat; |
| 249 |
} |
| 250 |
|
| 251 |
/* Column Widget - column sort colors */ |
| 252 |
tr.odd td.primary { |
| 253 |
background-color: @primaryOdd; |
| 254 |
} |
| 255 |
td.primary, tr.even td.primary { |
| 256 |
background-color: @primaryEven; |
| 257 |
} |
| 258 |
tr.odd td.secondary { |
| 259 |
background-color: @secondaryOdd; |
| 260 |
} |
| 261 |
td.secondary, tr.even td.secondary { |
| 262 |
background-color: @secondaryEven; |
| 263 |
} |
| 264 |
tr.odd td.tertiary { |
| 265 |
background-color: @tertiaryOdd; |
| 266 |
} |
| 267 |
td.tertiary, tr.even td.tertiary { |
| 268 |
background-color: @tertiaryEven; |
| 269 |
} |
| 270 |
|
| 271 |
/* caption (non-theme matching) */ |
| 272 |
caption { |
| 273 |
background-color: @captionBackground ; |
| 274 |
} |
| 275 |
|
| 276 |
/* filter widget */ |
| 277 |
.tablesorter-filter-row input, |
| 278 |
.tablesorter-filter-row select { |
| 279 |
width: 98%; |
| 280 |
height: auto; |
| 281 |
margin: 0; |
| 282 |
padding: @overallPadding; |
| 283 |
color: @filterElementTextColor; |
| 284 |
background-color: @filterElementBkgd; |
| 285 |
border: @filterElementBorder; |
| 286 |
-webkit-box-sizing: border-box; |
| 287 |
-moz-box-sizing: border-box; |
| 288 |
box-sizing: border-box; |
| 289 |
.filterWidgetTransition; |
| 290 |
} |
| 291 |
.tablesorter-filter-row { |
| 292 |
background-color: @filterCellBackground; |
| 293 |
} |
| 294 |
.tablesorter-filter-row td { |
| 295 |
text-align: center; |
| 296 |
background-color: @filterCellBackground; |
| 297 |
line-height: normal; |
| 298 |
text-align: center; /* center the input */ |
| 299 |
.filterWidgetTransition; |
| 300 |
} |
| 301 |
/* hidden filter row */ |
| 302 |
.tablesorter-filter-row.hideme td { |
| 303 |
padding: @filterRowHiddenHeight / 2; |
| 304 |
margin: 0; |
| 305 |
line-height: 0; |
| 306 |
cursor: pointer; |
| 307 |
} |
| 308 |
.tablesorter-filter-row.hideme * { |
| 309 |
height: 1px; |
| 310 |
min-height: 0; |
| 311 |
border: 0; |
| 312 |
padding: 0; |
| 313 |
margin: 0; |
| 314 |
/* don't use visibility: hidden because it disables tabbing */ |
| 315 |
opacity: 0; |
| 316 |
filter: alpha(opacity=0); |
| 317 |
} |
| 318 |
/* rows hidden by filtering (needed for child rows) */ |
| 319 |
.filtered { |
| 320 |
display: none; |
| 321 |
} |
| 322 |
|
| 323 |
/* ajax error row */ |
| 324 |
.tablesorter-errorRow td { |
| 325 |
text-align: center; |
| 326 |
cursor: pointer; |
| 327 |
background-color: @errorBackground; |
| 328 |
} |
| 329 |
|
| 330 |
} |