Skip to content
This repository was archived by the owner on Dec 11, 2021. It is now read-only.

Commit cbe6c56

Browse files
MichaelArestadkristyjy
authored andcommitted
Build: Initial table styles
1 parent 437f2a2 commit cbe6c56

File tree

4 files changed

+231
-0
lines changed

4 files changed

+231
-0
lines changed

demos/tables.html

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>CSS Chassis - Tables</title>
6+
<meta name="description" content="Typography skeleton for styling">
7+
<meta name="viewport" content="width=device-width, initial-scale=1">
8+
<link rel="stylesheet" href="../dist/css/chassis.css">
9+
<link rel="stylesheet" href="demos.css">
10+
<link href="http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600,700,400italic,700italic" rel="stylesheet">
11+
</head>
12+
<body>
13+
14+
<h1>CSS Chassis</h1>
15+
16+
<hr>
17+
18+
<h2>Tables</h2>
19+
20+
<p>Here's a paragraph to show spacing around the table. Aenean lacinia bibendum nulla sed consectetur. Maecenas faucibus mollis interdum..</p>
21+
22+
<table>
23+
<thead>
24+
<tr>
25+
<th>#</th>
26+
<th>Table heading</th>
27+
<th>Table heading</th>
28+
<th>Table heading</th>
29+
</tr>
30+
</thead>
31+
<tbody>
32+
<tr>
33+
<th>1</th>
34+
<td>Table cell</td>
35+
<td>Table cell</td>
36+
<td>Table cell</td>
37+
</tr>
38+
<tr>
39+
<th>2</th>
40+
<td>Table cell</td>
41+
<td>Table cell</td>
42+
<td>Table cell</td>
43+
</tr>
44+
<tr>
45+
<th>3</th>
46+
<td>Table cell</td>
47+
<td>Table cell</td>
48+
<td>Table cell</td>
49+
</tr>
50+
</tbody>
51+
</table>
52+
53+
<p>Here"s a paragraph to show spacing around the table. Aenean lacinia bibendum nulla sed consectetur. Maecenas faucibus mollis interdum..</p>
54+
55+
<div class="overflow-indicator__wrapper">
56+
<table class="overflow-indicator__content">
57+
<thead>
58+
<tr>
59+
<th>#</th>
60+
<th>Table heading</th>
61+
<th>Table heading</th>
62+
<th>Table heading</th>
63+
<th>Table heading</th>
64+
<th>Table heading</th>
65+
<th>Table heading</th>
66+
<th>Table heading</th>
67+
<th>Table heading</th>
68+
<th>Table heading</th>
69+
</tr>
70+
</thead>
71+
<tbody>
72+
<tr>
73+
<th>1</th>
74+
<td>Table cell</td>
75+
<td>Table cell</td>
76+
<td>Table cell</td>
77+
<td>Table cell</td>
78+
<td>Table cell</td>
79+
<td>Table cell</td>
80+
<td>Table cell</td>
81+
<td>Table cell</td>
82+
<td>Table cell</td>
83+
</tr>
84+
<tr>
85+
<th>2</th>
86+
<td>Table cell</td>
87+
<td>Table cell</td>
88+
<td>Table cell</td>
89+
<td>Table cell</td>
90+
<td>Table cell</td>
91+
<td>Table cell</td>
92+
<td>Table cell</td>
93+
<td>Table cell</td>
94+
<td>Table cell</td>
95+
</tr>
96+
<tr>
97+
<th>3</th>
98+
<td>Table cell</td>
99+
<td>Table cell</td>
100+
<td>Table cell</td>
101+
<td>Table cell</td>
102+
<td>Table cell</td>
103+
<td>Table cell</td>
104+
<td>Table cell</td>
105+
<td>Table cell</td>
106+
<td>Table cell</td>
107+
</tr>
108+
</tbody>
109+
</table>
110+
</div>
111+
112+
<p>Here"s a paragraph to show spacing around the table. Aenean lacinia bibendum nulla sed consectetur. Maecenas faucibus mollis interdum.</p>
113+
114+
</body>
115+
</html>

