blob: 15e282f457c19e3e0d5abb6fc07d9ca110053be1 [file] [log] [blame]
Wyatt Allen7cc9e332018-08-25 00:42:20 +00001<!--
2@license
3Copyright (C) 2018 The Android Open Source Project
4
5Licensed under the Apache License, Version 2.0 (the "License");
6you may not use this file except in compliance with the License.
7You may obtain a copy of the License at
8
9http://www.apache.org/licenses/LICENSE-2.0
10
11Unless required by applicable law or agreed to in writing, software
12distributed under the License is distributed on an "AS IS" BASIS,
13WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14See the License for the specific language governing permissions and
15limitations under the License.
16-->
17
Ole Rehmsen31640742019-05-16 11:24:47 +020018<link rel="import" href="/bower_components/polymer/polymer.html">
Wyatt Allen7cc9e332018-08-25 00:42:20 +000019<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 Rohlfsb3d95cf2019-10-20 19:26:48 +020026 margin-bottom: var(--spacing-m);
Wyatt Allen7cc9e332018-08-25 00:42:20 +000027 }
28 .commandContainer {
29 background-color: var(--shell-command-background-color);
Ben Rohlfsb3d95cf2019-10-20 19:26:48 +020030 /* 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 Allen7cc9e332018-08-25 00:42:20 +000032 position: relative;
33 width: 100%;
34 }
35 .commandContainer:before {
Wyatt Allen7cc9e332018-08-25 00:42:20 +000036 content: '$';
Wyatt Allen7cc9e332018-08-25 00:42:20 +000037 position: absolute;
Ben Rohlfsb3d95cf2019-10-20 19:26:48 +020038 display: block;
39 box-sizing: border-box;
40 background: var(--shell-command-decoration-background-color);
Wyatt Allen7cc9e332018-08-25 00:42:20 +000041 top: 0;
Ben Rohlfsb3d95cf2019-10-20 19:26:48 +020042 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 Allen7cc9e332018-08-25 00:42:20 +000050 }
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>