-
Notifications
You must be signed in to change notification settings - Fork 414
/
_tables.scss
163 lines (149 loc) · 3.31 KB
/
_tables.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
/*------------------------------------*\
$TABLES
\*------------------------------------*/
/**
* We have a lot at our disposal for making very complex table constructs, e.g.:
*
<table class="table--bordered table--striped table--data">
<colgroup>
<col class=t10>
<col class=t10>
<col class=t10>
<col>
</colgroup>
<thead>
<tr>
<th colspan=3>Foo</th>
<th>Bar</th>
</tr>
<tr>
<th>Lorem</th>
<th>Ipsum</th>
<th class=numerical>Dolor</th>
<th>Sit</th>
</tr>
</thead>
<tbody>
<tr>
<th rowspan=3>Sit</th>
<td>Dolor</td>
<td class=numerical>03.788</td>
<td>Lorem</td>
</tr>
<tr>
<td>Dolor</td>
<td class=numerical>32.210</td>
<td>Lorem</td>
</tr>
<tr>
<td>Dolor</td>
<td class=numerical>47.797</td>
<td>Lorem</td>
</tr>
<tr>
<th rowspan=2>Sit</th>
<td>Dolor</td>
<td class=numerical>09.640</td>
<td>Lorem</td>
</tr>
<tr>
<td>Dolor</td>
<td class=numerical>12.117</td>
<td>Lorem</td>
</tr>
</tbody>
</table>
*
*/
table{
width:100%;
}
th,
td{
padding:$base-spacing-unit / 4;
@media screen and (min-width:480px){
padding:$half-spacing-unit;
}
text-align:left;
}
/**
* Cell alignments
*/
[colspan]{
text-align:center;
}
[colspan="1"]{
text-align:left;
}
[rowspan]{
vertical-align:middle;
}
[rowspan="1"]{
vertical-align:top;
}
.numerical{
text-align:right;
}
/**
* In the HTML above we see several `col` elements with classes whose numbers
* represent a percentage width for that column. We leave one column free of a
* class so that column can soak up the effects of any accidental breakage in
* the table.
*/
.t5 { width: 5% }
.t10 { width:10% }
.t12 { width:12.5% } /* 1/8 */
.t15 { width:15% }
.t20 { width:20% }
.t25 { width:25% } /* 1/4 */
.t30 { width:30% }
.t33 { width:33.333% } /* 1/3 */
.t35 { width:35% }
.t37 { width:37.5% } /* 3/8 */
.t40 { width:40% }
.t45 { width:45% }
.t50 { width:50% } /* 1/2 */
.t55 { width:55% }
.t60 { width:60% }
.t62 { width:62.5% } /* 5/8 */
.t65 { width:65% }
.t66 { width:66.666% } /* 2/3 */
.t70 { width:70% }
.t75 { width:75% } /* 3/4*/
.t80 { width:80% }
.t85 { width:85% }
.t87 { width:87.5% } /* 7/8 */
.t90 { width:90% }
.t95 { width:95% }
/**
* Bordered tables
*/
.table--bordered{
th,
td{
border:1px solid $base-ui-color;
&:empty{
border:none;
}
}
thead tr:last-child th{
border-bottom-width:2px;
}
tbody tr th:last-of-type{
border-right-width:2px;
}
}
/**
* Striped tables
*/
.table--striped{
tbody tr:nth-of-type(odd){
background-color:#ffc; /* Override this color in your theme stylesheet */
}
}
/**
* Data table
*/
.table--data{
font:12px/1.5 sans-serif;
}