Skip to content

Commit f85b75b

Browse files
committed
feat(pagination): use css variables for colors
1 parent 4512994 commit f85b75b

File tree

1 file changed

+24
-9
lines changed

1 file changed

+24
-9
lines changed

src/components/Pagination/Pagination.tsx

+24-9
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import React, { ReactNode } from 'react';
22
import styled from 'styled-components';
3-
4-
import { Colors } from '../../essentials/Colors/Colors';
53
import { Spaces } from '../../essentials/Spaces/Spaces';
64
import { BackwardIcon, BackwardLastIcon, ForwardIcon, ForwardLastIcon } from '../../icons';
75
import { Box } from '../Box/Box';
86
import { SelectList } from '../SelectList/SelectList';
7+
import { getSemanticValue } from '../../utils/cssVariables';
98

109
const Container = styled.div`
1110
text-align: center;
@@ -19,8 +18,8 @@ const ButtonsContainer = styled(Box)`
1918

2019
const IconButton = styled.button`
2120
align-items: center;
22-
background-color: ${Colors.WHITE};
23-
border: 0.0625rem solid ${Colors.AUTHENTIC_BLUE_200};
21+
background-color: ${getSemanticValue('background-primary-default')};
22+
border: 0.0625rem solid ${getSemanticValue('border-secondary-default')};
2423
border-radius: 0.25rem;
2524
display: inline-flex;
2625
height: 2.5rem;
@@ -33,7 +32,7 @@ const IconButton = styled.button`
3332
}
3433
3534
&:hover:not(:disabled) {
36-
background-color: ${Colors.AUTHENTIC_BLUE_50};
35+
background-color: ${getSemanticValue('background-secondary-default')};
3736
cursor: pointer;
3837
}
3938
`;
@@ -147,30 +146,46 @@ const Pagination: React.FC<PaginationProps> = ({
147146
<IconButton aria-label={ariaLabelFirst} disabled={isFirstPage} onClick={onSkipBackward}>
148147
<BackwardLastIcon
149148
size="small"
150-
color={isFirstPage ? Colors.AUTHENTIC_BLUE_200 : Colors.AUTHENTIC_BLUE_900}
149+
color={
150+
isFirstPage
151+
? getSemanticValue('icon-disabled-default')
152+
: getSemanticValue('icon-primary-default')
153+
}
151154
/>
152155
</IconButton>
153156
)}
154157

155158
<IconButton aria-label={ariaLabelPrevious} disabled={isFirstPage} onClick={onPrevPage}>
156159
<BackwardIcon
157160
size="small"
158-
color={isFirstPage ? Colors.AUTHENTIC_BLUE_200 : Colors.AUTHENTIC_BLUE_900}
161+
color={
162+
isFirstPage
163+
? getSemanticValue('icon-disabled-default')
164+
: getSemanticValue('icon-primary-default')
165+
}
159166
/>
160167
</IconButton>
161168

162169
<IconButton aria-label={ariaLabelNext} disabled={isLastPage} onClick={onNextPage}>
163170
<ForwardIcon
164171
size="small"
165-
color={isLastPage ? Colors.AUTHENTIC_BLUE_200 : Colors.AUTHENTIC_BLUE_900}
172+
color={
173+
isLastPage
174+
? getSemanticValue('icon-disabled-default')
175+
: getSemanticValue('icon-primary-default')
176+
}
166177
/>
167178
</IconButton>
168179

169180
{size !== 'small' && (
170181
<IconButton aria-label={ariaLabelLast} disabled={isLastPage} onClick={onSkipForward}>
171182
<ForwardLastIcon
172183
size="small"
173-
color={isLastPage ? Colors.AUTHENTIC_BLUE_200 : Colors.AUTHENTIC_BLUE_900}
184+
color={
185+
isLastPage
186+
? getSemanticValue('icon-disabled-default')
187+
: getSemanticValue('icon-primary-default')
188+
}
174189
/>
175190
</IconButton>
176191
)}

0 commit comments

Comments
 (0)