UNPKG

1.12 kBSCSSView Raw
1// @access public
2// @content Includes a block of styles for sticky data tables that sets table max-width, max-height and column min-width
3// @example - @include sticky-header($max-height: rem(900px), $min-width: rem(30px));
4// @param {value} $max-width [100%] - sets the max-width of the data table parent container
5// @param {value} $max-height [rem(300px)] - sets the max-height of the data table
6// @param {value} $min-width [rem(100px)] - sets the min-width of th's and td's so their sizes align
7@mixin sticky-header(
8 $min-width: false,
9 $max-width: 100%,
10 $max-height: rem(300px)
11) {
12 .#{$prefix}--data-table--max-width {
13 max-width: $max-width;
14 }
15
16 .#{$prefix}--data-table--sticky-header {
17 max-height: $max-height;
18
19 @if $min-width {
20 th:not(.#{$prefix}--table-column-checkbox):not(.#{$prefix}--table-column-menu):not(.#{$prefix}--table-expand):not(.#{$prefix}--table-column-icon),
21 td:not(.#{$prefix}--table-column-checkbox):not(.#{$prefix}--table-column-menu):not(.#{$prefix}--table-expand):not(.#{$prefix}--table-column-icon) {
22 min-width: $min-width;
23 }
24 }
25 }
26}