Skip to content

Commit

Permalink
more styling tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed May 13, 2024
1 parent 7ccf33d commit e64b662
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 20 deletions.
16 changes: 9 additions & 7 deletions src/mechanics/css/dlist-roll.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,28 @@
&.action-die {
}
&.stat:before {
content: "+ "
content: " + "
}
&.stat-name {
color: var(--text-faint);
&:before {
content: "(+";
content: " (";
}
&:after {
content: ")";
padding-right: 0;
margin-right: 0;
}
}
&.adds:before {
content: "+ ";
content: " + ";
}
&.score {
&:before {
content: "= ";
content: " = ";
}
&:after {
content: " vs";
content: " vs ";
}
}
&.challenge-die {
Expand All @@ -36,13 +38,13 @@
}
&:has(~ .challenge-die) {
&:after {
content: " |";
content: " | ";
}
}
}
&.progress-score {
&:after {
content: " vs";
content: " vs ";
}
}
&.outcome {
Expand Down
2 changes: 1 addition & 1 deletion src/mechanics/css/dlist-shared.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
}
& dd {
margin: 0;
padding: 0 0.2em;
padding: 0;
display: inline;
font-weight: var(--font-semibold);
&:before, &:after {
Expand Down
3 changes: 2 additions & 1 deletion src/mechanics/mechanics-blocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ function parseMechanicsBlocks(source: string, el: HTMLElement) {
const doc = res.output;
for (const node of doc) {
switch (node.name.toLowerCase()) {
case "move":
case "move": {
renderMove(el, node);
break;
}
}
}
}
22 changes: 11 additions & 11 deletions src/mechanics/move.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,17 +135,6 @@ function renderRoll(moveNode: HTMLElement, roll: KdlNode) {
rollNode.addClass("match");
outcome += " (Match)";
}
if (statName) {
rollNode.createEl("dt", {
text: "Stat Name",
});
rollNode
.createEl("dd", {
cls: "stat-name",
text: statName,
})
.setAttribute("data-value", statName);
}
rollNode.createEl("dt", {
text: "Action Die",
});
Expand All @@ -164,6 +153,17 @@ function renderRoll(moveNode: HTMLElement, roll: KdlNode) {
text: "" + stat,
})
.setAttribute("data-value", "" + stat);
if (statName) {
rollNode.createEl("dt", {
text: "Stat Name",
});
rollNode
.createEl("dd", {
cls: "stat-name",
text: statName,
})
.setAttribute("data-value", statName);
}
rollNode.createEl("dt", {
text: "Adds",
});
Expand Down

0 comments on commit e64b662

Please sign in to comment.