fix: prevent css collision (#404)

This commit is contained in:
Carlos Valente
2023-05-20 22:48:14 +02:00
committed by GitHub
parent a5a6ca3229
commit 4612829e5b
2 changed files with 10 additions and 10 deletions
@@ -3,7 +3,7 @@
$progress-bar-size: 12px; $progress-bar-size: 12px;
$progress-bar-br: 3px; $progress-bar-br: 3px;
.progress-bar { .multiprogress-bar {
position: relative; position: relative;
width: 100%; width: 100%;
height: $progress-bar-size; height: $progress-bar-size;
@@ -17,7 +17,7 @@ $progress-bar-br: 3px;
} }
} }
.progress-bar__indicator { .multiprogress-bar__indicator {
position: absolute; position: absolute;
height: inherit; height: inherit;
background-color: black; background-color: black;
@@ -27,7 +27,7 @@ $progress-bar-br: 3px;
right: 0; right: 0;
} }
.progress-bar__bg-normal { .multiprogress-bar__bg-normal {
position: absolute; position: absolute;
height: inherit; height: inherit;
right: 0; right: 0;
@@ -35,14 +35,14 @@ $progress-bar-br: 3px;
width: 100%; width: 100%;
} }
.progress-bar__bg-warning { .multiprogress-bar__bg-warning {
position: absolute; position: absolute;
height: inherit; height: inherit;
right: 0; right: 0;
border-radius: 0 $progress-bar-br $progress-bar-br 0; border-radius: 0 $progress-bar-br $progress-bar-br 0;
} }
.progress-bar__bg-danger { .multiprogress-bar__bg-danger {
position: absolute; position: absolute;
height: inherit; height: inherit;
right: 0; right: 0;
@@ -23,11 +23,11 @@ export default function MultiPartProgressBar(props: MultiPartProgressBar) {
const warningWidth = clamp((warning / complete) * 100, 0, 100); const warningWidth = clamp((warning / complete) * 100, 0, 100);
return ( return (
<div className={`progress-bar ${hidden ? 'progress-bar--hidden' : ''} ${className}`}> <div className={`multiprogress-bar ${hidden ? 'multiprogress-bar--hidden' : ''} ${className}`}>
<div className='progress-bar__bg-normal' style={{ backgroundColor: normalColor }} /> <div className='multiprogress-bar__bg-normal' style={{ backgroundColor: normalColor }} />
<div className='progress-bar__bg-warning' style={{ width: `${warningWidth}%`, backgroundColor: warningColor }} /> <div className='multiprogress-bar__bg-warning' style={{ width: `${warningWidth}%`, backgroundColor: warningColor }} />
<div className='progress-bar__bg-danger' style={{ width: `${dangerWidth}%`, backgroundColor: dangerColor }} /> <div className='multiprogress-bar__bg-danger' style={{ width: `${dangerWidth}%`, backgroundColor: dangerColor }} />
<div className='progress-bar__indicator' style={{ width: `${percentComplete}%` }} /> <div className='multiprogress-bar__indicator' style={{ width: `${percentComplete}%` }} />
</div> </div>
); );
} }