Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/css/labels.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ div.labels {
flex-wrap: wrap;
}

.admonitionblock > div.labels {
padding: 1rem 1rem 0.75rem;
.admonitionblock div.labels {
padding: 0.5rem 0 1rem;
}

.header-label-container > div.labels {
Expand Down Expand Up @@ -62,16 +62,16 @@ h1 > .header-label {
margin-bottom: 0.2rem;
}

.has-label {
.paragraph.has-label {
padding-left: 0.4rem;
border-left: 2px solid rgba(var(--colors-baltic-60));
}

.has-label:has(> .labels > .label--new) {
.paragraph.has-label:has(> .labels > .label--new) {
border-left-color: var(--success-color);
}

.has-label:has(> .labels > .label--deprecated) {
.paragraph.has-label:has(> .labels > .label--deprecated) {
border-left-color: var(--deprecated-color);
}

Expand Down
8 changes: 7 additions & 1 deletion src/js/60-docs-roles.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ document.addEventListener('DOMContentLoaded', function () {
// no need to do anything if we found only undefined roles
if (labels.length === 0) return

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

for (const label of labels) {
Expand All @@ -154,6 +154,12 @@ document.addEventListener('DOMContentLoaded', function () {
}
}

console.log(roleDiv.classList)

if (roleDiv.classList.contains('admonitionblock')) {
labelsLocation = roleDiv.querySelector('td.content')
}

if (roleDiv.nodeName === 'H1' || headings.includes(roleDiv.firstElementChild.nodeName)) {
labelsLocation.append(labelsDiv)
labelsLocation.classList.add('header-label-container')
Expand Down