Skip to content

Commit

Permalink
Use CSS for step counter
Browse files Browse the repository at this point in the history
  • Loading branch information
wrbl606 committed Feb 24, 2023
1 parent 77a9467 commit 27c830b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 15 deletions.
9 changes: 6 additions & 3 deletions extension/firefox/content/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -186,16 +186,18 @@
box-sizing: border-box;
padding-top: 1em;
border-top: 1px dashed gray;

counter-increment: step;
}

.steps .index {
font-size: 2rem;
font-weight: bold;
}

.steps .index::after {
content: ".";
.steps .index::before {
font-size: 3rem;
font-weight: bold;
content: counter(step) ". ";
}

.step-image {
Expand Down Expand Up @@ -251,6 +253,7 @@
margin-top: .8rem;
resize: none;
font-size: 1rem;
box-sizing: border-box;
}

.text-content>.content[readonly] {
Expand Down
10 changes: 0 additions & 10 deletions extension/firefox/content/page/dom/editor.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
export function deleteStep(index = -1) {
const step = document.querySelector(`[wtc-step-index="${index}"]`);
step.remove();
recountIndexes();
}

function recountIndexes() {
const steps = document.querySelectorAll('.step');
let index = 1;
for (const step of steps) {
step.querySelector('.index').innerText = index;
index++;
}
}
2 changes: 1 addition & 1 deletion extension/firefox/content/page/dom/init.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion extension/firefox/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "What-to-click",
"version": "1.4.0",
"version": "1.4.1",
"description": "Create how-to documentation in seconds.",
"icons": {
"48": "icons/record.png"
Expand Down

0 comments on commit 27c830b

Please sign in to comment.