]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Add nest variable to allow namespacing for core table scss 7454/head
authorthiggins <thiggins@thiggins.dev.insightsquared.com>
Mon, 28 Dec 2015 14:55:17 +0000 (14:55 +0000)
committerthiggins <thiggins@thiggins.dev.insightsquared.com>
Mon, 28 Dec 2015 14:55:17 +0000 (14:55 +0000)
scss/components/_table.scss

index dc2e36904564447aac2a23933ea56b8a8b62782a..81a73dd7c6c15e0cb75d140041954fe43b701f55 100644 (file)
@@ -60,12 +60,7 @@ $table-head-font-color: $body-font-color !default;
 /// @type Boolean
 $show-header-for-stacked: false !default;
 
-/// Adds the general styles for tables.
-/// @param {Keyword} $stripe [$table-stripe] - Uses keywords even, odd, or none to darken rows of the table. The default value is even.
-@mixin table($stripe: $table-stripe) {
-  margin-bottom: $global-margin;
-  border-radius: $global-radius;
-
+@mixin -zf-table-children-styles($stripe: $table-stripe) {
   thead,
   tbody,
   tfoot {
@@ -124,6 +119,25 @@ $show-header-for-stacked: false !default;
   }
 }
 
+/// Adds the general styles for tables.
+/// @param {Keyword} $stripe [$table-stripe] - Uses keywords even, odd, or none to darken rows of the table. The default value is even.
+@mixin table(
+  $stripe: $table-stripe,
+  $nest: false
+) {
+  margin-bottom: $global-margin;
+  border-radius: $global-radius;
+
+  @if $nest {
+    @include -zf-table-children-styles($stripe);
+  }
+  @else {
+    @at-root {
+      @include -zf-table-children-styles($stripe);
+    }
+  }
+}
+
 /// Adds the ability to horizontally scroll the table when the content overflows horizontally.
 @mixin table-scroll {
   display: block;
@@ -189,9 +203,9 @@ $show-header-for-stacked: false !default;
   }
 }
 
-@mixin foundation-table {
+@mixin foundation-table($nest: false) {
   table {
-    @include table;
+    @include table($nest: $nest);
   }
 
   table.stack {