Dmitrii Filippov | daf0ec9 | 2020-03-17 11:27:28 +0100 | [diff] [blame] | 1 | /** |
| 2 | * @license |
Ben Rohlfs | 94fcbbc | 2022-05-27 10:45:03 +0200 | [diff] [blame] | 3 | * Copyright 2017 Google LLC |
| 4 | * SPDX-License-Identifier: Apache-2.0 |
Dmitrii Filippov | daf0ec9 | 2020-03-17 11:27:28 +0100 | [diff] [blame] | 5 | */ |
Dmitrii Filippov | 4457ae1 | 2020-07-14 15:22:35 +0200 | [diff] [blame] | 6 | |
| 7 | // Mark the file as a module. Otherwise typescript assumes this is a script |
| 8 | // and $_documentContainer is a global variable. |
| 9 | // See: https://www.typescriptlang.org/docs/handbook/modules.html |
Milutin Kristofic | 21b0758 | 2022-04-20 08:33:57 +0200 | [diff] [blame] | 10 | import {css} from 'lit'; |
| 11 | |
| 12 | export const changeMetadataStyles = css` |
| 13 | section { |
| 14 | display: table-row; |
| 15 | } |
| 16 | |
| 17 | section:not(:first-of-type) .title, |
| 18 | section:not(:first-of-type) .value { |
| 19 | padding-top: var(--spacing-s); |
| 20 | } |
| 21 | |
| 22 | .title, |
| 23 | .value { |
| 24 | display: table-cell; |
| 25 | vertical-align: top; |
| 26 | } |
| 27 | |
| 28 | .title { |
| 29 | color: var(--deemphasized-text-color); |
| 30 | max-width: 20em; |
| 31 | padding-left: var(--metadata-horizontal-padding); |
| 32 | padding-right: var(--metadata-horizontal-padding); |
| 33 | word-break: break-word; |
| 34 | } |
| 35 | `; |
Dmitrii Filippov | 4457ae1 | 2020-07-14 15:22:35 +0200 | [diff] [blame] | 36 | |
Dmitrii Filippov | daf0ec9 | 2020-03-17 11:27:28 +0100 | [diff] [blame] | 37 | const $_documentContainer = document.createElement('template'); |
Dmitrii Filippov | daf0ec9 | 2020-03-17 11:27:28 +0100 | [diff] [blame] | 38 | $_documentContainer.innerHTML = `<dom-module id="gr-change-metadata-shared-styles"> |
Tao Zhou | 55e440b4 | 2019-08-19 09:51:56 +0200 | [diff] [blame] | 39 | <template> |
| 40 | <style> |
Milutin Kristofic | 21b0758 | 2022-04-20 08:33:57 +0200 | [diff] [blame] | 41 | ${changeMetadataStyles.cssText} |
Tao Zhou | 55e440b4 | 2019-08-19 09:51:56 +0200 | [diff] [blame] | 42 | </style> |
| 43 | </template> |
Dmitrii Filippov | daf0ec9 | 2020-03-17 11:27:28 +0100 | [diff] [blame] | 44 | </dom-module>`; |
Dmitrii Filippov | daf0ec9 | 2020-03-17 11:27:28 +0100 | [diff] [blame] | 45 | document.head.appendChild($_documentContainer.content); |