Skip to content

Commit

Permalink
feat: support setting width my name
Browse files Browse the repository at this point in the history
  • Loading branch information
agoose77 committed Dec 6, 2024
1 parent fd7375d commit 6344125
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions landing-page.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -157,25 +157,25 @@ const blockTransform = {
node.children = [marginDiv];
});

const widthRegex = /tool-badge-(\d+px)/;
utils.selectAll("*[class*=tool-badge]", node).forEach((child) => {
const nextNode = structuredClone(child);
const [, width] = child.class.match(widthRegex) ?? [];
const innerDiv = {
type: "div",
children: [nextNode],
style: {
maxWidth: "128px",
width: "100%",
height: "fit-content",
width: width ?? "128px",
},
};
child.type = "div";
child.children = [innerDiv];
child.class = "";
child.style = {
display: "flex",
height: "100%",
alignItems: "center",
justifyContent: "center",
height: "100%",
};
});
},
Expand Down

0 comments on commit 6344125

Please sign in to comment.