tables.less 3.03 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
14

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

30

31
32
// ZEBRA-STRIPING
// --------------
Jacob Thornton's avatar
Jacob Thornton committed
33
34

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

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

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