Skip to content

Commit 8274263

Browse files
committed
Fix layout, styles of admon block with labels
1 parent 0618fe7 commit 8274263

File tree

2 files changed

+9
-16
lines changed

2 files changed

+9
-16
lines changed

src/css/labels.css

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ div.labels {
1414
flex-wrap: wrap;
1515
}
1616

17-
.admonitionblock > div.labels {
18-
padding: 1rem 1rem 0.75rem;
17+
.admonitionblock div.labels {
18+
padding: 0.5rem 0 1rem;
1919
}
2020

2121
.header-label-container > div.labels {
@@ -62,19 +62,6 @@ h1 > .header-label {
6262
margin-bottom: 0.2rem;
6363
}
6464

65-
.has-label {
66-
padding-left: 0.4rem;
67-
border-left: 2px solid rgba(var(--colors-baltic-60));
68-
}
69-
70-
.has-label:has(> .labels > .label--new) {
71-
border-left-color: var(--success-color);
72-
}
73-
74-
.has-label:has(> .labels > .label--deprecated) {
75-
border-left-color: var(--deprecated-color);
76-
}
77-
7865
h2 > .flex-label {
7966
float: inline-end;
8067
line-height: var(--doc-line-height);

src/js/60-docs-roles.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ document.addEventListener('DOMContentLoaded', function () {
140140
// no need to do anything if we found only undefined roles
141141
if (labels.length === 0) return
142142

143-
const labelsLocation = (roleDiv.firstElementChild && headings.includes(roleDiv.firstElementChild.nodeName)) ? roleDiv.firstElementChild : roleDiv
143+
let labelsLocation = (roleDiv.firstElementChild && headings.includes(roleDiv.firstElementChild.nodeName)) ? roleDiv.firstElementChild : roleDiv
144144
const labelsDiv = createElement('div', 'labels')
145145

146146
for (const label of labels) {
@@ -154,6 +154,12 @@ document.addEventListener('DOMContentLoaded', function () {
154154
}
155155
}
156156

157+
console.log(roleDiv.classList)
158+
159+
if (roleDiv.classList.contains('admonitionblock')) {
160+
labelsLocation = roleDiv.querySelector('td.content')
161+
}
162+
157163
if (roleDiv.nodeName === 'H1' || headings.includes(roleDiv.firstElementChild.nodeName)) {
158164
labelsLocation.append(labelsDiv)
159165
labelsLocation.classList.add('header-label-container')

0 commit comments

Comments
 (0)