Skip to content

Commit bbe1e38

Browse files
authored
feat: add additional custom properties to mux-uploader progress bar (#1069)
- `--progress-bar-background-color` (I know it's technically configuring `background`, but, following the example of `--progress-bar-fill-color`, I called it `background-color`) - `--progress-bar-border-radius` - `--progress-bar-box-shadow` (I don't even know what this property does, but it felt like it should be configurable, like the others) Also: - Demo new props in mux-uploader-modal example - Added missing `--progress-radial-fill-color` on React style props
1 parent 405564f commit bbe1e38

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

examples/vanilla-ts-esm/public/mux-uploader-modal.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@
4646
mux-uploader-progress {
4747
display: contents;
4848
--progress-bar-fill-color: #46a6de;
49+
--progress-bar-background-color: #4e46de;
4950
--progress-bar-height: 8px;
51+
--progress-bar-border-radius: 0px;
5052
}
5153
</style>
5254
</head>

packages/mux-uploader-react/src/mux-uploader-progress.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ export type MuxUploaderProgressProps = {
1515
style?: CSSProperties & {
1616
['--progress-bar-height']?: CSSProperties['height'];
1717
['--progress-bar-fill-color']?: CSSProperties['fill'];
18+
['--progress-bar-background-color']?: CSSProperties['background'];
19+
['--progress-bar-box-shadow']?: CSSProperties['boxShadow'];
20+
['--progress-bar-border-radius']?: CSSProperties['borderRadius'];
21+
['--progress-radial-fill-color']?: CSSProperties['stroke'];
1822
['--progress-percentage-display']?: CSSProperties['display'];
1923
};
2024
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, 'ref'>;

packages/mux-uploader/REFERENCE.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,10 @@ customization:
9595
| Name | CSS Property | Default Value | Description |
9696
| ---- | ------------ | ------------- | ----------- |
9797
| `--progress-bar-fill-color` | `background` | `black` | Background "fill" color for progress bar, which visually indicates progress |
98+
| `--progress-bar-background-color` | `background` | `#e6e6e6` | The background on which the progress bar is rendered. |
99+
| `--progress-bar-box-shadow` | `box-shadow` | `0 10px 40px -10px #fff` | Box shadow behind the progress bar. |
98100
| `--progress-bar-height` | `height` | `4px` | Height for the progress bar. |
101+
| `--progress-bar-border-radius` | `border-radius` | `100px` | Border radius for the progress bar. |
99102
| `--progress-radial-fill-color` | `stroke` | `black` | Stroke color for `radial` progress `type` (_Experimental_) |
100103
| `--progress-percentage-display` | `display` | `block` | Display value for percentage progress. Set to `none` to hide. |
101104

@@ -294,7 +297,10 @@ customization:
294297
| Name | CSS Property | Default Value | Description |
295298
| ---- | ------------ | ------------- | ----------- |
296299
| `--progress-bar-fill-color` | `background` | `black` | Background "fill" color for progress bar, which visually indicates progress |
300+
| `--progress-bar-background-color` | `background` | `#e6e6e6` | The background on which the progress bar is rendered. |
301+
| `--progress-bar-box-shadow` | `box-shadow` | `0 10px 40px -10px #fff` | Box shadow behind the progress bar. |
297302
| `--progress-bar-height` | `height` | `4px` | Height for the progress bar. |
303+
| `--progress-bar-border-radius` | `border-radius` | `100px` | Border radius for the progress bar. |
298304
| `--progress-radial-fill-color` | `stroke` | `black` | Stroke color for `radial` progress `type` (_Experimental_) |
299305
| `--progress-percentage-display` | `display` | `block` | Display value for percentage progress. Set to `none` to hide. |
300306

packages/mux-uploader/src/mux-uploader-progress.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ template.innerHTML = /*html*/ `
1717
}
1818
1919
.bar-type {
20-
background: #e6e6e6;
21-
border-radius: 100px;
20+
background: var(--progress-bar-background-color, #e6e6e6);
21+
border-radius: var(--progress-bar-border-radius, 100px);
2222
height: var(--progress-bar-height, 4px);
2323
width: 100%;
2424
}
@@ -44,8 +44,8 @@ template.innerHTML = /*html*/ `
4444
}
4545
4646
.progress-bar {
47-
box-shadow: 0 10px 40px -10px #fff;
48-
border-radius: 100px;
47+
box-shadow: var(--progress-bar-box-shadow, 0 10px 40px -10px #fff);
48+
border-radius: var(--progress-bar-border-radius, 100px);
4949
background: var(--progress-bar-fill-color, #000000);
5050
height: var(--progress-bar-height, 4px);
5151
width: 0%;

0 commit comments

Comments
 (0)