-
Notifications
You must be signed in to change notification settings - Fork 2
/
_base.tables.scss
187 lines (166 loc) · 5.65 KB
/
_base.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
/*
* Copyright (c) 2018, General Electric
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
////
/// PX-TABLES-DESIGN
/// Basic table styles
/// @group px-tables-design
////
@import "px-defaults-design/_settings.defaults.scss";
@import "px-colors-design/_settings.colors.scss";
/// Prepend value for all generated classes
/// @group px-tables-design:variables:style
/// @type String [default]
/// @todo n/a
$inuit-table-namespace : $inuit-namespace !default;
/// Border width
/// @group px-tables-design:variables:style
/// @type Number [default]
/// @todo n/a
$inuit-table-border-width : 1px !default;
/// Border style
/// @group px-tables-design:variables:style
/// @type String [default]
/// @todo n/a
$inuit-table-border-style : solid !default;
/// Border color
/// @group px-tables-design:variables:style
/// @type Color [default]
/// @todo --px-table-border-color
$inuit-table-border-color : var(--px-table-border-color, $gray10) !default;
/// Separator (interior border) color
/// @group px-tables-design:variables:style
/// @type Color [default]
/// @todo --px-table-separator-color
$inuit-table-separator-color : var(--px-table-separator-color, $gray5) !default;
/// Enable tables with fixed width columns?
/// @group px-tables-design:variables:flag
/// @type Boolean [default]
$inuit-enable-table--fixed : false !default;
/// Enable tables with small cell padding?
/// @group px-tables-design:variables:flag
/// @type Boolean [default]
$inuit-enable-table--small : false !default;
/// Enable tables with large cell padding?
/// @group px-tables-design:variables:flag
/// @type Boolean [default]
$inuit-enable-table--large : false !default;
/// Enable tables with no borders?
/// @group px-tables-design:variables:flag
/// @type Boolean [default]
$inuit-enable-table--no-cells : false !default;
/// Enable tables with column borders but no row borders?
/// @group px-tables-design:variables:flag
/// @type Boolean [default]
$inuit-enable-table--columns : false !default;
/// Enable tables with column borders but no row borders?
/// @group px-tables-design:variables:flag
/// @type Boolean [default]
$inuit-enable-table--cells : false !default;
/// Enable tables with text alignment in headers
/// @group px-tables-design:variables:style
/// @type String [default]
/// @todo n/a
$inuit-table-header-text-align : left !default;
/// Default table
.#{$inuit-table-namespace}table,
%#{$inuit-table-namespace}table {
width: 100%;
border-collapse: collapse;
border-spacing: 0;
th, td {
padding: 12px;
}
th {
text-align: $inuit-table-header-text-align;
text-transform: uppercase;
font-size: 12px;
color: $gray10;
font-weight: normal;
border-bottom: $inuit-table-border-width $inuit-table-border-style $inuit-table-border-color;
}
td {
border-bottom: $inuit-table-border-width $inuit-table-border-style $inuit-table-separator-color;
border-top: $inuit-table-border-width $inuit-table-border-style $inuit-table-separator-color;
}
tr:last-of-type td {
border-bottom: $inuit-table-border-width $inuit-table-border-style $inuit-table-border-color;
}
}
/// Table with fixed column widths
@if ($inuit-enable-table--fixed == true) {
.#{$inuit-table-namespace}table--fixed,
%#{$inuit-table-namespace}table--fixed {
table-layout: fixed;
}
}
/// Table with small padding / tightly packed cells
@if ($inuit-enable-table--small == true) {
.#{$inuit-table-namespace}table--small,
%#{$inuit-table-namespace}table--small {
th, td {
padding: $inuit-base-spacing-unit--tiny;
}
}
}
/// Table with large padding / widely spaced cells
@if ($inuit-enable-table--large == true) {
.#{$inuit-table-namespace}table--large,
%#{$inuit-table-namespace}table--large {
th, td {
padding: $inuit-base-spacing-unit;
}
}
}
/// Table with no row borders, just column borders
@if ($inuit-enable-table--columns == true) {
.#{$inuit-table-namespace}table--columns,
%#{$inuit-table-namespace}table--columns {
&, th, td, tr:last-of-type td {
border: 0;
}
}
.#{$inuit-table-namespace}table--columns,
%#{$inuit-table-namespace}table--columns {
border-left: $inuit-table-border-width $inuit-table-border-style $inuit-table-border-color;
th, td, tr:last-of-type td {
border-right: $inuit-table-border-width $inuit-table-border-style $inuit-table-separator-color;
}
td:last-of-type, th:last-of-type, tr:last-of-type td:last-of-type {
border-right: $inuit-table-border-width $inuit-table-border-style $inuit-table-border-color;
}
}
}
/// Table with all borders (both row and column)
@if ($inuit-enable-table--cells == true) {
.#{$inuit-table-namespace}table--cells,
%#{$inuit-table-namespace}table--cells {
td, tr:last-of-type td {
border: $inuit-table-border-width $inuit-table-border-style $inuit-table-separator-color;
}
&, th {
border: 0;
}
}
}
/// Table with no borders at all
@if ($inuit-enable-table--no-cells == true) {
.#{$inuit-table-namespace}table--no-cells,
%#{$inuit-table-namespace}table--no-cells {
th, td, tr:last-of-type td {
border: 0;
}
}
}