tables.less 3.56 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: separate; // Done so we can round those corners!
  *border-collapse: collapse; /* IE7, collapse table to remove spacing */
16
  font-size: @basefont;
17
18
  border: 1px solid #ddd;
  .border-radius(4px);
Jacob Thornton's avatar
Jacob Thornton committed
19
20
  th, td {
    padding: 10px 10px 9px;
21
    line-height: @baseline;
22
    text-align: left;
Jacob Thornton's avatar
Jacob Thornton committed
23
24
25
26
  }
  th {
    padding-top: 9px;
    font-weight: bold;
27
    vertical-align: middle;
28
    border-bottom: 1px solid #ddd;
Jacob Thornton's avatar
Jacob Thornton committed
29
  }
30
31
32
  td {
    vertical-align: top;
  }
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
  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
52
53
}

54

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

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

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

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