Fix styles for plugins on change-metadata-item endpoint in p2

Created a shared style for change-metadata endpoint,
for plugins that are polymer component, can just include it in template.

Bug: Issue 11297
Change-Id: I64e2ad4c575a3129454ed9936749887a5b40a682
This commit is contained in:
Tao Zhou
2019-08-19 09:51:56 +02:00
parent 864af5edd3
commit 55e440b47d
3 changed files with 55 additions and 26 deletions

View File

@@ -18,6 +18,7 @@ limitations under the License.
<link rel="import" href="/bower_components/polymer/polymer.html">
<link rel="import" href="../../../behaviors/rest-client-behavior/rest-client-behavior.html">
<link rel="import" href="../../../styles/shared-styles.html">
<link rel="import" href="../../../styles/gr-change-metadata-shared-styles.html">
<link rel="import" href="../../../styles/gr-voting-styles.html">
<link rel="import" href="../../core/gr-navigation/gr-navigation.html">
<link rel="import" href="../../plugins/gr-endpoint-decorator/gr-endpoint-decorator.html">
@@ -38,35 +39,11 @@ limitations under the License.
<dom-module id="gr-change-metadata">
<template>
<style include="gr-change-metadata-shared-styles"></style>
<style include="shared-styles">
:host {
display: table;
}
section {
display: table-row;
}
section:not(:first-of-type) .title,
section:not(:first-of-type) .value {
padding-top: .5em;
}
section:not(:first-of-type) {
margin-top: 1em;
}
.title,
.value {
display: table-cell;
}
.title {
color: var(--deemphasized-text-color);
font-weight: var(--font-weight-bold);
max-width: 20em;
padding-left: var(--metadata-horizontal-padding);
padding-right: .5em;
word-break: break-word;
}
.value {
padding-right: var(--metadata-horizontal-padding);
}
gr-change-requirements {
--requirements-horizontal-padding: var(--metadata-horizontal-padding);
}

View File

@@ -23,4 +23,4 @@ limitations under the License.
<slot></slot>
</template>
<script src="gr-endpoint-decorator.js"></script>
</dom-module>
</dom-module>

View File

@@ -0,0 +1,52 @@
<!--
@license
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<dom-module id="gr-change-metadata-shared-styles">
<template>
<style>
section {
display: table-row;
}
section:not(:first-of-type) .title,
section:not(:first-of-type) .value {
padding-top: .5em;
}
section:not(:first-of-type) {
margin-top: 1em;
}
.title,
.value {
display: table-cell;
}
.title {
color: var(--deemphasized-text-color);
font-weight: var(--font-weight-bold);
max-width: 20em;
padding-left: var(--metadata-horizontal-padding);
padding-right: .5em;
word-break: break-word;
}
.value {
padding-right: var(--metadata-horizontal-padding);
}
</style>
</template>
</dom-module>