Skip to content

Commit a747344

Browse files
committed
fix(progress): fix progress bar overflow issue
1 parent 06522db commit a747344

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

src/components/Progress/Progress.js

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { forwardRef, useRef, useState, useEffect } from 'react';
22
import propTypes from 'prop-types';
33

4-
import styled from 'styled-components';
4+
import styled, { css } from 'styled-components';
55

66
import Cutout from '../Cutout/Cutout';
77
import { blockSizes } from '../common/system';
@@ -20,10 +20,18 @@ const ProgressCutout = styled(Cutout)`
2020
padding: 0;
2121
overflow: hidden;
2222
`;
23-
const WhiteBar = styled.div`
23+
const commonBarStyles = css`
2424
width: calc(100% - 4px);
25-
height: ${blockSizes.md};
26-
line-height: ${blockSizes.md};
25+
height: calc(100% - 4px);
26+
27+
display: flex;
28+
align-items: center;
29+
justify-content: space-around;
30+
`;
31+
const WhiteBar = styled.div`
32+
position: relative;
33+
top: 4px;
34+
${commonBarStyles}
2735
background: ${({ theme }) => theme.canvas};
2836
color: #000;
2937
margin-left: 2px;
@@ -33,14 +41,9 @@ const WhiteBar = styled.div`
3341

3442
const BlueBar = styled.div`
3543
position: absolute;
36-
37-
top: -2px;
44+
top: 2px;
3845
left: 2px;
39-
width: calc(100% - 4px);
40-
height: ${blockSizes.md};
41-
42-
line-height: ${blockSizes.md};
43-
46+
${commonBarStyles}
4447
color: ${({ theme }) => theme.materialTextInvert};
4548
background: ${({ theme }) => theme.progress};
4649
clip-path: polygon(

0 commit comments

Comments
 (0)