Skip to content

Commit

Permalink
chore(deprecation): custom title and styling (#700)
Browse files Browse the repository at this point in the history
  • Loading branch information
rofe authored Dec 17, 2024
1 parent fce5fdc commit c7d7c98
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
11 changes: 11 additions & 0 deletions blocks/deprecation/deprecation.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,15 @@
font-weight: 700;
font-size: var(--type-body-m-size);
text-transform: uppercase;
}

.deprecation > div > div > p,
.deprecation a:any-link,
.deprecation code {
color: #fff;
}

.deprecation code {
background-color: rgba(255 255 255 / 20%);
border: none;
}
10 changes: 9 additions & 1 deletion blocks/deprecation/deprecation.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
export default function decorate(block) {
const h3 = block.querySelector('h3');
let title = '';
if (h3) {
title = h3.textContent;
h3.remove();
} else {
title = 'Deprecation notice';
}
const header = document.createElement('div');
header.className = 'header';
header.textContent = 'Deprecation notice';
header.textContent = title;
block.prepend(header);
}

0 comments on commit c7d7c98

Please sign in to comment.