File tree Expand file tree Collapse file tree
src/components/Content/ProgressBar Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 */
99import { LitElement } from 'lit'
1010import { defineCustomElement } from '@components/scripts/utils'
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments