Skip to content

Commit 3af958f

Browse files
committed
fix(template js): fix query selector for nested articles and primary color default
1 parent 9d95982 commit 3af958f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

template/src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,15 @@ function addProgress(config) {
7878
return;
7979
}
8080

81-
const articles = [...document.getElementsByTagName('article')];
81+
const articles = [...document.querySelectorAll()('main > article')];
8282

8383
if(config.progress === 'line') {
8484
articles.forEach((article, index) => {
8585
const line = document.createElement('div');
8686
line.classList.add("progress-line");
8787
article.appendChild(line);
8888

89-
line.style.backgroundColor = 'var(--primary-color)';
89+
line.style.backgroundColor = 'var(--primary-color, #000)';
9090

9191
line.style.height = '3px';
9292
line.style.position = 'absolute';

0 commit comments

Comments
 (0)