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

Commit 7938c90

Browse files
committed
Tables: Add variables for base table styles
1 parent 56f54ed commit 7938c90

File tree

3 files changed

+45
-11
lines changed

3 files changed

+45
-11
lines changed

scss/atoms/tables/_mixins.scss

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/*
2+
* ==========================================================================
3+
* Table mixins
4+
* ==========================================================================
5+
*/

scss/atoms/tables/_tables.scss

+14-11
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,38 @@
11
/*
22
* ==========================================================================
3-
* Typography
3+
* Tables
44
* ==========================================================================
55
*/
66

7+
@import
8+
"dist/chassis",
9+
"mixins";
10+
711
table {
812
width: 100%;
9-
margin-bottom: em( 20px, 16px );
10-
font-size: em( 16px );
13+
margin: map-get($table-base, margin);
14+
font-size: map-get($table-base, font-size);
1115
text-align: left;
1216
}
1317

1418
thead {
15-
border-bottom: 1px solid #eee;
16-
19+
border-bottom: map-get($table-base, border);
1720
> tr > th {
1821
border-top: 0;
1922
}
2023
}
2124

2225
td {
23-
border-top: 1px solid #eee;
24-
padding: em( 12px, 16px );
26+
border-top: map-get($table-base, border);
27+
padding: map-get($table-base, padding);
2528
}
2629

2730
th {
28-
border-top: 1px solid #eee;
29-
padding: em( 12px, 12px );
30-
color: #666;
31+
border-top: map-get($table-base, border);
32+
padding: map-get($table-base, padding);
33+
color: map-get($table-base, color);
3134
font-weight: 400;
32-
font-size: em( 12px, 16px );
35+
font-size: map-get($table-base, thead-font-size);
3336
white-space: nowrap;
3437
}
3538

scss/variables/tables.js

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
( function( root, factory ) {
2+
if ( typeof define === "function" && define.amd ) {
3+
define( [ "./chassis" ], factory );
4+
} else if ( typeof exports === "object" ) {
5+
module.exports = factory( require( "./chassis" ) );
6+
} else {
7+
root.chassis = factory( root.chassis );
8+
}
9+
}( this, function( chassis ) {
10+
11+
chassis.table = {
12+
"table-base": {
13+
name: "Table Element",
14+
value: {
15+
"margin": "0 0 1em",
16+
"font-size": "16px",
17+
"thead-font-size" : "12px",
18+
"border": "1px solid #eee",
19+
"padding" : "12px",
20+
"color" : "#666"
21+
}
22+
},
23+
};
24+
25+
return chassis;
26+
} ) );

0 commit comments

Comments
 (0)