Skip to content

Commit

Permalink
Bootstrap changes + fix of previous merges
Browse files Browse the repository at this point in the history
  • Loading branch information
louismaximepiton committed Mar 2, 2022
1 parent 781cf16 commit d8eb752
Show file tree
Hide file tree
Showing 6 changed files with 424 additions and 637 deletions.
26 changes: 17 additions & 9 deletions scss/_tables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
--#{$variable-prefix}table-color: #{$table-color};
--#{$variable-prefix}table-bg: #{$table-bg};
--#{$variable-prefix}table-border-color: #{$table-border-color};
// Boosted mod: no table-accent-bg
--#{$variable-prefix}table-accent-bg: #{$table-accent-bg};
--#{$variable-prefix}table-striped-color: #{$table-striped-color};
--#{$variable-prefix}table-striped-bg: #{$table-striped-bg};
--#{$variable-prefix}table-striped-hover-color: #{$table-striped-color};
--#{$variable-prefix}table-striped-hover-bg: #{$table-striped-hover-bg};
--#{$variable-prefix}table-striped-hover-color: #{$table-striped-color}; // Boosted mod
--#{$variable-prefix}table-striped-hover-bg: #{$table-striped-hover-bg}; // Boosted mod
--#{$variable-prefix}table-active-color: #{$table-active-color};
--#{$variable-prefix}table-active-bg: #{$table-active-bg};
--#{$variable-prefix}table-hover-color: #{$table-hover-color};
Expand Down Expand Up @@ -52,8 +52,13 @@
> tbody {
vertical-align: inherit;
}

> thead {
vertical-align: bottom;
}
}

// Boosted mod : no table-group-divider.

//
// Change placement of captions with a class
Expand Down Expand Up @@ -83,13 +88,16 @@
//
// Default zebra-stripe styles (alternating gray and transparent backgrounds)

