Skip to content

Commit

Permalink
docs: add information about the header slot
Browse files Browse the repository at this point in the history
  • Loading branch information
trovster committed Oct 4, 2023
1 parent 77323a4 commit 0968234
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

# Fitness Components

This provides two Web Components for fitness visualisations. The default design
is inspired by Apple Fitness. You can use a fully featured card or just the
rings.
This provides two Web Components for fitness visualisations. The default ring
design is inspired by Apple Fitness. You can use a fully featured card or just
the rings.

## Installation

Expand All @@ -25,7 +25,7 @@ must be imported before the custom elements can be used.
</script>
```

Both the card and ring require the move, exercise and stand totals and goals.
Both the card and ring require the `move`, `exercise` and `stand` totals and goals.
The card has additional optional values. If you include the date, it appears as
a header. The `steps`, `distance` and `flights` data appear in the footer
section. The distance attribute should be provided in **in meters**. By default,
Expand Down Expand Up @@ -57,6 +57,15 @@ this is converted to *miles* but you can change this to kilometres using
></fitness-ring>
```

You can also provide a custom header by using the named slot. If a `date`
attribute is set, then this will be used it.

```html
<fitness-card>
<div slot="header">The Custom Header</div>
</fitness-card>
```

You can control the font and colours of the card and rings using CSS variables.
The `--fitness-value` controls the colour of the *values* in the footer.

Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h1>Fitness Web Components</h1>
<p>
This is a demo of the components with default and alternative styles.
You can use a fully featured card or just the rings.
<span class="note">The default design is inspired by Apple Fitness.</span>
<span class="note">The default ring design is inspired by Apple Fitness.</span>
</p>
<p>
You can download code from the
Expand Down

0 comments on commit 0968234

Please sign in to comment.