From 7938c90619ef3440c5eef084b5e8d9db9fe8c0c0 Mon Sep 17 00:00:00 2001 From: Kristy Yeaton Date: Mon, 14 Mar 2016 22:43:10 -0400 Subject: [PATCH] Tables: Add variables for base table styles --- scss/atoms/tables/_mixins.scss | 5 +++++ scss/atoms/tables/_tables.scss | 25 ++++++++++++++----------- scss/variables/tables.js | 26 ++++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 11 deletions(-) create mode 100644 scss/atoms/tables/_mixins.scss create mode 100644 scss/variables/tables.js diff --git a/scss/atoms/tables/_mixins.scss b/scss/atoms/tables/_mixins.scss new file mode 100644 index 0000000..f5b20c4 --- /dev/null +++ b/scss/atoms/tables/_mixins.scss @@ -0,0 +1,5 @@ +/* +* ========================================================================== +* Table mixins +* ========================================================================== +*/ \ No newline at end of file diff --git a/scss/atoms/tables/_tables.scss b/scss/atoms/tables/_tables.scss index 0d5a059..6ae9d28 100644 --- a/scss/atoms/tables/_tables.scss +++ b/scss/atoms/tables/_tables.scss @@ -1,35 +1,38 @@ /* * ========================================================================== -* Typography +* Tables * ========================================================================== */ +@import + "dist/chassis", + "mixins"; + table { width: 100%; - margin-bottom: em( 20px, 16px ); - font-size: em( 16px ); + margin: map-get($table-base, margin); + font-size: map-get($table-base, font-size); text-align: left; } thead { - border-bottom: 1px solid #eee; - + border-bottom: map-get($table-base, border); > tr > th { border-top: 0; } } td { - border-top: 1px solid #eee; - padding: em( 12px, 16px ); + border-top: map-get($table-base, border); + padding: map-get($table-base, padding); } th { - border-top: 1px solid #eee; - padding: em( 12px, 12px ); - color: #666; + border-top: map-get($table-base, border); + padding: map-get($table-base, padding); + color: map-get($table-base, color); font-weight: 400; - font-size: em( 12px, 16px ); + font-size: map-get($table-base, thead-font-size); white-space: nowrap; } diff --git a/scss/variables/tables.js b/scss/variables/tables.js new file mode 100644 index 0000000..1fef34f --- /dev/null +++ b/scss/variables/tables.js @@ -0,0 +1,26 @@ +( function( root, factory ) { + if ( typeof define === "function" && define.amd ) { + define( [ "./chassis" ], factory ); + } else if ( typeof exports === "object" ) { + module.exports = factory( require( "./chassis" ) ); + } else { + root.chassis = factory( root.chassis ); + } +}( this, function( chassis ) { + +chassis.table = { + "table-base": { + name: "Table Element", + value: { + "margin": "0 0 1em", + "font-size": "16px", + "thead-font-size" : "12px", + "border": "1px solid #eee", + "padding" : "12px", + "color" : "#666" + } + }, +}; + +return chassis; +} ) ); \ No newline at end of file