Skip to content

Commit

Permalink
Merge pull request #1106 from primer/VanAnderson/pagination-functiona…
Browse files Browse the repository at this point in the history
…l-vars

Use functional color variables in Pagination
  • Loading branch information
colebemis committed Mar 4, 2021
2 parents e492340 + 397f336 commit 5bfbfe0
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 deletions.
5 changes: 5 additions & 0 deletions .changeset/blue-spiders-pull.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/components': patch
---

Use functional color variables in Pagination
26 changes: 13 additions & 13 deletions src/Pagination/Pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,53 +11,53 @@ const Page = styled.a`
padding: 5px 10px;
font-style: normal;
line-height: 20px;
color: ${get('pagination.colors.normal.fg')};
color: ${get('colors.text.primary')};
text-align: center;
white-space: nowrap;
vertical-align: middle;
cursor: pointer;
user-select: none;
text-decoration: none;
margin-right: ${get('pagination.spaceBetween')};
margin-right: ${get('space.1')};
&:last-child {
margin-right: 0;
}
border: ${get('borderWidths.1')} solid transparent;
border-radius: ${get('pagination.borderRadius')};
border-radius: ${get('radii.2')};
transition: border-color 0.2s cubic-bezier(0.3, 0, 0.5, 1);
&:hover,
&:focus {
text-decoration: none;
border-color: ${get('pagination.colors.hover.border')};
border-color: ${get('colors.border.primary')};
outline: 0;
transition-duration: 0.1s;
}
&:active {
border-color: ${get('pagination.colors.active.border')};
border-color: ${get('colors.border.secondary')};
}
&[rel='prev'],
&[rel='next'] {
color: ${get('pagination.colors.nextPrevious.fg')};
color: ${get('colors.text.link')};
}
&[aria-current],
&[aria-current]:hover {
color: ${get('pagination.colors.selected.fg')};
background-color: ${get('pagination.colors.selected.bg')};
border-color: ${get('pagination.colors.selected.border')};
color: ${get('colors.state.selected.primaryText')};
background-color: ${get('colors.state.selected.primaryBg')};
border-color: transparent;
}
&[aria-disabled],
&[aria-disabled]:hover {
color: ${get('pagination.colors.disabled.fg')}; // check
color: ${get('colors.text.disabled')}; // check
cursor: default;
border-color: ${get('pagination.colors.disabled.border')};
border-color: transparent;
}
@supports (clip-path: polygon(50% 0, 100% 50%, 50% 100%)) {
Expand All @@ -73,7 +73,7 @@ const Page = styled.a`
// chevron-left
&[rel='prev']::before {
margin-right: ${get('pagination.spaceBetween')};
margin-right: ${get('space.1')};
clip-path: polygon(
9.8px 12.8px,
8.7px 12.8px,
Expand All @@ -89,7 +89,7 @@ const Page = styled.a`
// chevron-right
&[rel='next']::after {
margin-left: ${get('pagination.spaceBetween')};
margin-left: ${get('space.1')};
clip-path: polygon(
6.2px 3.2px,
7.3px 3.2px,
Expand Down
4 changes: 2 additions & 2 deletions src/__tests__/Pagination/__snapshots__/Pagination.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ exports[`Pagination renders consistently 1`] = `
.c2:focus {
-webkit-text-decoration: none;
text-decoration: none;
border-color: #eaecef;
border-color: #e1e4e8;
outline: 0;
-webkit-transition-duration: 0.1s;
transition-duration: 0.1s;
Expand All @@ -62,7 +62,7 @@ exports[`Pagination renders consistently 1`] = `
.c2[aria-disabled],
.c2[aria-disabled]:hover {
color: #d1d5da;
color: #959da5;
cursor: default;
border-color: transparent;
}
Expand Down

1 comment on commit 5bfbfe0

@vercel
Copy link

@vercel vercel bot commented on 5bfbfe0 Mar 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.