-
Notifications
You must be signed in to change notification settings - Fork 9
/
_table.scss
145 lines (117 loc) · 2.61 KB
/
_table.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
/*------------------------------------*\
# TABLE
\*------------------------------------*/
/**
* The table object allows you to make complex tables,
* from football league tables to medals tables.
*/
.gs-o-table {
width: 100%;
border-collapse: separate;
margin-bottom: double($gel-spacing-unit);
}
.gs-o-table--fixed {
table-layout: fixed;
}
/**
* Add a parent div around a table with this class to allow it
* to be scrollable horizontally if the viewport is to small.
*/
.gs-o-table-container {
width: 100%;
overflow-y: auto;
}
.gs-o-table__head {
background: $sp-c-mist;
.gs-o-table__cell {
border-bottom: 1px solid $sp-c-silver;
@if $enhanced {
padding-top: double($gel-spacing-unit);
padding-bottom: halve($gel-spacing-unit);
vertical-align: bottom;
}
}
}
/**
* Adds hover state to table row if required.
*/
.gs-o-table__row {
&:focus,
&:hover {
background-color: $sp-c-mist;
}
}
.gs-o-table__row--disabled {
&,
.gs-o-table__link {
color: $sp-c-mortar;
}
}
.gs-o-table__row--highlighted {
background-color: $sp-c-solitude-blue;
&:focus,
&:hover {
background-color: darken($sp-c-solitude-blue, 5%);
}
.gs-o-table__cell {
border-bottom: 1px solid darken($sp-c-solitude-blue, 4%);
}
}
/**
* Use to break up tables to show boundaries or breaks.
*/
.gs-o-table__row--break {
.gs-o-table__cell {
border-bottom: 1px dashed $sp-c-charcoal;
}
}
/**
* 1. Force first and last cells to have increased padding
*/
.gs-o-table__cell {
border-bottom: 1px solid $sp-c-cloud;
padding: $gel-spacing-unit halve($gel-spacing-unit);
text-align: center;
&:first-child {
#{$padding-left}: $gel-spacing-unit; /* [1] */
}
&:last-child {
#{$padding-right}: $gel-spacing-unit; /* [1] */
}
}
.gs-o-table__cell--flush {
padding: 0;
}
.gs-o-table__cell--no-border {
border-bottom: 0;
}
.gs-o-table__cell--border-right {
#{$border-right}: 1px solid $sp-c-cloud;
}
.gs-o-table__cell--border-left {
#{$border-left}: 1px solid $sp-c-cloud;
}
.gs-o-table__cell--left {
text-align: flip(left, right);
}
.gs-o-table__cell--center {
text-align: center;
}
.gs-o-table__cell--right {
text-align: flip(right, left);
}
.gs-o-table__cell--bold {
font-weight: bold;
}
.gs-o-table__cell--break {
border-top: 1px dashed $sp-c-charcoal;
}
.gs-o-table__link {
display: block;
color: $sp-c-black;
font-weight: bold;
&:focus,
&:hover {
text-decoration: underline;
}
}