From 68c58055f978248d8cad5b78b107bbada9d89164 Mon Sep 17 00:00:00 2001 From: jlukic Date: Thu, 2 Oct 2014 19:24:14 -0400 Subject: [PATCH] Adds collapsing, aligned, attached tables. --- src/definitions/collections/table.less | 64 ++++++++++++++++++- .../default/collections/table.variables | 5 ++ 2 files changed, 67 insertions(+), 2 deletions(-) diff --git a/src/definitions/collections/table.less b/src/definitions/collections/table.less index 9d2414fa5..760abee72 100755 --- a/src/definitions/collections/table.less +++ b/src/definitions/collections/table.less @@ -199,7 +199,7 @@ Definition ---------------*/ -.ui.definition.table th:first-child { +.ui.definition.table thead th:first-child { pointer-events: none; background: @definitionHeaderBackground; font-weight: @definitionHeaderFontWeight; @@ -208,7 +208,7 @@ } /* Remove Border */ -.ui.celled.definition.table th:first-child { +.ui.celled.definition.table thead th:first-child { box-shadow: 0px -1px 0px @borderWidth @definitionPageBackground; } @@ -347,6 +347,66 @@ Variations *******************************/ +/*-------------- + Aligned +---------------*/ + +.ui.table[class*="left aligned"], +.ui.table [class*="left aligned"] { + text-align: left; +} +.ui.table[class*="center aligned"], +.ui.table [class*="center aligned"] { + text-align: center; +} +.ui.table[class*="right aligned"], +.ui.table [class*="right aligned"] { + text-align: right; +} + +/*-------------- + Collapsing +---------------*/ + +.ui.table th.collapsing, +.ui.table td.collapsing { + width: 1px; + white-space: nowrap; +} + + +/*-------------- + Attached +---------------*/ + + +/* All */ +.ui.attached.table { + width: @attachedTableWidth; + margin: 0em @attachedHorizontalOffset; + border-radius: 0px; + box-shadow: @attachedBoxShadow; +} + +/* Top */ +.ui[class*="top attached"].table { + margin-top: @margin; + border-radius: @borderRadius @borderRadius 0em 0em; +} +.ui.table[class*="top attached"]:first-child { + margin-top: 0em; +} + +/* Bottom */ +.ui.table[class*="bottom attached"] { + margin-top: 0em; + margin-bottom: @margin; + border-radius: 0em 0em @borderRadius @borderRadius; +} +.ui.table[class*="bottom attached"]:last-child { + margin-bottom: 0em; +} + /*-------------- Striped ---------------*/ diff --git a/src/themes/packages/default/collections/table.variables b/src/themes/packages/default/collections/table.variables index 9e0f58ee6..62b9d8596 100755 --- a/src/themes/packages/default/collections/table.variables +++ b/src/themes/packages/default/collections/table.variables @@ -121,6 +121,11 @@ Types ---------------*/ +/* Attached */ +@attachedHorizontalOffset: -1px; +@attachedBoxShadow: none; +@attachedTableWidth: ~"calc(100% + "-@attachedHorizontalOffset * 2~")"; + /* Striped */ @stripedBackground: rgba(0, 0, 50, 0.03); @invertedStripedBackground: rgba(255, 255, 255, 0.06);