Skip to content

Commit

Permalink
fix(warnings): update styles (#1)
Browse files Browse the repository at this point in the history
* fix(warnings): update styles

* Update .gitignore

* Sneak in lil change

---------

Co-authored-by: Joshua Chen <[email protected]>
  • Loading branch information
OnkarRuikar and Josh-Cena authored Jul 30, 2024
1 parent 64538b3 commit e59f762
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ data/*
!data/.keep
sidebars
docs/*.js
*.txt
Binary file modified bun.lockb
Binary file not shown.
28 changes: 18 additions & 10 deletions docs/warnings.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,39 @@ body {
}

header {
height: 2em;
height: 2rem;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}

nav ul {
display: flex;
gap: 2em;
gap: 2rem;
}

main {
display: flex;
margin: 1em;
height: calc(100vh - 5em);
margin: 1rem 0 0 0;
}

select {
min-width: 300px;
height: 100%;
flex: none;
position: sticky;
top: 1rem;
padding: 0.4rem;
height: calc(100vh - 5rem);
overflow-y: auto;
}

option {
margin: 0;
padding: 0;
}

ul {
list-style: none;
padding-inline-start: 1rem;
}

summary {
Expand All @@ -36,13 +44,13 @@ summary {
}

pre {
margin: 0;
margin: 0 0 0.4rem 1rem;
}

#note {
position: absolute;
position: fixed;
top: 0;
right: 0;
padding: 10px;
padding: 0.4rem;
background-color: lightgray;
}
4 changes: 2 additions & 2 deletions docs/warnings.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<header>
<nav>
<ul>
<li><a href="/">The graph</a></li>
<li><a href="/warning-info">Warning docs</a></li>
<li><a href="/mdn-graph">The graph</a></li>
<li><a href="/mdn-graph/warning-info">Warning docs</a></li>
</ul>
</nav>
</header>
Expand Down
4 changes: 3 additions & 1 deletion src/client/warnings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ function createTree(
for (const li of ul.children as HTMLCollectionOf<HTMLLIElement>)
(li.children[0] as HTMLDetailsElement).open = true;
}
root.append(ul);
if (ul.childElementCount > 0) {
root.append(ul);
}
return count;
}

Expand Down

0 comments on commit e59f762

Please sign in to comment.