Skip to content

Commit f27ca74

Browse files
committed
Progress bar styling updates
1 parent 64e15a0 commit f27ca74

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

‎src/components/Content/ProgressBar/client/index.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
* Article reading progress bar – Lit web component
33
*
44
* Renders a fixed `<progress>` element below the header that fills as
5-
* the visitor scrolls through the article `#content` region. Uses the
6-
* layout-position store's `--layout-top-offset` to position itself
7-
* directly beneath the header.
5+
* the visitor scrolls through the article `#content` region. Positioned
6+
* via `--theme-picker-offset` + `--header-current-height` from the
7+
* layout-position store.
88
*/
99
import { LitElement } from 'lit'
1010
import { defineCustomElement } from '@components/scripts/utils'

‎src/components/Content/ProgressBar/index.astro‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,22 @@
44
*
55
* Fixed below the header, shows scroll progress through the article.
66
* Rendered as a Lit web component wrapping a native <progress> element.
7-
* Uses --layout-top-offset from the layout-position store for vertical
8-
* positioning. The data-progress-bar attribute lets the store measure it.
7+
* Positioned via --theme-picker-offset + --header-current-height from
8+
* the layout-position store. The data-progress-bar attribute lets the
9+
* store measure it.
910
*/
1011
---
1112

1213
<reading-progress-bar
1314
class="fixed left-0 right-0 block h-1.5 sm:h-2"
14-
style="top: var(--layout-top-offset, 0); z-index: var(--z-nav);"
15+
style="top: calc(var(--theme-picker-offset, 0px) + var(--header-current-height, 0px)); z-index: var(--z-nav);"
1516
data-progress-bar
1617
aria-hidden="true"
1718
>
1819
<progress
1920
max="100"
2021
value="0"
21-
class="block h-full w-full appearance-none [&::-webkit-progress-bar]:bg-transparent [&::-webkit-progress-value]:bg-success [&::-moz-progress-bar]:bg-success text-[8px]"
22+
class="block h-full w-full appearance-none [&::-webkit-progress-bar]:bg-transparent [&::-webkit-progress-value]:bg-page-inverse [&::-moz-progress-bar]:bg-page-inverse"
2223
></progress>
2324
</reading-progress-bar>
2425

0 commit comments

Comments
 (0)