tables.less 3.06 KB
Newer Older
1
2
/*
 * Tables.less
3
 * Tables for, you guessed it, tabular data
4
 * ---------------------------------------- */
Jacob Thornton's avatar
Jacob Thornton committed
5

6

7
8
// BASELINE STYLES
// ---------------
Jacob Thornton's avatar
Jacob Thornton committed
9
10
11
12
13

table {
  width: 100%;
  margin-bottom: @baseline;
  padding: 0;
14
15
  border-collapse: collapse;
  font-size: @basefont;
Jacob Thornton's avatar
Jacob Thornton committed
16
17
  th, td {
    padding: 10px 10px 9px;
18
    line-height: @baseline;
19
    text-align: left;
20
    border: 1px solid #ddd;
Jacob Thornton's avatar
Jacob Thornton committed
21
22
23
24
  }
  th {
    padding-top: 9px;
    font-weight: bold;
25
    vertical-align: middle;
Jacob Thornton's avatar
Jacob Thornton committed
26
27
    border-bottom-width: 2px;
  }
28
29
30
  td {
    vertical-align: top;
  }
Jacob Thornton's avatar
Jacob Thornton committed
31
32
}

33

34
35
// ZEBRA-STRIPING
// --------------
Jacob Thornton's avatar
Jacob Thornton committed
36
37

// Default zebra-stripe styles (alternating gray and transparent backgrounds)
38
.zebra-striped {
Jacob Thornton's avatar
Jacob Thornton committed
39
40
  tbody {
    tr:nth-child(odd) td {
41
      background-color: #f9f9f9;
Jacob Thornton's avatar
Jacob Thornton committed
42
43
    }
    tr:hover td {
44
      background-color: #f5f5f5;
Jacob Thornton's avatar
Jacob Thornton committed
45
46
    }
  }
47

Jacob Thornton's avatar
Jacob Thornton committed
48
  // Tablesorting styles w/ jQuery plugin
49
  .header {
Jacob Thornton's avatar
Jacob Thornton committed
50
    cursor: pointer;
51
    &:after {
52
      content: "";
53
      float: right;
54
55
56
57
58
      margin-top: 7px;
      border-width: 0 4px 4px;
      border-style: solid;
      border-color: #000 transparent;
      visibility: hidden;
59
    }
Jacob Thornton's avatar
Jacob Thornton committed
60
  }
61
  // Style the sorted column headers (THs)
62
63
  .headerSortUp,
  .headerSortDown {
Jacob Thornton's avatar
Jacob Thornton committed
64
65
    background-color: rgba(141,192,219,.25);
    text-shadow: 0 1px 1px rgba(255,255,255,.75);
66
    .border-radius(3px 3px 0 0);
Jacob Thornton's avatar
Jacob Thornton committed
67
  }
68
  // Style the ascending (reverse alphabetical) column header
69
  .header:hover {
70
71
72
    &:after {
      visibility:visible;
    }
Jacob Thornton's avatar
Jacob Thornton committed
73
  }
74
  // Style the descending (alphabetical) column header
75
76
  .headerSortDown,
  .headerSortDown:hover {
77
78
79
80
    &:after {
      visibility:visible;
      .opacity(60);
    }
Jacob Thornton's avatar
Jacob Thornton committed
81
  }
82
  // Style the ascending (reverse alphabetical) column header
83
  .headerSortUp {
84
85
86
87
88
89
90
91
92
    &:after {
      border-bottom: none;
      border-left: 4px solid transparent;
      border-right: 4px solid transparent;
      border-top: 4px solid #000;
      visibility:visible;
      .box-shadow(none); //can't add boxshadow to downward facing arrow :(
      .opacity(60);
    }
Jacob Thornton's avatar
Jacob Thornton committed
93
  }
94
}
95

96
table {
Jacob Thornton's avatar
Jacob Thornton committed
97
  // Blue Table Headings
98
  .blue {
Jacob Thornton's avatar
Jacob Thornton committed
99
100
101
    color: @blue;
    border-bottom-color: @blue;
  }
102
103
  .headerSortUp.blue,
  .headerSortDown.blue {
Jacob Thornton's avatar
Jacob Thornton committed
104
105
106
    background-color: lighten(@blue, 40%);
  }
  // Green Table Headings
107
  .green {
Jacob Thornton's avatar
Jacob Thornton committed
108
109
110
    color: @green;
    border-bottom-color: @green;
  }
111
112
  .headerSortUp.green,
  .headerSortDown.green {
Jacob Thornton's avatar
Jacob Thornton committed
113
114
115
    background-color: lighten(@green, 40%);
  }
  // Red Table Headings
116
  .red {
Jacob Thornton's avatar
Jacob Thornton committed
117
118
119
    color: @red;
    border-bottom-color: @red;
  }
120
121
  .headerSortUp.red,
  .headerSortDown.red {
Jacob Thornton's avatar
Jacob Thornton committed
122
123
124
    background-color: lighten(@red, 50%);
  }
  // Yellow Table Headings
125
  .yellow {
Jacob Thornton's avatar
Jacob Thornton committed
126
127
128
    color: @yellow;
    border-bottom-color: @yellow;
  }
129
130
  .headerSortUp.yellow,
  .headerSortDown.yellow {
Jacob Thornton's avatar
Jacob Thornton committed
131
132
133
    background-color: lighten(@yellow, 40%);
  }
  // Orange Table Headings
134
  .orange {
Jacob Thornton's avatar
Jacob Thornton committed
135
136
137
    color: @orange;
    border-bottom-color: @orange;
  }
138
139
  .headerSortUp.orange,
  .headerSortDown.orange {
Jacob Thornton's avatar
Jacob Thornton committed
140
141
142
    background-color: lighten(@orange, 40%);
  }
  // Purple Table Headings
143
  .purple {
Jacob Thornton's avatar
Jacob Thornton committed
144
145
146
    color: @purple;
    border-bottom-color: @purple;
  }
147
148
  .headerSortUp.purple,
  .headerSortDown.purple {
Jacob Thornton's avatar
Jacob Thornton committed
149
150
    background-color: lighten(@purple, 40%);
  }
151
}