tables.less 3.16 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
15

table {
  width: 100%;
  margin-bottom: @baseline;
  padding: 0;
  text-align: left;
  border-collapse: separate;
16
  font-size: 13px;
Jacob Thornton's avatar
Jacob Thornton committed
17
18
  th, td {
    padding: 10px 10px 9px;
19
    line-height: @baseline * .75;
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
35
36
37

// Default zebra-stripe styles (alternating gray and transparent backgrounds)
table.zebra-striped {
  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
  th.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
59

  // Style the sorted column headers (THs)
Jacob Thornton's avatar
Jacob Thornton committed
60
  th.headerSortUp,
61
  th.headerSortDown {
Jacob Thornton's avatar
Jacob Thornton committed
62
63
    background-color: rgba(141,192,219,.25);
    text-shadow: 0 1px 1px rgba(255,255,255,.75);
64
    .border-radius(3px 3px 0 0);
Jacob Thornton's avatar
Jacob Thornton committed
65
  }
66
67
68

  // Style the ascending (reverse alphabetical) column header
  th.header:hover {
69
70
71
    &:after {
      visibility:visible;
    }
Jacob Thornton's avatar
Jacob Thornton committed
72
73
  }
  th.actions:hover {
74
    background-image: none;
Jacob Thornton's avatar
Jacob Thornton committed
75
  }
76
77

  // Style the descending (alphabetical) column header
Jacob Thornton's avatar
Jacob Thornton committed
78
  th.headerSortDown,
79
  th.headerSortDown:hover {
80
81
82
83
    &:after {
      visibility:visible;
      .opacity(60);
    }
Jacob Thornton's avatar
Jacob Thornton committed
84
  }
85
86
87

  // Style the ascending (reverse alphabetical) column header
  th.headerSortUp {
88
89
90
91
92
93
94
95
96
    &: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
97
  }
98

Jacob Thornton's avatar
Jacob Thornton committed
99
100
101
102
103
104
105
106
  // Blue Table Headings
  th.blue {
    color: @blue;
    border-bottom-color: @blue;
  }
  th.headerSortUp.blue, th.headerSortDown.blue {
    background-color: lighten(@blue, 40%);
  }
107

Jacob Thornton's avatar
Jacob Thornton committed
108
109
110
111
112
113
114
115
  // Green Table Headings
  th.green {
    color: @green;
    border-bottom-color: @green;
  }
  th.headerSortUp.green, th.headerSortDown.green { // backround color is 20% of border color
    background-color: lighten(@green, 40%);
  }
116

Jacob Thornton's avatar
Jacob Thornton committed
117
118
119
120
121
  // Red Table Headings
  th.red {
    color: @red;
    border-bottom-color: @red;
  }
122
  th.headerSortUp.red, th.headerSortDown.red {
Jacob Thornton's avatar
Jacob Thornton committed
123
124
    background-color: lighten(@red, 50%);
  }
125

Jacob Thornton's avatar
Jacob Thornton committed
126
127
128
129
130
  // Yellow Table Headings
  th.yellow {
    color: @yellow;
    border-bottom-color: @yellow;
  }
131
  th.headerSortUp.yellow, th.headerSortDown.yellow {
Jacob Thornton's avatar
Jacob Thornton committed
132
133
    background-color: lighten(@yellow, 40%);
  }
134

Jacob Thornton's avatar
Jacob Thornton committed
135
136
137
138
139
  // Orange Table Headings
  th.orange {
    color: @orange;
    border-bottom-color: @orange;
  }
140
  th.headerSortUp.orange, th.headerSortDown.orange {
Jacob Thornton's avatar
Jacob Thornton committed
141
142
    background-color: lighten(@orange, 40%);
  }
143

Jacob Thornton's avatar
Jacob Thornton committed
144
145
146
147
148
  // Purple Table Headings
  th.purple {
    color: @purple;
    border-bottom-color: @purple;
  }
149
  th.headerSortUp.purple, th.headerSortDown.purple {
Jacob Thornton's avatar
Jacob Thornton committed
150
151
152
    background-color: lighten(@purple, 40%);
  }
}