Wyatt Allen | 7cc9e33 | 2018-08-25 00:42:20 +0000 | [diff] [blame] | 1 | <!-- |
| 2 | @license |
| 3 | Copyright (C) 2018 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 | --> |
| 17 | |
Ole Rehmsen | 3164074 | 2019-05-16 11:24:47 +0200 | [diff] [blame] | 18 | <link rel="import" href="/bower_components/polymer/polymer.html"> |
Wyatt Allen | 7cc9e33 | 2018-08-25 00:42:20 +0000 | [diff] [blame] | 19 | <link rel="import" href="../../../styles/shared-styles.html"> |
| 20 | <link rel="import" href="../../shared/gr-copy-clipboard/gr-copy-clipboard.html"> |
| 21 | |
| 22 | <dom-module id="gr-shell-command"> |
| 23 | <template> |
| 24 | <style include="shared-styles"> |
| 25 | .commandContainer { |
Ben Rohlfs | b3d95cf | 2019-10-20 19:26:48 +0200 | [diff] [blame] | 26 | margin-bottom: var(--spacing-m); |
Wyatt Allen | 7cc9e33 | 2018-08-25 00:42:20 +0000 | [diff] [blame] | 27 | } |
| 28 | .commandContainer { |
| 29 | background-color: var(--shell-command-background-color); |
Ben Rohlfs | b3d95cf | 2019-10-20 19:26:48 +0200 | [diff] [blame] | 30 | /* Should be spacing-m larger than the :before width. */ |
| 31 | padding: var(--spacing-m) var(--spacing-m) var(--spacing-m) calc(3*var(--spacing-m) + 0.5em); |
Wyatt Allen | 7cc9e33 | 2018-08-25 00:42:20 +0000 | [diff] [blame] | 32 | position: relative; |
| 33 | width: 100%; |
| 34 | } |
| 35 | .commandContainer:before { |
Wyatt Allen | 7cc9e33 | 2018-08-25 00:42:20 +0000 | [diff] [blame] | 36 | content: '$'; |
Wyatt Allen | 7cc9e33 | 2018-08-25 00:42:20 +0000 | [diff] [blame] | 37 | position: absolute; |
Ben Rohlfs | b3d95cf | 2019-10-20 19:26:48 +0200 | [diff] [blame] | 38 | display: block; |
| 39 | box-sizing: border-box; |
| 40 | background: var(--shell-command-decoration-background-color); |
Wyatt Allen | 7cc9e33 | 2018-08-25 00:42:20 +0000 | [diff] [blame] | 41 | top: 0; |
Ben Rohlfs | b3d95cf | 2019-10-20 19:26:48 +0200 | [diff] [blame] | 42 | bottom: 0; |
| 43 | left: 0; |
| 44 | /* Should be spacing-m smaller than the .commandContainer padding-left. */ |
| 45 | width: calc(2*var(--spacing-m) + 0.5em); |
| 46 | /* Should vertically match the padding of .commandContainer. */ |
| 47 | padding: var(--spacing-m); |
| 48 | /* Should roughly match the height of .commandContainer without padding. */ |
| 49 | line-height: 26px; |
Wyatt Allen | 7cc9e33 | 2018-08-25 00:42:20 +0000 | [diff] [blame] | 50 | } |
| 51 | .commandContainer gr-copy-clipboard { |
| 52 | --text-container-style: { |
| 53 | border: none; |
| 54 | } |
| 55 | } |
| 56 | </style> |
| 57 | <label>[[label]]</label> |
| 58 | <div class="commandContainer"> |
| 59 | <gr-copy-clipboard text="[[command]]"></gr-copy-clipboard> |
| 60 | </div> |
| 61 | </template> |
| 62 | <script src="gr-shell-command.js"></script> |
| 63 | </dom-module> |