Skip to content

Commit 9ba08c8

Browse files
committed
Update: Adding narrow layout support.
1 parent 56105eb commit 9ba08c8

File tree

2 files changed

+44
-32
lines changed

2 files changed

+44
-32
lines changed

api-oauth2-settings-document.html

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,23 @@
1717
@apply --arc-font-subhead;
1818
}
1919

20+
ul {
21+
maring: 0;
22+
padding: 0;
23+
}
24+
2025
.settings-value {
2126
background: var(--code-background-color, #f5f2f0);
2227
display: block;
2328
padding: 1em;
2429
margin: .5em 0;
2530
}
31+
32+
.settings-list-value {
33+
background: var(--code-background-color, #f5f2f0);
34+
display: block;
35+
padding: 1em;
36+
}
2637
</style>
2738
<template is="dom-if" if="[[hasAccessTokenUri]]">
2839
<h4>Access token URI</h4>
@@ -38,16 +49,16 @@ <h4>Authorization URI</h4>
3849
<h4>Authorization grants</h4>
3950
<uL>
4051
<template is="dom-repeat" items="[[authorizationGrants]]">
41-
<li class="">[[item]]</li>
52+
<li class="settings-list-value">[[item]]</li>
4253
</template>
4354
</ul>
4455
</template>
4556

4657
<template is="dom-if" if="[[hasScopes]]">
4758
<h4>Authorization scopes</h4>
48-
<uL>
59+
<ul>
4960
<template is="dom-repeat" items="[[scopes]]">
50-
<li class="">[[item.label]]</li>
61+
<li class="settings-list-value">[[item.label]]</li>
5162
</template>
5263
</ul>
5364
</template>

api-security-documentation.html

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -21,32 +21,24 @@
2121
}
2222

2323
h1 {
24-
@apply --arc-font-display1;
25-
}
26-
27-
h2 {
2824
@apply --arc-font-headline;
25+
@apply --api-security-documentation-title;
2926
}
3027

31-
h3 {
28+
h2 {
3229
@apply --arc-font-title;
30+
@apply --api-security-documentation-main-section-title;
3331
}
3432

35-
h4 {
36-
@apply --arc-font-subhead;
33+
:host([narrow]) h1 {
34+
font-size: 20px;
35+
margin: 0;
36+
@apply --api-security-documentation-title-narrow;
3737
}
3838

39-
.settings-value {
40-
background: var(--code-background-color, #f5f2f0);
41-
display: block;
42-
padding: 1em;
43-
margin: .5em 0;
44-
}
45-
46-
.settings-list-value {
47-
background: var(--code-background-color, #f5f2f0);
48-
display: block;
49-
padding: 1em;
39+
:host([narrow]) h2 {
40+
font-size: 18px;
41+
@apply --api-security-documentation-main-section-title-narrow;
5042
}
5143
</style>
5244
<template is="dom-if" if="[[aware]]">
@@ -63,30 +55,26 @@ <h1>[[type]]</h1>
6355
<div slot="markdown-html" class="markdown-body"></div>
6456
</marked-element>
6557
</template>
66-
6758
<template is="dom-if" if="[[hasSettings]]">
6859
<template is="dom-if" if="[[isOauth2Settings]]">
69-
<h3>Settings</h3>
60+
<h2>Settings</h2>
7061
<api-oauth2-settings-document settings="[[settings]]"></api-oauth2-settings-document>
7162
</template>
7263
<template is="dom-if" if="[[isOauth1Settings]]">
73-
<h3>Settings</h3>
64+
<h2>Settings</h2>
7465
<api-oauth1-settings-document settings="[[settings]]"></api-oauth1-settings-document>
7566
</template>
7667
</template>
77-
7868
<template is="dom-if" if="[[hasQueryParameters]]">
79-
<api-parameters-document amf-model="[[amfModel]]" query-opened query-parameters="[[queryParameters]]"></api-parameters-document>
69+
<api-parameters-document amf-model="[[amfModel]]" query-opened query-parameters="[[queryParameters]]" narrow="[[narrow]]"></api-parameters-document>
8070
</template>
81-
8271
<template is="dom-if" if="[[hasHeaders]]">
83-
<api-headers-document opened amf-model="[[amfModel]]" headers="[[headers]]"></api-headers-document>
72+
<api-headers-document opened amf-model="[[amfModel]]" headers="[[headers]]" narrow="[[narrow]]"></api-headers-document>
8473
</template>
85-
8674
<template is="dom-if" if="[[hasResponses]]">
8775
<section class="response-documentation">
88-
<h3>Responses</h3>
89-
<api-responses-document amf-model="[[amfModel]]" returns="[[responses]]"></api-responses-document>
76+
<h2>Responses</h2>
77+
<api-responses-document amf-model="[[amfModel]]" returns="[[responses]]" narrow="[[narrow]]"></api-responses-document>
9078
</section>
9179
</template>
9280
</template>
@@ -103,6 +91,12 @@ <h3>Responses</h3>
10391
* Custom property | Description | Default
10492
* ----------------|-------------|----------
10593
* `--api-security-documentation` | Mixin applied to this elment | `{}`
94+
* `--arc-font-headline` | Theme mixin, Applied to H1 element | `{}`
95+
* `--api-security-documentation-title` | Mixin applied to the H1 element | `{}`
96+
* `--api-security-documentation-title-narrow` | Mixin applied to the H1 element in narrow layout | `{}`
97+
* `--arc-font-title` | Theme mixin, applied to h2 element | `{}`
98+
* `--api-security-documentation-main-section-title` | Mixin applied to main sections title element | `{}`
99+
* `--api-security-documentation-main-section-title-narrow` | Mixin applied to main sections title element in narrow layout | `{}`
106100
*
107101
* @customElement
108102
* @polymer
@@ -204,7 +198,14 @@ <h3>Responses</h3>
204198
hasCustomProperties: {
205199
type: Boolean,
206200
computed: '_computeHasCustomProperties(security)'
207-
}
201+
},
202+
/**
203+
* Set to render a mobile friendly view.
204+
*/
205+
narrow: {
206+
type: Boolean,
207+
reflectToAttribute: true
208+
}
208209
};
209210
}
210211

0 commit comments

Comments
 (0)