mirror of
https://github.com/primer/css.git
synced 2024-11-25 18:26:14 +03:00
Make pagination
responsive by default (#1894)
* Make pagination responsive by default * Lint * Create swift-actors-drum.md * Remove duplicate selector * Remove initial display This was overridden before with the `.page-responsive .pagination` selector
This commit is contained in:
parent
68adc95940
commit
d1adf59530
5
.changeset/swift-actors-drum.md
Normal file
5
.changeset/swift-actors-drum.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"@primer/css": patch
|
||||
---
|
||||
|
||||
Make `pagination` responsive by default
|
@ -4,7 +4,6 @@
|
||||
a,
|
||||
span,
|
||||
em {
|
||||
display: inline-block;
|
||||
min-width: 32px;
|
||||
// stylelint-disable-next-line primer/spacing
|
||||
padding: 5px 10px;
|
||||
@ -84,6 +83,44 @@
|
||||
clip-path: polygon(6.2px 3.2px, 7.3px 3.2px, 11.5px 7.5px, 11.5px 8.5px, 7.3px 12.8px, 6.2px 11.7px, 9.9px 8px, 6.2px 4.3px, 6.2px 3.2px);
|
||||
}
|
||||
}
|
||||
|
||||
// Responsive
|
||||
|
||||
// Hide everything by default
|
||||
> * {
|
||||
display: none;
|
||||
}
|
||||
|
||||
// 0 -> sm
|
||||
// Only show [Previous] [Next]
|
||||
|
||||
> :first-child,
|
||||
> :last-child,
|
||||
> .previous_page,
|
||||
> .next_page {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
// sm -> md
|
||||
// Also show [first] [last] [current number] and [...]
|
||||
|
||||
@include breakpoint(sm) {
|
||||
> :nth-child(2),
|
||||
> :nth-last-child(2),
|
||||
> .current,
|
||||
> .gap {
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
|
||||
// md -> or more
|
||||
// Show everything
|
||||
|
||||
@include breakpoint(md) {
|
||||
> * {
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Unified centered pagination across the site
|
||||
|
Loading…
Reference in New Issue
Block a user