SU-SWS/decanter

View on GitHub
core/src/scss/elements/table/_table.scss

Summary

Maintainability
Test Coverage

//
// Table
//
// Default styling for tables. For displaying tabular data that best lends
// itself to being layed out in columns and rows.
// Modifier class available to remove tables borders.
//
// .su-table--borderless  - Borderless Table
//
// Markup: ../../templates/elements/table/table.twig
//
// Style guide: Elements.Table
//
table {
  @include margin(null 0);
  @include responsive-spacing('margin-bottom', 5);
  border-collapse: collapse;
  border-spacing: 0;
  min-width: 100%;

  caption {
    @include caption;
  }

  thead,
  tbody {

    th,
    td {
      @include padding(1.5rem);

      *:last-child {
        @include margin(null null 0 null);
      }
    }

    th {
      color: $su-color-black;
      font-weight: $su-font-semi-bold;
      text-align: left;
    }

    tr {
      border-top: 1px solid $su-color-black-20;

      &:first-of-type {
        border-top: 0;
      }
    }
  }

  thead + tbody {
    border-top: 1px solid $su-color-black-20;
  }

}