From 171898c75362bfe13c3f10b76877c5ec1ee01a1c Mon Sep 17 00:00:00 2001 From: dandds Date: Fri, 12 Apr 2019 09:58:47 -0400 Subject: [PATCH 01/10] WIP: use lists for application environment table --- styles/components/_accordion_table.scss | 115 ++++++++++-------- styles/elements/_tables.scss | 2 +- templates/components/toggle_list.html | 27 ++++ .../fragments/applications/environments.html | 21 ++++ 4 files changed, 113 insertions(+), 52 deletions(-) create mode 100644 templates/components/toggle_list.html diff --git a/styles/components/_accordion_table.scss b/styles/components/_accordion_table.scss index 53153470..33cf2111 100644 --- a/styles/components/_accordion_table.scss +++ b/styles/components/_accordion_table.scss @@ -1,65 +1,78 @@ .accordion-table { - table { - thead th { - text-transform: uppercase; - border-bottom: 1px solid $color-gray-lightest; - border-top: none; + &.accordion-table-list { + display: table; + width: 100%; + } + + .accordion-table__head { + padding: 0.8rem 1.6rem; + font-weight: 700; + color: $color-gray; + text-transform: uppercase; + background-color: $color-gray-lightest; + border-bottom: 1px solid $color-gray-lightest; + border-top: none; + } + + thead th { + text-transform: uppercase; + border-bottom: 1px solid $color-gray-lightest; + border-top: none; + } + + th, td { + white-space: nowrap; + + button { + margin: 0; } + } - th, td { - white-space: nowrap; + .accordion-table__items { + .accordion-table__item__toggler { + @include icon-link-color($color-blue, $color-gray-lightest); + float: right; + margin-left: -$gap; + color: $color-blue; - button { - margin: 0; + .icon { + @include icon-size(12); + margin-right: $gap; + } + + .open-indicator { + position: absolute; + bottom: 0; + left: 5 * $gap; + width: 0; + height: 0; + border-left: 10px solid transparent; + border-right: 10px solid transparent; + + border-bottom: 10px solid $color-blue-light; } } - .accordion-table__items { - .accordion-table__item__toggler { - @include icon-link-color($color-blue, $color-gray-lightest); - float: right; - margin-left: -$gap; - color: $color-blue; + th, td, tr { + border-bottom: 1px dashed $color-gray-lightest; + } - .icon { - @include icon-size(12); - margin-right: $gap; + th[scope=rowgroup] { + position: relative; + } + + .accordion-table__item__expanded { + margin-left: 2 * $gap; + + th, td { + .icon-link { + font-weight: $font-normal; + font-size: $base-font-size; } - .open-indicator { - position: absolute; - bottom: 0; - left: 5 * $gap; - width: 0; - height: 0; - border-left: 10px solid transparent; - border-right: 10px solid transparent; - - border-bottom: 10px solid $color-blue-light; - } - } - - th, td, tr { - border-bottom: 1px dashed $color-gray-lightest; - } - - th[scope=rowgroup] { - position: relative; - } - - .accordion-table__item__expanded { - margin-left: 2 * $gap; - - th, td { - .icon-link { - font-weight: $font-normal; - font-size: $base-font-size; - } - - border-bottom: 1px dashed $color-white; - background-color: $color-gray-lightest; - } + border-bottom: 1px dashed $color-white; + background-color: $color-gray-lightest; } } } diff --git a/styles/elements/_tables.scss b/styles/elements/_tables.scss index 7b8da846..61bb1f9d 100644 --- a/styles/elements/_tables.scss +++ b/styles/elements/_tables.scss @@ -4,7 +4,7 @@ * @source https://github.com/uswds/uswds/blob/develop/src/stylesheets/elements/_table.scss */ - table { +table { @include panel-margin; min-width: 100%; diff --git a/templates/components/toggle_list.html b/templates/components/toggle_list.html new file mode 100644 index 00000000..9f1d71a2 --- /dev/null +++ b/templates/components/toggle_list.html @@ -0,0 +1,27 @@ +{% from "components/icon.html" import Icon %} + +{% macro ToggleList(item_name, item_type, length) %} +
  • + +
  • +{% endmacro %} diff --git a/templates/fragments/applications/environments.html b/templates/fragments/applications/environments.html index 6300cd51..1ecf6a3f 100644 --- a/templates/fragments/applications/environments.html +++ b/templates/fragments/applications/environments.html @@ -1,4 +1,5 @@ {% from "components/icon.html" import Icon %} +{% from "components/toggle_list.html" import ToggleList %}
    @@ -13,6 +14,25 @@
    +
    +
    + {{ "portfolios.applications.environments.name" | translate }} + {{ "portfolios.applications.environments.members" | translate }} +
    + + +
    + + From 8efd54f14600a573f2cdb609435308e7076b043c Mon Sep 17 00:00:00 2001 From: George Drummond Date: Fri, 12 Apr 2019 10:12:55 -0400 Subject: [PATCH 02/10] Padding for accordion --- styles/components/_accordion_table.scss | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/styles/components/_accordion_table.scss b/styles/components/_accordion_table.scss index 33cf2111..1933032c 100644 --- a/styles/components/_accordion_table.scss +++ b/styles/components/_accordion_table.scss @@ -1,3 +1,5 @@ +$accordion-padding: 0.8rem 1.6rem; + .accordion-table { &.accordion-table-list { @@ -6,7 +8,7 @@ } .accordion-table__head { - padding: 0.8rem 1.6rem; + padding: $accordion-padding; font-weight: 700; color: $color-gray; text-transform: uppercase; @@ -30,6 +32,10 @@ } .accordion-table__items { + li { + padding: $accordion-padding; + } + .accordion-table__item__toggler { @include icon-link-color($color-blue, $color-gray-lightest); float: right; From 0efd0b8f8f98e6a481af9f3077f73e6b4c2f2a23 Mon Sep 17 00:00:00 2001 From: George Drummond Date: Fri, 12 Apr 2019 10:18:05 -0400 Subject: [PATCH 03/10] float-right members column title --- styles/components/_accordion_table.scss | 4 ++++ templates/fragments/applications/environments.html | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/styles/components/_accordion_table.scss b/styles/components/_accordion_table.scss index 1933032c..03263995 100644 --- a/styles/components/_accordion_table.scss +++ b/styles/components/_accordion_table.scss @@ -1,5 +1,9 @@ $accordion-padding: 0.8rem 1.6rem; +.float-right { + float: right; +} + .accordion-table { &.accordion-table-list { diff --git a/templates/fragments/applications/environments.html b/templates/fragments/applications/environments.html index 1ecf6a3f..65e44920 100644 --- a/templates/fragments/applications/environments.html +++ b/templates/fragments/applications/environments.html @@ -17,7 +17,7 @@
    {{ "portfolios.applications.environments.name" | translate }} - {{ "portfolios.applications.environments.members" | translate }} + {{ "portfolios.applications.environments.members" | translate }}
      From b1dd769e1be0156d54c35f6b92eae91236b8df04 Mon Sep 17 00:00:00 2001 From: George Drummond Date: Fri, 12 Apr 2019 10:42:23 -0400 Subject: [PATCH 04/10] Use $gap --- styles/components/_accordion_table.scss | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/styles/components/_accordion_table.scss b/styles/components/_accordion_table.scss index 03263995..cbbb60d9 100644 --- a/styles/components/_accordion_table.scss +++ b/styles/components/_accordion_table.scss @@ -1,5 +1,3 @@ -$accordion-padding: 0.8rem 1.6rem; - .float-right { float: right; } @@ -12,7 +10,7 @@ $accordion-padding: 0.8rem 1.6rem; } .accordion-table__head { - padding: $accordion-padding; + padding: $gap $gap*2; font-weight: 700; color: $color-gray; text-transform: uppercase; @@ -36,8 +34,13 @@ $accordion-padding: 0.8rem 1.6rem; } .accordion-table__items { + margin: 0; + li { - padding: $accordion-padding; + padding: $gap*2; + + border-bottom: 1px dashed $color-gray-lightest; + margin: 0; } .accordion-table__item__toggler { From 3ab84ba6f45da96a91c36f286def1630bde1e739 Mon Sep 17 00:00:00 2001 From: dandds Date: Fri, 12 Apr 2019 13:05:44 -0400 Subject: [PATCH 05/10] improvements to nested list --- styles/components/_accordion_table.scss | 26 ++++++++-- templates/components/toggle_list.html | 38 ++++++++------- .../fragments/applications/environments.html | 48 +++---------------- 3 files changed, 48 insertions(+), 64 deletions(-) diff --git a/styles/components/_accordion_table.scss b/styles/components/_accordion_table.scss index cbbb60d9..bdd0140f 100644 --- a/styles/components/_accordion_table.scss +++ b/styles/components/_accordion_table.scss @@ -33,21 +33,39 @@ } } + .accordion-table__item-content { + padding-top: $gap*3; + padding-right: $gap; + padding-bottom: $gap*3; + padding-left: $gap*3; + } + .accordion-table__items { margin: 0; li { - padding: $gap*2; - border-bottom: 1px dashed $color-gray-lightest; + list-style-type: none; + + border-bottom: 1px solid $color-gray-lightest; margin: 0; + + ul { + margin-top: 0; + margin-bottom: 0; + background-color: $color-gray-lightest; + + li { + border-bottom: 1px solid $color-gray-lighter; + } + } } .accordion-table__item__toggler { @include icon-link-color($color-blue, $color-gray-lightest); float: right; - margin-left: -$gap; color: $color-blue; + padding: 0; .icon { @include icon-size(12); @@ -76,8 +94,6 @@ } .accordion-table__item__expanded { - margin-left: 2 * $gap; - th, td { .icon-link { font-weight: $font-normal; diff --git a/templates/components/toggle_list.html b/templates/components/toggle_list.html index 9f1d71a2..c324ec9d 100644 --- a/templates/components/toggle_list.html +++ b/templates/components/toggle_list.html @@ -1,24 +1,26 @@ {% from "components/icon.html" import Icon %} -{% macro ToggleList(item_name, item_type, length) %} -
    • -