Skip to content

Commit 4ca0fde

Browse files
feat: w-16216523. Align Array to the top
1 parent 9d6f0f1 commit 4ca0fde

File tree

2 files changed

+35
-42
lines changed

2 files changed

+35
-42
lines changed

src/PropertyShapeDocument.js

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -870,9 +870,11 @@ export class PropertyShapeDocument extends PropertyDocumentMixin(LitElement) {
870870
propertyName,
871871
parentTypeName,
872872
hasParentTypeName,
873+
isComplex,
874+
avroValue
873875
} = this;
874-
if(!hasDisplayName && !propertyName && this.isComplex && this.avroValue){
875-
return html`<div class="property-display-name">${this.avroValue}</div>`
876+
if(!hasDisplayName && !propertyName && isComplex && avroValue){
877+
return html`<div class="property-display-name">${avroValue}</div>`
876878
}
877879
return html` ${hasDisplayName
878880
? html`<div class="property-display-name">${displayName}</div>`
@@ -894,6 +896,20 @@ export class PropertyShapeDocument extends PropertyDocumentMixin(LitElement) {
894896
return html`<div class="deprecated-warning">Warning: Deprecated</div>`
895897
}
896898

899+
_noNameAvroClass() {
900+
const {
901+
hasDisplayName,
902+
propertyName,
903+
isComplex,
904+
avroValue,
905+
_renderToggleButton
906+
} = this;
907+
if(!hasDisplayName && !propertyName && isComplex && !avroValue && _renderToggleButton){
908+
return ' no-name'
909+
}
910+
return ''
911+
}
912+
897913
/**
898914
* @return {TemplateResult} Main render function.
899915
*/
@@ -902,7 +918,7 @@ export class PropertyShapeDocument extends PropertyDocumentMixin(LitElement) {
902918
${this.styles}
903919
</style>
904920
${this._headerTemplate()}
905-
<div class="property-traits">
921+
<div class="property-traits${this._noNameAvroClass()}">
906922
${this._getTypeNameTemplate()}
907923
${this.isRequired
908924
? html`<span

src/ShapeStyles.js

Lines changed: 16 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
1-
import { css } from 'lit-element';
1+
import { css } from "lit-element";
22

33
export default css`
44
:host {
55
display: block;
66
border-bottom-width: 1px;
7-
border-bottom-color: var(
8-
--property-shape-document-border-bottom-color,
9-
#cfd8dc
10-
);
11-
border-bottom-style: var(
12-
--property-shape-document-border-bottom-style,
13-
dashed
14-
);
7+
border-bottom-color: var(--property-shape-document-border-bottom-color, #cfd8dc);
8+
border-bottom-style: var(--property-shape-document-border-bottom-style, dashed);
159
padding: var(--property-shape-document-padding);
1610
}
1711
@@ -24,38 +18,20 @@ export default css`
2418
}
2519
2620
.property-title {
27-
font-family: var(
28-
--property-shape-document-title-font-family,
29-
var(--arc-font-subhead-font-family)
30-
);
31-
font-size: var(
32-
--property-shape-document-title-font-size,
33-
var(--arc-font-subhead-font-size, 1rem)
34-
);
35-
font-weight: var(
36-
--property-shape-document-title-font-weight,
37-
var(--arc-font-subhead-font-weight)
38-
);
39-
line-height: var(
40-
--property-shape-document-title-line-height,
41-
var(--arc-font-subhead-line-height)
42-
);
43-
44-
margin: var(
45-
--property-shape-document-title-margin,
46-
4px 0 4px 0
47-
);
21+
font-family: var(--property-shape-document-title-font-family, var(--arc-font-subhead-font-family));
22+
font-size: var(--property-shape-document-title-font-size, var(--arc-font-subhead-font-size, 1rem));
23+
font-weight: var(--property-shape-document-title-font-weight, var(--arc-font-subhead-font-weight));
24+
line-height: var(--property-shape-document-title-line-height, var(--arc-font-subhead-line-height));
25+
26+
margin: var(--property-shape-document-title-margin, 4px 0 4px 0);
4827
font-size: 1rem;
4928
font-weight: var(--api-type-document-property-title-font-weight, 500);
5029
word-break: break-word;
5130
color: var(--api-type-document-property-title-color);
5231
}
5332
5433
.property-title[secondary] {
55-
font-weight: var(
56-
--api-type-document-property-title-secondary-font-weight,
57-
400
58-
);
34+
font-weight: var(--api-type-document-property-title-secondary-font-weight, 400);
5935
color: var(--api-type-document-property-title-secondary-color, #616161);
6036
}
6137
@@ -65,10 +41,7 @@ export default css`
6541
6642
.property-display-name {
6743
font-weight: var(--api-type-document-property-name-font-weight, 500);
68-
color: var(
69-
--api-type-document-property-name-color,
70-
var(--api-type-document-property-color, #212121)
71-
);
44+
color: var(--api-type-document-property-name-color, var(--api-type-document-property-color, #212121));
7245
margin: 4px 0 4px 0;
7346
font-size: var(--api-type-document-property-name-font-size, 16px);
7447
}
@@ -117,6 +90,10 @@ export default css`
11790
margin-bottom: 8px;
11891
}
11992
93+
.property-traits.no-name {
94+
margin-top: -33px;
95+
}
96+
12097
.property-traits > span {
12198
display: inline-block;
12299
margin-right: 8px;
@@ -163,7 +140,7 @@ export default css`
163140
-ms-flex: 1;
164141
flex: 1;
165142
}
166-
143+
167144
.property-traits > span.readonly-type {
168145
background-color: var(--api-type-readonly-property-background-color, #ff9292);
169146
color: var(--api-type-readonly-property-color, black);

0 commit comments

Comments
 (0)