tables.less 3.45 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
  border-collapse: separate;
15
  font-size: @basefont;
16
17
  border: 1px solid #ddd;
  .border-radius(4px);
Jacob Thornton's avatar
Jacob Thornton committed
18
19
  th, td {
    padding: 10px 10px 9px;
20
    line-height: @baseline;
21
    text-align: left;
Jacob Thornton's avatar
Jacob Thornton committed
22
23
24
25
  }
  th {
    padding-top: 9px;
    font-weight: bold;
26
    vertical-align: middle;
27
    border-bottom: 1px solid #ddd;
Jacob Thornton's avatar
Jacob Thornton committed
28
  }
29
30
31
  td {
    vertical-align: top;
  }
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
  th + th,
  td + td {
    border-left: 1px solid #ddd;
  }
  tr + tr td {
    border-top: 1px solid #ddd;
  }
  tbody tr:first-child td:first-child {
    .border-radius(4px 0 0 0);
  }
  tbody tr:first-child td:last-child {
    .border-radius(0 4px 0 0);
  }
  tbody tr:last-child td:first-child {
    .border-radius(0 0 0 4px);
  }
  tbody tr:last-child td:last-child {
    .border-radius(0 0 4px 0);
  }
Jacob Thornton's avatar
Jacob Thornton committed
51
52
}

53

54
55
// ZEBRA-STRIPING
// --------------
Jacob Thornton's avatar
Jacob Thornton committed
56
57

// Default zebra-stripe styles (alternating gray and transparent backgrounds)
58
.zebra-striped {
Jacob Thornton's avatar
Jacob Thornton committed
59
60
  tbody {
    tr:nth-child(odd) td {
61
      background-color: #f9f9f9;
Jacob Thornton's avatar
Jacob Thornton committed
62
63
    }
    tr:hover td {
64
      background-color: #f5f5f5;
Jacob Thornton's avatar
Jacob Thornton committed
65
66
    }
  }
67

Jacob Thornton's avatar
Jacob Thornton committed
68
  // Tablesorting styles w/ jQuery plugin
69
  .header {
Jacob Thornton's avatar
Jacob Thornton committed
70
    cursor: pointer;
71
    &:after {
72
      content: "";
73
      float: right;
74
75
76
77
78
      margin-top: 7px;
      border-width: 0 4px 4px;
      border-style: solid;
      border-color: #000 transparent;
      visibility: hidden;
79
    }
Jacob Thornton's avatar
Jacob Thornton committed
80
  }
81
  // Style the sorted column headers (THs)
82
83
  .headerSortUp,
  .headerSortDown {
Jacob Thornton's avatar
Jacob Thornton committed
84
85
86
    background-color: rgba(141,192,219,.25);
    text-shadow: 0 1px 1px rgba(255,255,255,.75);
  }
87
  // Style the ascending (reverse alphabetical) column header
88
  .header:hover {
89
90
91
    &:after {
      visibility:visible;
    }
Jacob Thornton's avatar
Jacob Thornton committed
92
  }
93
  // Style the descending (alphabetical) column header
94
95
  .headerSortDown,
  .headerSortDown:hover {
96
97
98
99
    &:after {
      visibility:visible;
      .opacity(60);
    }
Jacob Thornton's avatar
Jacob Thornton committed
100
  }
101
  // Style the ascending (reverse alphabetical) column header
102
  .headerSortUp {
103
104
105
106
107
108
109
110
111
    &: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
112
  }
113
}
114

115
table {
Jacob Thornton's avatar
Jacob Thornton committed
116
  // Blue Table Headings
117
  .blue {
Jacob Thornton's avatar
Jacob Thornton committed
118
119
120
    color: @blue;
    border-bottom-color: @blue;
  }
121
122
  .headerSortUp.blue,
  .headerSortDown.blue {
Jacob Thornton's avatar
Jacob Thornton committed
123
124
125
    background-color: lighten(@blue, 40%);
  }
  // Green Table Headings
126
  .green {
Jacob Thornton's avatar
Jacob Thornton committed
127
128
129
    color: @green;
    border-bottom-color: @green;
  }
130
131
  .headerSortUp.green,
  .headerSortDown.green {
Jacob Thornton's avatar
Jacob Thornton committed
132
133
134
    background-color: lighten(@green, 40%);
  }
  // Red Table Headings
135
  .red {
Jacob Thornton's avatar
Jacob Thornton committed
136
137
138
    color: @red;
    border-bottom-color: @red;
  }
139
140
  .headerSortUp.red,
  .headerSortDown.red {
Jacob Thornton's avatar
Jacob Thornton committed
141
142
143
    background-color: lighten(@red, 50%);
  }
  // Yellow Table Headings
144
  .yellow {
Jacob Thornton's avatar
Jacob Thornton committed
145
146
147
    color: @yellow;
    border-bottom-color: @yellow;
  }
148
149
  .headerSortUp.yellow,
  .headerSortDown.yellow {
Jacob Thornton's avatar
Jacob Thornton committed
150
151
152
    background-color: lighten(@yellow, 40%);
  }
  // Orange Table Headings
153
  .orange {
Jacob Thornton's avatar
Jacob Thornton committed
154
155
156
    color: @orange;
    border-bottom-color: @orange;
  }
157
158
  .headerSortUp.orange,
  .headerSortDown.orange {
Jacob Thornton's avatar
Jacob Thornton committed
159
160
161
    background-color: lighten(@orange, 40%);
  }
  // Purple Table Headings
162
  .purple {
Jacob Thornton's avatar
Jacob Thornton committed
163
164
165
    color: @purple;
    border-bottom-color: @purple;
  }
166
167
  .headerSortUp.purple,
  .headerSortDown.purple {
Jacob Thornton's avatar
Jacob Thornton committed
168
169
    background-color: lighten(@purple, 40%);
  }
170
}