Bezier-rs: Add iframes to rustdoc (#1036)

* Add iframes examples

* Move TValue selection to bottom

* Remove spaces

* Add background, adjust heights

* Minor lint fix
This commit is contained in:
Hannah Li
2023-02-17 19:09:36 -05:00
committed by Keavon Chambers
parent 9a52cae9b9
commit 98f172414a
9 changed files with 47 additions and 9 deletions

View File

@@ -2,6 +2,7 @@ html,
body {
font-family: Arial, sans-serif;
text-align: center;
background-color: white;
}
body > h1 {

View File

@@ -45,13 +45,15 @@ export function renderDemoPane(demoPane: DemoPane): void {
const headerAnchorLink = document.createElement("a");
headerAnchorLink.innerText = "#";
const currentHash = window.location.hash.split("/");
// Add href anchor if not on a solo example page
if (currentHash.length !== 3 && currentHash[2] !== "solo") headerAnchorLink.href = `#${demoPane.id}`;
const header = document.createElement("h3");
header.innerText = demoPane.name;
header.className = "demo-pane-header";
header.append(headerAnchorLink);
// Add header and href anchor if not on a solo example page
if (currentHash.length !== 3 && currentHash[2] !== "solo") {
headerAnchorLink.href = `#${demoPane.id}`;
const header = document.createElement("h3");
header.innerText = demoPane.name;
header.className = "demo-pane-header";
header.append(headerAnchorLink);
container.append(header);
}
const tVariantContainer = document.createElement("div");
tVariantContainer.className = "t-variant-choice";
@@ -95,11 +97,11 @@ export function renderDemoPane(demoPane: DemoPane): void {
demoRow.append(demoComponent);
});
container.append(header);
container.append(demoRow);
if (demoPane.chooseTVariant) {
container.append(tVariantContainer);
}
container.append(demoRow);
demoPane.append(container);
}