Skip to content

Commit 676e6f8

Browse files
committed
css-part improved names to target expanded and collapsed endpoints
1 parent ddf06fa commit 676e6f8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/templates/endpoint-template.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function onExpandCollapseAll(e, action = 'expand-all') {
4646
/* eslint-disable indent */
4747
function endpointHeadTemplate(path, pathsExpanded = false) {
4848
return html`
49-
<summary @click="${(e) => { toggleExpand.call(this, path, e); }}" part="section-endpoint-head" class='endpoint-head ${path.method} ${path.deprecated ? 'deprecated' : ''} ${pathsExpanded || path.expanded ? 'expanded' : 'collapsed'}'>
49+
<summary @click="${(e) => { toggleExpand.call(this, path, e); }}" part="section-endpoint-head-${path.expanded ? 'expanded' : 'collapsed'}" class='endpoint-head ${path.method} ${path.deprecated ? 'deprecated' : ''} ${pathsExpanded || path.expanded ? 'expanded' : 'collapsed'}'>
5050
<div part="section-endpoint-head-method" class="method ${path.method} ${path.deprecated ? 'deprecated' : ''}"> ${path.method} </div>
5151
<div part="section-endpoint-head-path" class="path ${path.deprecated ? 'deprecated' : ''}">
5252
${path.path}
@@ -88,7 +88,7 @@ function endpointBodyTemplate(path) {
8888

8989
const codeSampleTabPanel = path.xCodeSamples ? codeSamplesTemplate(path.xCodeSamples) : '';
9090
return html`
91-
<div part="section-endpoint-body" class='endpoint-body ${path.method} ${path.deprecated ? 'deprecated' : ''}'>
91+
<div part="section-endpoint-body-${path.expanded ? 'expanded' : 'collapsed'}" class='endpoint-body ${path.method} ${path.deprecated ? 'deprecated' : ''}'>
9292
<div class="summary">
9393
${path.summary
9494
? html`<div class="title" part="section-endpoint-body-title">${path.summary}<div>`
@@ -108,7 +108,7 @@ function endpointBodyTemplate(path) {
108108
: ''
109109
}
110110
111-
${path.description ? html`<div part="section-endpoint-body-description" class="m-markdown"> ${unsafeHTML(marked(path.description))}</div>` : ''}
111+
${path.description ? html`<div part="section-endpoint-body-description" class="m-markdown"> ${unsafeHTML(marked(path.description))}</div>` : ''}
112112
<slot name="${path.elementId}"></slot>
113113
${pathSecurityTemplate.call(this, path.security)}
114114
${codeSampleTabPanel}

0 commit comments

Comments
 (0)