diff --git a/scss/atat.scss b/scss/atat.scss index d95957ea..8f73326c 100644 --- a/scss/atat.scss +++ b/scss/atat.scss @@ -7,8 +7,9 @@ @import 'elements/typography'; @import 'elements/inputs'; @import 'elements/buttons'; -@import 'elements/tables'; @import 'elements/panels'; +@import 'elements/block_lists'; +@import 'elements/tables'; @import 'components/site_action'; @import 'components/empty_state'; diff --git a/scss/elements/_block_lists.scss b/scss/elements/_block_lists.scss new file mode 100644 index 00000000..dc5062af --- /dev/null +++ b/scss/elements/_block_lists.scss @@ -0,0 +1,51 @@ +@mixin block-list { + @include panel-margin; + + > ul { + list-style: none; + margin: 0; + padding: 0; + } +} + +@mixin block-list-header { + @include panel-base; + @include panel-theme-default; + padding: $gap * 2; +} + +@mixin block-list__title { + @include h4; + margin: 0; +} + +@mixin block-list-item { + @include panel-base; + margin: 0; + padding: $gap * 2; + border-top: 0; + border-bottom: 1px dashed $color-gray-light; + + @at-root li#{&} { + &:last-child { + border-bottom-style: solid; + } + } +} + + +.block-list { + @include block-list; +} + +.block-list__header { + @include block-list-header; +} + +.block-list__title { + @include block-list__title; +} + +.block-list__item { + @include block-list-item; +} diff --git a/scss/elements/_panels.scss b/scss/elements/_panels.scss index ce50b515..a2f047ef 100644 --- a/scss/elements/_panels.scss +++ b/scss/elements/_panels.scss @@ -9,6 +9,8 @@ border-bottom-width: 1px; border-top-style: solid; border-bottom-style: solid; + border-left: 0; + border-right: 0; } @mixin panel-theme-default { @@ -17,6 +19,9 @@ } @mixin panel-margin { + margin-top: 0; + margin-left: 0; + margin-right: 0; margin-bottom: $site-margins-mobile * 2; @include media($medium-screen) { @@ -29,9 +34,14 @@ @include panel-theme-default; @include panel-margin; - &__content { - padding-left: $gap*4; - padding-right: $gap*4; + .panel__content { + margin: ($gap * 2) 0; + padding: 0 ($gap * 2); + + @include media($medium-screen) { + margin: ($gap * 4) 0; + padding: 0 ($gap * 4); + } } } diff --git a/scss/elements/_tables.scss b/scss/elements/_tables.scss index 243aefea..678770d6 100644 --- a/scss/elements/_tables.scss +++ b/scss/elements/_tables.scss @@ -3,3 +3,41 @@ * @see https://designsystem.digital.gov/components/tables/ * @source https://github.com/uswds/uswds/blob/develop/src/stylesheets/elements/_table.scss */ + +table { + @include panel-margin; + min-width: 100%; + + tr { + th, + td { + white-space: nowrap; + } + + th { + @include block-list-header; + } + + td { + @include block-list-item; + } + + &:last-child { + td { + border-bottom-style: solid; + } + } + + .table-cell--align-right { + text-align: right; + } + + .table-cell--shrink { + width: 1%; + } + + .table-cell--expand { + width: 100%; + } + } +} diff --git a/templates/styleguide.html.to b/templates/styleguide.html.to index f5be0acb..4439a21d 100644 --- a/templates/styleguide.html.to +++ b/templates/styleguide.html.to @@ -24,7 +24,7 @@ {% end %} {% block content %} -
This is a panel
Expanded Column | +Normal Column | +Right Aligned | +Shrunk | +
---|---|---|---|
Table Cell | +Table Cell | +1,234.56 | +Table Cell | +
Table Cell | +Table Cell | +1,231,253.43 | +Table Cell | +
Table Cell | +Table Cell | +564.54 | +Table Cell | +