Skip to content

Commit

Permalink
better docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nichoth committed Apr 5, 2024
1 parent 4c091e7 commit 384824c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,15 @@ Link to the minified file in HTML:
<script type="module" src="./scroll-progress.min.js"></script>
```

## css
Override the variable `--scroll-progress-color` to customize the color.

```css
.scroll-progress {
--scroll-progress-color: pink;
}
```

## examples

### JS
Expand All @@ -74,7 +83,7 @@ Link to the minified file in HTML:
// index.ts
import Tonic from '@bicycle-codes/tonic'
import { ScrollProgress } from '@bicycle-codes/scroll-progress'
import './index.css'
import '@bicycle-codes/scroll-progress.css'
import '@bicycle-codes/scroll-progress'

function ScrollExample () {
Expand Down
2 changes: 1 addition & 1 deletion src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
--scroll: 0;
}

.scroll-position {
.scroll-progress {
min-height: 10px;
width: var(--scroll);
position: fixed;
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class ScrollProgress extends Tonic {
}

render () {
const classes = (['scroll-position'])
const classes = (['scroll-progress'])
// @ts-expect-error broken upstream
.concat((this.props.class || '').split(' '))
.filter(Boolean)
Expand Down

0 comments on commit 384824c

Please sign in to comment.