Dmitrii Filippov | daf0ec9 | 2020-03-17 11:27:28 +0100 | [diff] [blame] | 1 | /** |
| 2 | * @license |
| 3 | * Copyright (C) 2017 The Android Open Source Project |
| 4 | * |
| 5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | * you may not use this file except in compliance with the License. |
| 7 | * You may obtain a copy of the License at |
| 8 | * |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | * |
| 11 | * Unless required by applicable law or agreed to in writing, software |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | * See the License for the specific language governing permissions and |
| 15 | * limitations under the License. |
| 16 | */ |
Ben Rohlfs | e2b2f59 | 2021-09-07 08:47:53 +0000 | [diff] [blame] | 17 | import {css} from 'lit'; |
Paladox none | fd3dde4 | 2021-08-14 07:28:48 +0000 | [diff] [blame] | 18 | |
Paladox none | fd3dde4 | 2021-08-14 07:28:48 +0000 | [diff] [blame] | 19 | export const tableStyles = css` |
| 20 | .genericList { |
| 21 | background-color: var(--background-color-primary); |
| 22 | border-collapse: collapse; |
| 23 | width: 100%; |
| 24 | } |
| 25 | .genericList th, |
| 26 | .genericList td { |
| 27 | padding: var(--spacing-m) 0; |
| 28 | vertical-align: middle; |
| 29 | } |
| 30 | .genericList tr { |
| 31 | border-bottom: 1px solid var(--border-color); |
| 32 | } |
| 33 | .genericList tr:hover { |
| 34 | background-color: var(--hover-background-color); |
| 35 | } |
| 36 | .genericList th { |
| 37 | white-space: nowrap; |
| 38 | } |
| 39 | .genericList th, |
| 40 | .genericList td { |
| 41 | padding-right: var(--spacing-l); |
| 42 | } |
| 43 | .genericList tr th:first-of-type, |
| 44 | .genericList tr td:first-of-type { |
| 45 | padding-left: var(--spacing-l); |
| 46 | } |
| 47 | .genericList tr:first-of-type { |
| 48 | border-top: 1px solid var(--border-color); |
| 49 | } |
| 50 | .genericList tr th:last-of-type, |
| 51 | .genericList tr td:last-of-type { |
| 52 | border-left: 1px solid var(--border-color); |
| 53 | text-align: center; |
| 54 | padding-left: var(--spacing-l); |
| 55 | } |
| 56 | .genericList tr th.delete, |
| 57 | .genericList tr td.delete { |
| 58 | padding-top: 0; |
| 59 | padding-bottom: 0; |
| 60 | } |
| 61 | .genericList tr th.delete, |
| 62 | .genericList tr td.delete, |
| 63 | .genericList tr.loadingMsg td, |
| 64 | .genericList tr.groupHeader td { |
| 65 | border-left: none; |
| 66 | } |
| 67 | .genericList .loading { |
| 68 | border: none; |
| 69 | display: none; |
| 70 | } |
| 71 | .genericList td { |
| 72 | flex-shrink: 0; |
| 73 | } |
| 74 | .genericList .topHeader, |
| 75 | .genericList .groupHeader { |
| 76 | color: var(--primary-text-color); |
| 77 | font-weight: var(--font-weight-bold); |
| 78 | text-align: left; |
| 79 | vertical-align: middle; |
| 80 | } |
| 81 | .genericList .groupHeader { |
| 82 | background-color: var(--background-color-secondary); |
| 83 | font-family: var(--header-font-family); |
| 84 | font-size: var(--font-size-h3); |
| 85 | font-weight: var(--font-weight-h3); |
| 86 | line-height: var(--line-height-h3); |
| 87 | } |
| 88 | .genericList a { |
| 89 | color: var(--primary-text-color); |
| 90 | text-decoration: none; |
| 91 | } |
| 92 | .genericList a:hover { |
| 93 | text-decoration: underline; |
| 94 | } |
| 95 | .genericList .description { |
Chris Poucet | 603930c | 2022-08-08 16:12:35 +0200 | [diff] [blame] | 96 | width: var(--generic-list-description-width, 99%); |
Paladox none | fd3dde4 | 2021-08-14 07:28:48 +0000 | [diff] [blame] | 97 | } |
| 98 | .genericList .loadingMsg { |
| 99 | color: var(--deemphasized-text-color); |
| 100 | display: block; |
| 101 | padding: var(--spacing-s) var(--spacing-l); |
| 102 | } |
| 103 | .genericList .loadingMsg:not(.loading) { |
| 104 | display: none; |
| 105 | } |
| 106 | `; |
| 107 | |
Ben Rohlfs | bbb1673 | 2021-08-20 13:09:26 +0200 | [diff] [blame] | 108 | const $_documentContainer = document.createElement('template'); |
| 109 | $_documentContainer.innerHTML = ` |
| 110 | <dom-module id="gr-table-styles"> |
| 111 | <template> |
| 112 | <style> |
| 113 | ${tableStyles.cssText} |
| 114 | </style> |
| 115 | </template> |
| 116 | </dom-module> |
| 117 | `; |
Dmitrii Filippov | daf0ec9 | 2020-03-17 11:27:28 +0100 | [diff] [blame] | 118 | document.head.appendChild($_documentContainer.content); |