This repository has been archived by the owner on Oct 17, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_tables.scss
187 lines (154 loc) · 3.15 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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
/*===============================================
Tables - Co-op Front-end Toolkit
===============================================*/
@import "variables";
@import "mixins/helpers";
@import "mixins/typography";
table {
width: 100%;
table-layout: fixed;
@include body;
@include spacing('margin', 'bottom', 'half');
caption {
font-family: $bold;
text-align: left;
}
th {
font-family: $bold;
}
th,
td {
padding: $quarter-spacing-unit $quarter-spacing-unit $quarter-spacing-unit 0;
text-align: left;
vertical-align: top;
}
thead {
border-bottom: 2px solid $coop-border-grey;
.regular-th {
font-family: $regular;
}
}
tbody {
th {
position: relative;
&:after {
content: '';
position : absolute;
left: 0;
bottom: -1px;
height: 1px;
width: 80%;
border-bottom: 1px solid $coop-border-grey;
}
}
td {
border-bottom: 1px solid $coop-border-grey;
}
}
tfoot {
td {
font-family: $regular;
}
}
ul {
margin-bottom: 0;
}
}
// Stacked columns basic responsive table solution
.table-smallscreen--stacked {
// defaults to 480px
@include media("max-width: 480px") {
th,
td {
padding: $quarter-spacing-unit/4 0 $quarter-spacing-unit/2 0;
text-align: left;
}
thead,
tfoot {
border-bottom: 0;
th,
td {
@include visuallyhidden;
}
}
tbody {
th {
display: block;
border-top: 2px solid $coop-border-grey;
margin-top: $quarter-spacing-unit;
}
.table-smallscreen--stacked_hidden {
display: none;
}
td {
display: block;
border-bottom: 0;
&:before {
content: attr(data-th)"";
vertical-align: top;
font-family: $regular;
font-weight: normal;
// Should be amended with a custom value...
width: 40%;
display: inline-block;
}
}
th:after {
border-bottom: 0;
}
ul {
display: inline-block;
// This old chestnut https://css-tricks.com/fighting-the-space-between-inline-block-elements/
margin-left: -5px;
}
a {
margin-left: -5px;
}
}
}
}
.unstyled-table {
border: 0;
margin-bottom: 0;
th, td {
padding: $eighth-spacing-unit 0;
@include media(medium) {
padding: $quarter-spacing-unit;
}
}
.tr-divider {
border-bottom: 1px solid $coop-border-grey;
}
thead th {
background: $white;
}
tbody th,
tbody td{
background: $white;
border-bottom: 0;
font-family: $regular;
font-weight: normal;
}
.table__bold {
font-family: $bold;
}
}
.border-bottom {
border-bottom: 2px solid $coop-border-grey;
}
.table-header {
padding: 16px 0px 0px 0px;
margin-bottom: 0;
@include media(medium) {
padding: 16px 8px 10px 8px;
}
}
.tight--divider {
font-size: em-calc(18px);
@include spacing('padding', 'bottom', 'quarter');
margin-bottom: 0;
border-bottom: 2px solid $coop-border-grey;
@include media(medium) {
font-size: em-calc(22px);
}
}