Project

General

Profile

« Previous | Next » 

Revision 2ed89b85

Added by Andreas Kohlbecker about 3 years ago

ref #7599 derivate tree with collapsible items

View differences:

themes/zen_dataportal/sass/cdm.scss
229 229
    }
230 230
  }
231 231

  
232
  /*
233
   * derivatives tree view (see also derivation-tree.js)
234
   * partially based on ideas found in https://jsfiddle.net/xuonpjmh/21/
235
   */
236
  $tree-entry-vspace: 7px; //$base-font-size / 2 ???
237
  $tree-line-width: 3px;
238
  $tree-line-style: $tree-line-width dotted $menu-bar-background-color;
239
  $tree-hline-length: 1em; // 5px;
240
  $tree-lines-top-offset: ($base-line-height / 7) ;
241
  $tree-lines-left-offset: $base-line-height / 7;
242
  $derived-unit-details-table-gutter: $base-line-height / 2;
243
  div.derived-unit-tree,
244
  ul.derived-unit-sub-tree,
245
  ul.derived-unit-sub-tree ul {
232
/*
233
 * derivatives tree view (see also derivation-tree.js)
234
 */
235
$tree-entry-vspace: $base-font-size / 2;
236
$tree-entry-header-height: $base-line-height;
237
$tree-line-width: $tree-entry-vspace / 2;
238
$tree-hline-length: $base-font-size * 2; // 1em; // 5px;
239
$tree-line-style: $tree-line-width dotted $menu-bar-background-color;
240
$tree-hline-to-item-gap: $tree-hline-length / 2;
241
$tree-lines-top-offset: $base-line-height / 7;
242
$tree-lines-left-offset: $base-line-height / 7;
243
$collapse-symbol-width: $base-line-height;
244

  
245
.item-tree {
246
  ul {
246 247
    list-style: none;
247
    margin: 0 0 0 $tree-lines-left-offset;
248
    padding: 0;
249

  
250
   .unit-header {
251
     padding-top: $tree-entry-vspace;
252
     .unit-label {
253
       background-color: $menu-bar-background-color;
254
       padding-left: 5px;
255
       .page-link {
256
         float: right;
257
       }
258
     }
259
      .unit-label-hover-effect:hover {
260
        cursor: pointer;
261
        background-color: lighten($menu-bar-background-color, 10%)
262
      }
263
    }
264
    .unit-content {
265
      padding: $derived-unit-details-table-gutter;
266
      background-color: lighten($menu-bar-background-color, 5%);
267
    }
268
    .derivation-event {
269
      font-size: smaller;
270
      margin-top: -$derived-unit-details-table-gutter;
271
      color: $link-color-synonym;
272
    }
273
    .focused_item {
274
      font-weight: bold;
275
    }
276
  }
277
  div.derived-unit-tree-root {
278
    .unit-content-wrapper {
279
      border-left: $tree-line-style;
280
      margin-left: $tree-lines-left-offset;
281
    }
282
  }
283
  ul.derived-unit-sub-tree{
284
    ul {
285
      margin-left: 1.0em;
248
    margin: 0;
249
    padding-left: 0; //$tree-hline-length;
250

  
251
    &.collapsed {
252
      display: none;
286 253
    }
287 254
    li {
255
      padding: $tree-entry-vspace 0px 0px $tree-hline-length;
256
      margin-top: $tree-line-width; // add little extra space for perfect border connections
288 257
      position: relative;
289 258

  
290
      margin-left: 0;
291
      padding-left: 1em;
292
      margin-top: -$tree-lines-top-offset;
293
      line-height: $base-line-height;
259
      &::before { // vertical & horizontal lines
260
        content: "";
261
        position: absolute;
262
        top: $tree-entry-vspace + ($tree-entry-header-height / 2);
263
        left: -$tree-hline-to-item-gap;
264
        border-left: $tree-line-style;
265
        border-bottom: $tree-line-style;
266
        width: $tree-hline-length;
267
        height: 100%;
268
      }
294 269

  
295
      border-left: $tree-line-style;
296
    }
297
    li:last-child {
298
      border-left: none;
299
      .unit-header, .unit-content {
300
        margin-left: $tree-line-width;
270
      &:last-child:before {
271
        content: none;
301 272
      }
302
    }
303
    li:before {
304
      position: absolute;
305
      top: $tree-lines-top-offset;
306
      left: 0;
307 273

  
308
      width: $tree-hline-length; /* width of horizontal line */
309
      height: $base-line-height / 2 + $tree-line-width / 2; /* vertical position of line */
310
      vertical-align: top;
311
      border-bottom: $tree-line-style;
312
      content: "";
313
      display: inline-block;
314
    }
315
    li:last-child:before {
316
      border-left: $tree-line-style;
317
    }
318
  }
319
  div.derived-unit-tree {
320
    table.details-table {
321
      font-size: smaller;
274
      .item-wrapper-with-sub-items {
275
        position: relative;
276
        &::after {
277
          content: "";
278
          position: absolute;
279
          top: $tree-entry-vspace + ($tree-entry-header-height / 2);
280
          left: -$tree-hline-to-item-gap;
281
          border-left: $tree-line-style;
282
          border-bottom: $tree-line-style;
283
          // debug
284
          //border-left: 2px dashed cyan;
285
          //border-bottom: 2px dashed cyan;
286
          width: $tree-hline-length;
287
          height: 100%;
288
        }
289
      }
290
      &.collapsed .item-wrapper-with-sub-items::after {
291
        content: none; // negates the style set with .item-wrapper-with-sub-items:after in case the sub-items are collapsed
292
      }
322 293
    }
323 294
  }
324
  .derived-unit-details-grid {
325
    table.details-table {
326
      margin: 0;
327
      width: 100%;
328
      vertical-align: top;
329
      background-color: $page-background-color;
330
      thead {
331
        border-bottom: thin solid $menu-bar-background-color;
295
  // First Level Elements
296
  & > .item-list > ul {
297
    margin-left: -$tree-hline-to-item-gap; // re-align whole tree with parent block element
298
    & > li {
299
      &:last-child:before {
300
        content: unset;
332 301
      }
333
      tbody {
334
        background-color: $page-background-color;
335
        .label {
336
          text-align: right;
337
          white-space: nowrap;
338
          border-right: thin solid $menu-bar-background-color;
339
          width: 50%;
302
      &::before {
303
        content: unset;
304
      }
305
      &:not(:last-child) > ul > li {
306
        &:before {
307
          content: unset;
340 308
        }
341 309
      }
342
      td, th {
343
        padding-right: $derived-unit-details-table-gutter;
344
        padding-left: $derived-unit-details-table-gutter;
310
    }
311
  }
312
  // debug
313
  //li:first-child::before {
314
  //  border-color: #1bdf00;
315
  //}
316
  .tree-node-symbol {
317
    display: inline-block;
318
    width: $collapse-symbol-width;
319
    height: $collapse-symbol-width;
320
    color: $menu-bar-background-color;
321
    background-color: $page-background-color;
322
    margin-left: -($collapse-symbol-width / 2) - $tree-hline-to-item-gap + ($tree-line-width / 2);
323
    text-align: center;
324
    font-size: larger;
325
    //.open {
326
    //  display: none;
327
    //}
328
  }
329
  .tree-node-symbol-collapsible:hover {
330
    color: $menu-bar-text-color;
331
  }
332
}
333

  
334
// -- tree independent styling
335
$derived-unit-details-table-gutter: $base-line-height / 2;
336

  
337
.item-tree {
338
  .unit-header-wrapper {
339
    .unit-label {
340
      background-color: $menu-bar-background-color;
341
      .symbol {
342
        padding-left: 5px;
343
      }
344
      .page-link {
345
        float: right;
346
        padding-right: $derived-unit-details-table-gutter / 2;
345 347
      }
346 348
    }
349
    .unit-label-hover-effect:hover {
350
      cursor: pointer;
351
      background-color: lighten($menu-bar-background-color, 10%)
352
    }
353
  }
354
  .unit-content {
355
    padding: $derived-unit-details-table-gutter;
356
    background-color: lighten($menu-bar-background-color, 5%);
357
  }
358
  .derivation-event {
359
    font-size: smaller;
360
    margin-top: -$derived-unit-details-table-gutter;
361
    color: $link-color-synonym;
362
  }
363
  .focused_item {
364
    font-weight: bold;
347 365
  }
348
  .derived-unit-details-grid {
349
    display: grid;
350
    grid-column-gap: $derived-unit-details-table-gutter;
351
    grid-row-gap: $derived-unit-details-table-gutter;
352
    @media all and (max-width: 659px) {
353
      grid-template-columns : repeat(1, 1fr);
366
}
367

  
368
// --- details grid
369
.derived-unit-details-grid {
370
  table.details-table {
371
    margin: 0;
372
    width: 100%;
373
    vertical-align: top;
374
    background-color: $page-background-color;
375
    thead {
376
      border-bottom: thin solid $menu-bar-background-color;
354 377
    }
355
    @media all and (min-width: 660px) {
356
      grid-template-columns: repeat(2, 1fr);
378
    tbody {
379
      background-color: $page-background-color;
380
      .label {
381
        text-align: right;
382
        white-space: nowrap;
383
        border-right: thin solid $menu-bar-background-color;
384
        width: 50%;
385
      }
357 386
    }
358
    dl {
359
      margin: 0;
387
    td, th {
388
      padding-right: $derived-unit-details-table-gutter;
389
      padding-left: $derived-unit-details-table-gutter;
360 390
    }
361 391
  }
392
}
393
.derived-unit-details-grid {
394
  display: grid;
395
  grid-column-gap: $derived-unit-details-table-gutter;
396
  grid-row-gap: $derived-unit-details-table-gutter;
397
  @media all and (max-width: 659px) {
398
    grid-template-columns : repeat(1, 1fr);
399
  }
400
  @media all and (min-width: 660px) {
401
    grid-template-columns: repeat(2, 1fr);
402
  }
403
  dl {
404
    margin: 0;
405
  }
406
}
362 407

  
363 408

  
364 409
  /*

Also available in: Unified diff