scss/atoms/_overflow-indicator.scss

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// ==========================================================================
2+
// Overflow Indicator
3+
//
4+
// Shows indicator when there is more horizontal content.
5+
//
6+
// EXAMPLE
7+
// <div class="overflow-indicator__wrapper">
8+
// <div class="overflow-indicator__content">...</div>
9+
// </div>
10+
// ==========================================================================
11+
12+
.overflow-indicator__wrapper {
13+
position: relative;
14+
z-index: 1;
15+
margin-bottom: em( 20px );
16+
border: 0;
17+
background: #fff no-repeat;
18+
background-image: radial-gradient( farthest-side at 0 50%,rgba( 0, 0, 0, .2 ), transparent ), radial-gradient( farthest-side at 100% 50%, rgba( 0, 0, 0, .2 ), transparent );
19+
background-position: 0 0, 100% 0;
20+
background-size: 10px 100%;
21+
overflow: auto;
22+
}
23+
24+
.overflow-indicator__wrapper > .overflow-indicator__content {
25+
position: relative;
26+
margin-bottom: 0;
27+
28+
&:before,
29+
&:after {
30+
content: "";
31+
position: absolute;
32+
top: 0;
33+
bottom: 0;
34+
left: 0;
35+
z-index: -1;
36+
margin: 0 -30px 0 0;
37+
width: 30px;
38+
background: linear-gradient( to right, #fff, #fff 30%, rgba( 255, 255, 255, 0 ) );
39+
}
40+
&:after {
41+
left: auto;
42+
right: 0;
43+
margin: 0 0 0 -30px;
44+
background: linear-gradient( to right, rgba( 255, 255, 255, 0 ), #fff 70%, #fff );
45+
}
46+
}

scss/atoms/_tables.scss

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
// ==========================================================================
2+
// Typography
3+
// ==========================================================================
4+
5+
table {
6+
width: 100%;
7+
margin-bottom: em( 20px, 16px );
8+
font-size: em( 16px );
9+
text-align: left;
10+
}
11+
12+
thead {
13+
border-bottom: 1px solid #eee;
14+
15+
> tr > th {
16+
border-top: 0;
17+
}
18+
}
19+
20+
td {
21+
border-top: 1px solid #eee;
22+
padding: em( 12px, 16px );
23+
}
24+
25+
th {
26+
border-top: 1px solid #eee;
27+
padding: em( 12px, 12px );
28+
color: #666;
29+
font-weight: 400;
30+
font-size: em( 12px, 16px );
31+
white-space: nowrap;
32+
}
33+
34+
.table--responsive {
35+
position: relative;
36+
z-index: 1;
37+
margin-bottom: em( 20px );
38+
border: 0;
39+
background: #fff no-repeat;
40+
background-image: radial-gradient( farthest-side at 0 50%,rgba( 0, 0, 0, .2 ), transparent ), radial-gradient( farthest-side at 100% 50%, rgba( 0, 0, 0, .2 ), transparent );
41+
background-position: 0 0, 100% 0;
42+
background-size: 10px 100%;
43+
overflow: auto;
44+
45+
table {
46+
position: relative;
47+
margin-bottom: 0;
48+
49+
&:before,
50+
&:after {
51+
content: "";
52+
position: absolute;
53+
top: 0;
54+
bottom: 0;
55+
left: 0;
56+
z-index: -1;
57+
margin: 0 -30px 0 0;
58+
width: 30px;
59+
background: linear-gradient( to right, #fff, #fff 30%, rgba( 255, 255, 255, 0 ) );
60+
}
61+
&:after {
62+
left: auto;
63+
right: 0;
64+
margin: 0 0 0 -30px;
65+
background: linear-gradient( to right, rgba( 255, 255, 255, 0 ), #fff 70%, #fff );
66+
}
67+
}
68+
}

scss/lint.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
@import
1919
"atoms/icons/icons",
2020
"atoms/typography/typography",
21+
"atoms/tables",
22+
"atoms/overflow-indicator",
2123
"atoms/buttons/buttons";
2224

2325
@import

0 commit comments

Comments
 (0)