// For rows
.table-striped {
> tbody > tr:nth-of-type(#{$table-striped-order}) > * {
--#{$variable-prefix}table-accent-bg: var(--#{$variable-prefix}table-striped-bg);
color: var(--#{$variable-prefix}table-striped-color);
}
}

// Boosted mod : no .table-striped-columns

// Active table
//
// The `.table-active` class can be added to highlight rows or cells
Expand All @@ -109,24 +117,25 @@
color: var(--#{$variable-prefix}table-hover-color);
}

// Boosted mod
&.table-striped > tbody > tr:hover > * {
--#{$variable-prefix}table-accent-bg: var(--#{$variable-prefix}table-striped-hover-bg);
color: var(--#{$variable-prefix}table-striped-hover-color);
}
}

.table-height-sm {
max-height: 200px;
max-height: $table-height-sm;
overflow: auto;
}

.table-height-md {
max-height: 400px;
max-height: $table-height-md;
overflow: auto;
}

.table-height-lg {
max-height: 600px;
max-height: $table-height-lg;
overflow: auto;
}

Expand All @@ -138,13 +147,12 @@

// Redraw the border-bottom, otherwise it doesn't stick.
> th { // stylelint-disable-line
$border-bottom-thead: calc(100% - ($table-border-width * 2)); // stylelint-disable-line function-disallowed-list
$border-bottom-thead: subtract(100%, ($table-border-width * 2));
background: linear-gradient(transparent 0%, transparent $border-bottom-thead, var(--#{$variable-prefix}table-border-color) $border-bottom-thead, var(--#{$variable-prefix}table-border-color) 100%);
background-color: var(--#{$variable-prefix}table-bg);
}
}

// Boosted mod: no table-row-variants
// End mod

// Table variants set the table cell backgrounds, border colors
// and the colors of the striped, hovered & active tables
Expand Down
34 changes: 20 additions & 14 deletions scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -765,41 +765,47 @@ $table-line-height: 1.25 !default; // Boosted mod

$table-color: $body-color !default;
$table-bg: $body-bg !default;
// Boosted mod: no $table-accent-bg
$table-accent-bg: transparent !default;

$table-height-sm: $spacer * 10 !default; // Boosted mod
$table-height-md: $spacer * 20 !default; // Boosted mod
$table-height-lg: $spacer * 30 !default; // Boosted mod

$table-th-font-weight: null !default;

$table-striped-color: $table-color !default;
$table-striped-bg-factor: .065 !default;
$table-variant-striped-bg-factor: .2 !default;
$table-striped-bg: rgba($black, $table-striped-bg-factor) !default;
$table-striped-hover-bg-factor: .4 !default;
$table-variant-striped-hover-bg-factor: .87 !default;
$table-striped-hover-bg: rgba($black, $table-striped-hover-bg-factor) !default;

$table-striped-order: odd !default;
$table-striped-hover-bg-factor: .4 !default; // Boosted mod
$table-striped-hover-bg: rgba($black, $table-striped-hover-bg-factor) !default; // Boosted mod
$table-variant-striped-bg-factor: .2 !default; // Boosted mod
$table-variant-striped-hover-bg-factor: .87 !default; // Boosted mod

$table-active-color: $table-color !default;
$table-active-bg-factor: .13 !default;
$table-variant-active-bg-factor: .6 !default;
$table-active-bg: rgba($black, $table-active-bg-factor) !default;
$table-variant-active-bg-factor: .6 !default; // Boosted mod

$table-hover-color: $table-color !default;
$table-hover-bg-factor: .065 !default;
$table-variant-hover-bg-factor: .2 !default;
$table-hover-bg: rgba($black, $table-hover-bg-factor) !default;
$table-variant-hover-bg-factor: .2 !default; // Boosted mod

$table-border-factor: .4 !default;
$table-border-width: $border-width * .5 !default;
$table-border-color: $gray-500 !default;
$table-border-factor: .4 !default;
$table-border-width: $border-width * .5 !default;
$table-border-color: $gray-500 !default;

// Boosted mod: no $table-striped-*
$table-striped-order: odd !default;

// Boosted mod: no $table-striped-columns

$table-group-separator-color: currentColor !default;
// Boosted mod : no $table-group-separator-color

$table-caption-color: var(--#{$boosted-variable-prefix}caption-color, $black) !default; // Boosted mod
$table-caption-color-dark: $white !default; // Boosted mod
$table-caption-padding-y: .75rem !default; // Boosted mod

// Boosted mod: no $table-bg-scale
// scss-docs-end table-variables

// scss-docs-start table-loop
Expand Down
3 changes: 0 additions & 3 deletions scss/mixins/_table-row.scss

This file was deleted.

10 changes: 5 additions & 5 deletions scss/mixins/_table-variants.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Boosted mod: striped is not handled by table-variant()
// Boosted mod: Variants have a brand different :hover and :striped management
// scss-docs-start table-variant
@mixin table-variant($state, $background) {
.table-#{$state} {
$color: color-contrast(opaque($body-bg, $background));
$striped-bg: mix($color, $background, percentage($table-variant-striped-bg-factor));
$striped-hover-bg: mix($color, $background, percentage($table-variant-striped-hover-bg-factor));
$hover-bg: mix($color, $background, percentage($table-variant-hover-bg-factor));
$striped-bg: mix($color, $background, percentage($table-variant-striped-bg-factor));
$striped-hover-bg: mix($color, $background, percentage($table-variant-striped-hover-bg-factor)); // Boosted mod
$active-bg: mix($color, $background, percentage($table-variant-active-bg-factor));
$border-color: mix($color, $background, percentage($table-border-factor));

Expand All @@ -14,8 +14,8 @@
--#{$variable-prefix}table-border-color: #{$border-color};
--#{$variable-prefix}table-striped-bg: #{$striped-bg};
--#{$variable-prefix}table-striped-color: #{color-contrast($striped-bg)};
--#{$variable-prefix}table-striped-hover-bg: #{$striped-hover-bg};
--#{$variable-prefix}table-striped-hover-color: #{color-contrast($striped-hover-bg)};
--#{$variable-prefix}table-striped-hover-bg: #{$striped-hover-bg}; // Boosted mod
--#{$variable-prefix}table-striped-hover-color: #{color-contrast($striped-hover-bg)}; // Boosted mod
--#{$variable-prefix}table-active-bg: #{$active-bg};
--#{$variable-prefix}table-active-color: #{color-contrast($active-bg)};
--#{$variable-prefix}table-hover-bg: #{$hover-bg};
Expand Down
Loading

0 comments on commit d8eb752

Please # to comment.