Skip to content

Commit f747483

Browse files
authored
Add --track-height to <wa-progress-bar> (#1159)
* add `--track-height` to `<wa-progress-bar>` * fix custom `<wa-progress-bar>` height instances * add changelog
1 parent 8719bbc commit f747483

File tree

6 files changed

+14
-12
lines changed

6 files changed

+14
-12
lines changed

packages/webawesome/docs/docs/components/progress-bar.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ Use the `label` attribute to label the progress bar and tell assistive devices h
2121

2222
### Custom Height
2323

24-
Use the `height` CSS property to set the progress bar's height.
24+
Use the `--track-height` custom property to set the progress bar's height.
2525

2626
```html {.example}
27-
<wa-progress-bar value="50" style="height: 6px;"></wa-progress-bar>
27+
<wa-progress-bar value="50" style="--track-height: 6px;"></wa-progress-bar>
2828
```
2929

3030
### Showing Values

packages/webawesome/docs/docs/resources/changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ Components with the <wa-badge variant="warning">Experimental</wa-badge> badge sh
1010

1111
## Next
1212

13+
### New Features {data-no-outline}
14+
- Added `--track-height` custom property to `<wa-progress-bar>` [pr:1154]
15+
- Added `--pulse-color` custom property to `<wa-badge>` [pr:1173]
16+
1317
### Bug Fixes and Improvements {data-no-outline}
1418

1519
- Fixed a bug in `<wa-badge>` where `appearance="pulse"` was not working as expected [pr:1173]

packages/webawesome/docs/examples/themes/showcase.njk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -616,8 +616,8 @@ layout: false
616616
}
617617
}
618618
619-
wa-progress-bar::part(base) {
620-
height: 0.5em;
619+
wa-progress-bar {
620+
--track-height: 0.5em;
621621
}
622622
</style>
623623
</body>

packages/webawesome/src/components/progress-bar/progress-bar.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
:host {
2+
--track-height: 1rem;
23
--track-color: var(--wa-color-neutral-fill-normal);
34
--indicator-color: var(--wa-color-brand-fill-loud);
45

@@ -10,10 +11,11 @@
1011
display: flex;
1112
position: relative;
1213
overflow: hidden;
13-
height: 1rem;
14+
height: var(--track-height);
1415
border-radius: var(--wa-border-radius-pill);
1516
background-color: var(--track-color);
1617
color: var(--wa-color-brand-on-loud);
18+
font-size: var(--wa-font-size-s);
1719
}
1820

1921
.indicator {

packages/webawesome/src/components/progress-bar/progress-bar.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ import styles from './progress-bar.css';
1919
* @csspart indicator - The progress bar's indicator.
2020
* @csspart label - The progress bar's label.
2121
*
22-
* @cssproperty --track-color - The color of the track.
23-
* @cssproperty --indicator-color - The color of the indicator.
22+
* @cssproperty [--track-height=1rem] - The color of the track.
23+
* @cssproperty [--track-color=var(--wa-color-neutral-fill-normal)] - The color of the track.
24+
* @cssproperty [--indicator-color=var(--wa-color-brand-fill-loud)] - The color of the indicator.
2425
*/
2526
@customElement('wa-progress-bar')
2627
export default class WaProgressBar extends WebAwesomeElement {

packages/webawesome/src/styles/themes/shoelace.css

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -466,11 +466,6 @@
466466
}
467467
}
468468

469-
wa-progress-bar::part(base),
470-
progress {
471-
height: 1em;
472-
}
473-
474469
wa-tab {
475470
font-size: var(--wa-font-size-smaller);
476471
}

0 commit comments

Comments
 (0)