-
Notifications
You must be signed in to change notification settings - Fork 4.3k
/
Copy pathstyle.scss
199 lines (169 loc) · 3.45 KB
/
style.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
188
189
190
191
192
193
194
195
196
197
198
199
.wp-block-table {
$subtle-light-gray: #f3f4f5;
$subtle-pale-green: #e9fbe5;
$subtle-pale-blue: #e7f5fe;
$subtle-pale-pink: #fcf0ef;
overflow-x: auto;
table {
border-collapse: collapse;
width: 100%;
}
thead {
border-bottom: 3px solid;
}
tfoot {
border-top: 3px solid;
}
// Match default border style to default style in editor
td,
th {
border: $border-width solid;
padding: 0.5em;
}
// Fixed layout toggle
.has-fixed-layout {
table-layout: fixed;
width: 100%;
td,
th {
word-break: break-word;
}
}
&.alignleft,
&.aligncenter,
&.alignright {
// Override default display property for align styles.
// The table element needs to be kept as display table
// for table features to work reliably.
display: table;
// Table cannot be 100% width if it is aligned, so set
// width as auto.
width: auto;
td,
th {
word-break: break-word;
}
}
.has-subtle-light-gray-background-color {
background-color: $subtle-light-gray;
}
.has-subtle-pale-green-background-color {
background-color: $subtle-pale-green;
}
.has-subtle-pale-blue-background-color {
background-color: $subtle-pale-blue;
}
.has-subtle-pale-pink-background-color {
background-color: $subtle-pale-pink;
}
// "Stripes" style variation.
&.is-style-stripes {
border-spacing: 0;
border-collapse: inherit;
background-color: transparent;
tbody tr:nth-child(odd) {
background-color: $gray-100;
}
&.has-subtle-light-gray-background-color {
tbody tr:nth-child(odd) {
background-color: $subtle-light-gray;
}
}
&.has-subtle-pale-green-background-color {
tbody tr:nth-child(odd) {
background-color: $subtle-pale-green;
}
}
&.has-subtle-pale-blue-background-color {
tbody tr:nth-child(odd) {
background-color: $subtle-pale-blue;
}
}
&.has-subtle-pale-pink-background-color {
tbody tr:nth-child(odd) {
background-color: $subtle-pale-pink;
}
}
th,
td {
border-color: transparent;
}
border-bottom: 1px solid $gray-100;
}
// Border Styles
//
// Allow any custom border color, style or width selections to be inherited
// from the table element that receives the border support props.
.has-border-color {
> *,
tr,
th,
td {
border-color: inherit;
}
}
table[style*="border-top-color"] {
> *,
tr:first-child {
border-top-color: inherit;
th,
td {
border-top-color: inherit;
}
}
tr:not(:first-child) {
border-top-color: currentColor;
}
}
table[style*="border-right-color"] {
> *,
tr,
th,
td:last-child {
border-right-color: inherit;
}
}
table[style*="border-bottom-color"] {
> *,
tr:last-child {
border-bottom-color: inherit;
th,
td {
border-bottom-color: inherit;
}
}
// Border support classes and styles are applied on the table block
// itself. This means that without the rule below every table row would
// have a bottom border matching the color of the table's border.
// This style gives the best visual appearance and most expected result
// until we can control individual table rows or cells via inner blocks.
tr:not(:last-child) {
border-bottom-color: currentColor;
}
}
table[style*="border-left-color"] {
> *,
tr,
th,
td:first-child {
border-left-color: inherit;
}
}
table[style*="border-style"] {
> *,
tr,
th,
td {
border-style: inherit;
}
}
table[style*="border-width"] {
> *,
tr,
th,
td {
border-width: inherit;
border-style: inherit;
}
}
}