-
Notifications
You must be signed in to change notification settings - Fork 620
chore(DataTable.Pagination): Convert DataTable.Pagination to CSS modules #6273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
ed7c805
Convert DataTable.Pagination to CSS modules
jonrohan a9015bc
Create polite-pandas-tie.md
jonrohan 2c1d39a
Disabling lint errors
jonrohan 478a7b8
change to minor
jonrohan 7b856af
Update packages/react/src/internal/components/ButtonReset.tsx
jonrohan f1d0489
Update ButtonReset.tsx
jonrohan 010dd86
Update ButtonReset.tsx
jonrohan 421bad1
Merge branch 'main' into css_modules_datatable_pagination
jonrohan 90e70cc
Merge branch 'main' into css_modules_datatable_pagination
primer[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@primer/react": minor | ||
--- | ||
|
||
chore(DataTable.Pagination): Convert DataTable.Pagination to CSS modules |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
.TablePagination { | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
column-gap: 1rem; | ||
width: 100%; | ||
grid-area: footer; | ||
padding: var(--base-size-8) var(--base-size-16); | ||
border: var(--borderWidth-thin) solid var(--borderColor-default); | ||
border-top-width: 0; | ||
border-end-start-radius: var(--borderRadius-medium); | ||
border-end-end-radius: var(--borderRadius-medium); | ||
} | ||
|
||
@media ((max-width: calc(768px - 0.02px))) { | ||
.TablePaginationSteps[data-hidden-viewport-ranges*='narrow'] > *:not(:first-child):not(:last-child) { | ||
display: none; | ||
} | ||
|
||
.TablePaginationSteps[data-hidden-viewport-ranges*='narrow'] > *:first-child { | ||
margin-inline-end: 0; | ||
} | ||
|
||
.TablePaginationSteps[data-hidden-viewport-ranges*='narrow'] > *:last-child { | ||
margin-inline-start: 0; | ||
} | ||
} | ||
|
||
@media ((min-width: 768px)) { | ||
.TablePaginationSteps[data-hidden-viewport-ranges*='regular'] > *:not(:first-child):not(:last-child) { | ||
display: none; | ||
} | ||
|
||
.TablePaginationSteps[data-hidden-viewport-ranges*='regular'] > *:first-child { | ||
margin-inline-end: 0; | ||
} | ||
|
||
.TablePaginationSteps[data-hidden-viewport-ranges*='regular'] > *:last-child { | ||
margin-inline-start: 0; | ||
} | ||
} | ||
|
||
@media ((min-width: 1400px)) { | ||
.TablePaginationSteps[data-hidden-viewport-ranges*='wide'] > *:not(:first-child):not(:last-child) { | ||
display: none; | ||
} | ||
|
||
.TablePaginationSteps[data-hidden-viewport-ranges*='wide'] > *:first-child { | ||
margin-inline-end: 0; | ||
} | ||
|
||
.TablePaginationSteps[data-hidden-viewport-ranges*='wide'] > *:last-child { | ||
margin-inline-start: 0; | ||
} | ||
} | ||
|
||
.TablePaginationRange { | ||
color: var(--fgColor-muted); | ||
font-size: var(--text-body-size-small); | ||
margin: 0; | ||
} | ||
|
||
.TablePaginationSteps { | ||
display: flex; | ||
align-items: center; | ||
flex-wrap: wrap; | ||
list-style: none; | ||
color: var(--fgColor-default); | ||
font-size: var(--text-body-size-medium); | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
.TablePaginationStep:first-of-type { | ||
margin-right: var(--base-size-16); | ||
} | ||
|
||
.TablePaginationStep:last-of-type { | ||
margin-left: var(--base-size-16); | ||
} | ||
|
||
.TablePaginationAction { | ||
display: flex; | ||
align-items: center; | ||
color: var(--fgColor-muted); | ||
font-size: var(--text-body-size-medium); | ||
/* stylelint-disable-next-line primer/typography */ | ||
line-height: calc(20 / 14); | ||
user-select: none; | ||
padding: var(--base-size-8); | ||
border-radius: var(--borderRadius-medium); | ||
} | ||
|
||
.TablePaginationAction[data-has-page] { | ||
color: var(--fgColor-accent); | ||
} | ||
|
||
.TablePaginationPage { | ||
min-width: 2rem; | ||
min-height: 2rem; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
font-size: var(--text-body-size-medium); | ||
/* stylelint-disable-next-line primer/typography */ | ||
line-height: calc(20 / 14); | ||
user-select: none; | ||
border-radius: var(--borderRadius-medium); | ||
padding: var(--base-size-8) calc((var(--base-size-32) - var(--base-size-20)) / 2); /* primer.control.medium.paddingInline.condensed primer.control.medium.paddingBlock */ | ||
} | ||
|
||
.TablePaginationAction[data-has-page]:hover, | ||
.TablePaginationAction[data-has-page]:focus, | ||
.TablePaginationPage:hover, | ||
.TablePaginationPage:focus { | ||
background-color: var(--control-transparent-bgColor-hover); | ||
} | ||
|
||
.TablePaginationPage[data-active='true'] { | ||
background-color: var(--bgColor-accent-emphasis); | ||
color: var(--fgColor-onEmphasis); | ||
} | ||
|
||
.TablePaginationPage[data-active='true']:focus-visible { | ||
outline: 2px solid var(--bgColor-accent-emphasis); | ||
outline-offset: -2px; | ||
/* stylelint-disable-next-line primer/box-shadow */ | ||
box-shadow: inset 0 0 0 3px var(--fgColor-onEmphasis); | ||
} | ||
|
||
.TablePaginationTruncationStep { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
min-width: 2rem; | ||
min-height: 2rem; | ||
user-select: none; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
packages/react/src/internal/components/ButtonReset.module.css
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.ButtonReset { | ||
margin: 0; | ||
display: inline-flex; | ||
padding: 0; | ||
border: 0; | ||
appearance: none; | ||
background: none; | ||
cursor: pointer; | ||
text-align: start; | ||
font: inherit; | ||
color: inherit; | ||
align-items: center; | ||
|
||
&::-moz-focus-inner { | ||
border: 0; | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Completely separate from the refactor, would this be something we would ever want a container query for now that we can use them or is this best tied to the viewport range? (Was just curious)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I think this was a bit verbose and would love either media query variables here or container queries.