github.com/outbrain/consul@v1.4.5/ui-v2/app/styles/components/tabular-collection.scss (about)

     1  @import './dom-recycling-table/index';
     2  table.dom-recycling {
     3    @extend %dom-recycling-table;
     4  }
     5  /* project specific */
     6  %dom-recycling-table {
     7    /* minimum of 4x50px heigh rows plus top/bottom margins*/
     8    min-height: 249px;
     9  }
    10  %dom-recycling-table tbody {
    11    /* tbodys are all absolute so,*/
    12    /* make room for the header */
    13    top: 29px !important;
    14    /* Make room for the header, plus 20px for a margin on the bottom */
    15    width: 100%;
    16  }
    17  %dom-recycling-table caption ~ tbody {
    18    /* tbodys are all absolute so,*/
    19    /* make room for the header */
    20    top: 57px !important;
    21    /* Make room for the header, plus 20px for a margin on the bottom */
    22  }
    23  
    24  /* TODO: putting this here is less than ideal */
    25  /* but this is another area where I am specifically */
    26  /* targetting table-like things. This is now a prime */
    27  /* area for a bit of refactoring/reorganizing */
    28  
    29  /* Every type of 'row' is given a placeholder which */
    30  /* can apply to all th's and td's in the table */
    31  /* (the placeholders refer to a tf so `> *` will get you */
    32  /* both th and td).
    33  /* Next, all the below calculations let you fix a width of */
    34  /* any number of cells, then size the remaining cells */
    35  /* using: */
    36  /* calc(<100% divided by number of non-fixed width cells> - <sum of widths of fixed cells divided by number of non-fixed width cells>) */
    37  
    38  html.template-service.template-list td:first-child a span,
    39  html.template-node.template-show #services td:first-child a span {
    40    @extend %with-external-source-icon;
    41    float: left;
    42    margin-right: 10px;
    43    margin-top: 2px;
    44  }
    45  /*TODO: trs only live in tables, get rid of table */
    46  html.template-service.template-list main table tr {
    47    @extend %services-row;
    48  }
    49  html.template-intention.template-list main table tr {
    50    @extend %intentions-row;
    51  }
    52  html.template-kv.template-list main table tr {
    53    @extend %kvs-row;
    54  }
    55  html.template-acl.template-list main table tr {
    56    @extend %acls-row;
    57  }
    58  html.template-policy.template-list main table tr {
    59    @extend %policies-row;
    60  }
    61  html.template-token.template-list main table tr {
    62    @extend %tokens-row;
    63  }
    64  html.template-policy.template-edit [role='dialog'] table tr,
    65  html.template-policy.template-edit main table tr {
    66    @extend %tokens-minimal-row;
    67  }
    68  html.template-token.template-list main table tr td.me,
    69  html.template-token.template-list main table tr td.me ~ td,
    70  html.template-token.template-list main table tr th {
    71    @extend %tokens-your-row;
    72  }
    73  html.template-node.template-show main table tr {
    74    @extend %node-services-row;
    75  }
    76  html.template-node.template-show main table.sessions tr {
    77    @extend %node-sessions-row;
    78  }
    79  @media #{$--horizontal-session-list} {
    80    %node-sessions-row > * {
    81      // (100% / 7) - (300px / 6) - (120px / 6)
    82      width: calc(14.2857% - 50px - 20px);
    83    }
    84    %node-sessions-row > *:nth-child(2) {
    85      width: 300px;
    86    }
    87    %node-sessions-row > *:nth-last-child(1) {
    88      width: 120px;
    89    }
    90  }
    91  @media #{$--lt-horizontal-session-list} {
    92    %node-sessions-row > * {
    93      // (100% / 2) - (300px / 2) - (120px / 2)
    94      width: calc(50% - 150px - 60px);
    95    }
    96    %node-sessions-row > *:nth-child(2) {
    97      width: 300px;
    98    }
    99    %node-sessions-row > *:nth-last-child(1) {
   100      width: 120px;
   101    }
   102    %node-sessions-row > *:nth-child(3),
   103    %node-sessions-row > *:nth-child(4),
   104    %node-sessions-row > *:nth-child(5),
   105    %node-sessions-row > *:nth-child(6) {
   106      display: none;
   107    }
   108  }
   109  %intentions-row > * {
   110    width: calc(25% - 15px);
   111  }
   112  %intentions-row > *:last-child {
   113    @extend %table-actions;
   114  }
   115  %acls-row > * {
   116    width: calc(50% - 30px);
   117  }
   118  %acls-row > *:last-child {
   119    @extend %table-actions;
   120  }
   121  %tokens-row > *:first-child,
   122  %tokens-minimal-row > *:not(last-child),
   123  %tokens-row > *:nth-child(2),
   124  %tokens-your-row:nth-last-child(2) {
   125    width: 120px;
   126  }
   127  %tokens-row > *:nth-child(3),
   128  %tokens-row > *:nth-child(4) {
   129    width: calc(50% - 150px);
   130  }
   131  %tokens-your-row:nth-child(4) {
   132    width: calc(50% - 270px) !important;
   133  }
   134  %tokens-row > *:last-child {
   135    @extend %table-actions;
   136  }
   137  %tokens-minimal-row > *:last-child {
   138    width: calc(100% - 240px);
   139  }
   140  @media #{$--lt-medium-table} {
   141    /* Token > Policies */
   142    /* Token > Your Token */
   143    html.template-token.template-list tr > :nth-child(2),
   144    html.template-token.template-list tr > :nth-child(4),
   145    html.template-token.template-list tr th:nth-child(5),
   146    html.template-token.template-list main table tr td.me ~ td:nth-of-type(5) {
   147      display: none;
   148    }
   149  }
   150  
   151  %kvs-row > *:first-child {
   152    width: calc(100% - 60px);
   153  }
   154  %kvs-row > *:last-child {
   155    @extend %table-actions;
   156  }
   157  %node-services-row > * {
   158    width: 33%;
   159  }
   160  %policies-row > * {
   161    width: calc(33% - 20px);
   162  }
   163  %policies-row > *:last-child {
   164    @extend %table-actions;
   165  }
   166  // this will get auto calculated later in tabular-collection.js
   167  // keeping this here for reference
   168  // %services-row > * {
   169  // (100% / 2) - (160px / 2)
   170  // width: calc(50% - 160px);
   171  // }
   172  %services-row > * {
   173    width: auto;
   174  }