Skip to content

Commit 5d446be

Browse files
committed
Added styling for edition badges
1 parent 0af4603 commit 5d446be

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tools/api_refs/redocly.hbs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,24 @@
2222
<script>
2323
window.addEventListener('load', () => {
2424
window.setTimeout(() => {
25+
// Remove badges from TOC
26+
document.querySelectorAll('.menu-content [role="menuitem"] [type="badge"]').forEach(el => el.remove());
27+
28+
// Apply badge styling
29+
document.querySelectorAll('.api-content [data-section-id] h2 [type="primary"]').forEach(el => {
30+
console.log(el);
31+
const color = el.getAttribute('color');
32+
console.log(color);
33+
el.style.backgroundColor = "#FFF";
34+
el.style.border = "1px solid " + color;
35+
el.style.padding = "1px 8px";
36+
el.style.marginRight = "8px";
37+
el.style.color = color;
38+
el.style.fontWeight = "initial";
39+
el.style.borderRadius = "0px";
40+
});
41+
42+
// Style logo
2543
let logo = document.querySelector('img[src$="ibexa-dxp-logo.png"]');
2644
logo.onclick = () => {
2745
let pathParts = document.location.pathname.split('/').slice(0, 3);

0 commit comments

Comments
 (0)