Skip to content

Commit

Permalink
feat(tables): remove table variants forbidden by Orange Brand for #283
Browse files Browse the repository at this point in the history
  • Loading branch information
ffoodd committed Jan 22, 2020
1 parent 2b00e56 commit 1ed8b39
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 536 deletions.
91 changes: 8 additions & 83 deletions scss/_tables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,46 +41,11 @@
}
}

// Boosted mod: no .table-bordered

// Border versions
//
// Add or remove borders all around the table and between all the columns.

.table-bordered {
border: $table-border-width solid $table-border-color;

th,
td {
border: $table-border-width solid $table-border-color;
}

thead {
th,
td {
border-bottom-width: 2 * $table-border-width;
}
}
}

.table-borderless {
th,
td,
thead th,
tbody + tbody {
border: 0;
}
}

// Zebra-striping
//
// Default zebra-stripe styles (alternating gray and transparent backgrounds)

.table-striped {
tbody tr:nth-of-type(#{$table-striped-order}) {
background-color: $table-accent-bg;
}
}
// Boosted mod: no .table-borderless

// Boosted mod: no .table-striped

// Hover effect
//
Expand All @@ -96,40 +61,9 @@
}


// Table backgrounds
//
// Exact selectors below required to override `.table-striped` and prevent
// inheritance to nested tables.

@each $color, $value in $theme-colors {
@include table-row-variant($color, color-level($value, $table-bg-level), color-level($value, $table-border-level));
}

@include table-row-variant(active, $table-active-bg);

// Boosted mod: no table-row-variants

// Dark styles
//
// Same table markup, but inverted color scheme: dark background and light text.

// stylelint-disable-next-line no-duplicate-selectors
.table {
.thead-dark {
th {
color: $table-dark-color;
background-color: $table-dark-bg;
border-color: $table-dark-border-color;
}
}

.thead-light {
th {
color: $table-head-color;
background-color: $table-head-bg;
border-color: $table-border-color;
}
}
}
// Boosted mod: no .thead-light nor .thead-dark

.table-dark {
color: $table-dark-color;
Expand All @@ -141,15 +75,9 @@
border-color: $table-dark-border-color;
}

&.table-bordered {
border: 0;
}
// Boosted mod: no .table-bordered

&.table-striped {
tbody tr:nth-of-type(#{$table-striped-order}) {
background-color: $table-dark-accent-bg;
}
}
// Boosted mod: no .table-striped

&.table-hover {
tbody tr {
Expand Down Expand Up @@ -179,10 +107,7 @@
overflow-x: auto;
-webkit-overflow-scrolling: touch;

// Prevent double border on horizontal scroll due to use of `display: block;`
> .table-bordered {
border: 0;
}
// Boosted mod: no .table-bordered
}
}
}
Expand Down
38 changes: 1 addition & 37 deletions scss/mixins/_table-row.scss
Original file line number Diff line number Diff line change
@@ -1,39 +1,3 @@
// Tables

@mixin table-row-variant($state, $background, $border: null) {
// Exact selectors below required to override `.table-striped` and prevent
// inheritance to nested tables.
.table-#{$state} {
&,
> th,
> td {
background-color: $background;
}

@if $border != null {
th,
td,
thead th,
tbody + tbody {
border-color: $border;
}
}
}

// Hover states for `.table-hover`
// Note: this is not available for cells or rows within `thead` or `tfoot`.
.table-hover {
$hover-background: darken($background, 5%);

.table-#{$state} {
&:hover {
background-color: $hover-background;

> td,
> th {
background-color: $hover-background;
}
}
}
}
}
// Boosted mod: no table-row-variants
Loading

0 comments on commit 1ed8b39

Please sign in to comment.