Sha256: 251eda497e4dd4d25636bb382bf9a881c23940e3b51407029a26fe0b720c6454

Contents?: true

Size: 1.88 KB

Versions: 55

Compression:

Stored size: 1.88 KB

Contents

// Govspeak tables
// https://components.publishing.service.gov.uk/component-guide/govspeak/tables
//
// Support:
// - alphagov/whitehall: ✔︎
// - alphagov/govspeak: ✔︎

.govspeak, // Legacy class name that's still used in some content items - needs to be kept until `.govspeak` is removed from the content items.
.gem-c-govspeak {
  table {
    border-collapse: collapse;
    border-spacing: 0;
    display: block;
    margin: govuk-spacing(6) 0;
    overflow-x: auto;
    width: 100%;
    @include govuk-font($size: 19);

    caption {
      text-align: left;
      margin-bottom: .5em;
    }

    th,
    td {
      vertical-align: top;
      padding: govuk-spacing(2) govuk-spacing(4) govuk-spacing(2) 0;
      border-bottom: 1px solid govuk-colour("mid-grey", $legacy: "grey-2");

      &:last-child {
        padding: govuk-spacing(2) 0 govuk-spacing(2) 0;
      }
    }

    th {
      @include govuk-font($size: 19, $weight: bold);
      text-align: left;
      color: $govuk-text-colour;
    }

    td small {
      font-size: 1em;
    }

    .cell-text-left {
      text-align: left;
    }

    .cell-text-center {
      text-align: center;
    }

    .cell-text-right {
      text-align: right;
    }
  }
}

// Add rtl table styling when `direction: "rtl"` is set
.govuk-govspeak.direction-rtl,
.gem-c-govspeak.direction-rtl {
  table {
    caption {
      text-align: right;
    }

    th {
      text-align: right;
    }

    th,
    td {
      padding: govuk-spacing(2) 0 govuk-spacing(2) govuk-spacing(4);
    }
  }
}

// Add rtl table styling when `.direction-rtl` is set on a parent element
// stylelint-disable max-nesting-depth
.direction-rtl {
  .govspeak,
  .gem-c-govspeak {
    table {
      caption {
        text-align: right;
      }

      th {
        text-align: right;
      }

      th,
      td {
        padding: govuk-spacing(2) 0 govuk-spacing(2) govuk-spacing(4);
      }
    }
  }
}

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
govuk_publishing_components-38.0.1 app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss
govuk_publishing_components-38.0.0 app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss
govuk_publishing_components-37.10.0 app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss
govuk_publishing_components-37.9.1 app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss
govuk_publishing_components-37.9.0 app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss
govuk_publishing_components-37.8.1 app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss
govuk_publishing_components-37.8.0 app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss
govuk_publishing_components-37.7.1 app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss
govuk_publishing_components-37.7.0 app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss
govuk_publishing_components-37.6.1 app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss
govuk_publishing_components-37.6.0 app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss
govuk_publishing_components-37.5.1 app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss
govuk_publishing_components-37.5.0 app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss
govuk_publishing_components-37.4.0 app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss
govuk_publishing_components-37.3.1 app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss
govuk_publishing_components-37.3.0 app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss
govuk_publishing_components-37.2.4 app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss
govuk_publishing_components-37.2.3 app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss
govuk_publishing_components-37.2.2 app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss
govuk_publishing_components-37.2.1 app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss