Originally submitted on Github
Problem/Motivation
Recent interviews and research exposed pain points around Drupal's admin experience of looking and feeling dated.

Proposed resolution
Implement new select pagination/pager styles to create a favourable first impression of Drupal for evaluators and a better user experience for site authors. No functional differences.
Specification
Quick overview
This image is just a quick overview for Pagination specs. Please use the Figma link to full specification as the main resource for specks.

Color palette
Full specification
FIGMA: https://www.figma.com/file/OqWgzAluHtsOd5uwm1lubFeH/Design-system?node-i...
This link is anchored to the board with the full specification. As an anonymous user you can see the design, but to actually be able to pick colours and sizes please login to Figma.
Remaining tasks
- Accessibility review
- RTL review (Right to left)
User interface changes
All pagination/pager styles will be changed, no functional differences.
Test Pages
/admin/content
/admin/people
(need to create enough articles/pages and users to force a pagination)

| Comment | File | Size | Author |
|---|---|---|---|
| #61 | interdiff-3023242-58-61--without-reroll.txt | 405 bytes | huzooka |
| #61 | claro-pager-3023242-61.patch | 11.92 KB | huzooka |
| #61 | Claro-pager-Edge-patch-58.png | 4.94 KB | huzooka |
| #59 | ie11-high-contrast-pager.png | 70.13 KB | zrpnr |
| #59 | ie-pager-height.png | 71 KB | zrpnr |
Comments
Comment #2
antonellasev commentedComment #3
saschaeggiNeeds final design specs
Comment #4
ckrinaComment #5
ckrinaComment #6
ckrinaComment #7
lauriiiI will work on this 🤠
Comment #8
huzookaSeven screenshot:

Test module produces this markup is here.
Comment #9
lauriiiStill missing styles for the mini pager. There's also a problem with the sizing of the page numbers since the system fonts aren't necessarily monospaced.
Comment #10
huzookaWe'll inherit margin: 0.25em 0 0.25em 1.5em; from elements.css. I don't think that we'll need the big left/right margin
We're losing space with this approach, let's change this to margin-top: 1rem, margin-bottom: 1rem;
I'd prefer margin-right: 0.25rem margin-left 0.25rem here, that's symmetrical.
Just margin-right: 0.
where is this dimension coming from?
If you add only a minimal right and left padding for page number links, most of your issues with these will gone
Space var? rem?
Pls use a variable!
Variable!
Variables!
I don't see why is this negative margin needed. Shorthand.
Variable?
Variables here!
Dont overqualify these, just use margin-right and margin-left.
If you add a common modifier for these, you will be able to manage the padding of these items separated from page number links
.pager__backelement (same for next and last links with a.pager__forward), and you'll be able to solve it byflex.to
.pager__itemsto the new
.pager__backComment #11
huzookaComment #12
huzookaPublishing the diff asked by @lauriii on slack.
I cannot see the advantages of adding SVGs to the template level. We don't have it anywhere else (inconsistency) and I'm sure that it's a bad practice for icons (but cannot remember the arguments).
Comment #13
lauriiiNext iteration. This makes the pager links 10 and above follow the style guide.
Comment #14
huzookaRe #13:
Screenshots attached.
Comment #15
mlncn commentedJust a re-roll so it applies again for the moment.
Comment #16
mlncn commentedAnd here it is with the right to left issues fixed, or at least, taking into account right to left equally as right to left.
Comment #17
mlncn commentedForgot a language-direction-specific section of the pagers.
Comment #18
mlncn commentedAnd with this patch, whitespace-only text nodes are avoided by using Twig's
{% spaceless %}. This may help address huzooka's 3, pager link margin issues on smaller screen sizes, but i'm not sure.This looks good to me now (and it's the last i'll have a chance to work on it for a while, so i hope it's useful). Thanks all for the work on Claro!
Comment #19
kostyashupenko#18 patch looks good for me. Just 1 notice: look at my screen, on mobile resolution focus styles of one element are overlapping another, looks like not enough margin between elements ?
Comment #20
Kami Amiga commentedMaybe we should use var(-space-xs) which is 8px instead
= outline: unset maybe ?
Comment #21
huzookaRe #18:
This is still wrong, issues highlighted in #14 aren't addressed yet.
Screenshots attached.
P.s: Please, do not add these icons by the template!
Comment #22
kostyashupenkoComment #23
kostyashupenkoWhat was done:
1. first, previous, next, last icons were recreated with Adobe Ii, because previous icons had some issues with alignment (never use "stroke" attributes in svg icons !!!!)
2. removed inline svg from template and recreated with css
3. improved rtl support.
4. cleanup.
Comment #24
kostyashupenkoComment #25
lauriiiIt seems like #14 has been solved by #23.
I did find another problem. Our default views configurations adds extra arrows in the link text configuration:
Maybe we could use a Twig filter to remove the arrows in the template from the text?
Comment #26
kostyashupenkoComment #27
jds1Removed the arrows with a twig filter in pager.html.twig. Patch + interdiff attached.
Comment #28
imalabyaShouldn't this be moved to the `variable.css` file?
Comment #29
imalabyaAdded a patch which moved the variables of pager from
pager.csstovariables.cssComment #30
finnsky commented1. --color-focus should be --color-green and moved to Base variables section


2. found problem with margin of all pager. what gives problem on mobile
Comment #31
finnsky commentedi have suggestion to override margins-shadows policy. to cover design

Comment #32
finnsky commentedand remove them from list items.
Comment #33
finnsky commentedmini pager has own template

Comment #34
finnsky commentedalso fixed ellipsis in case of "Number of pager links visible" option setted to small number.
Comment #35
lauriiiWe should manually test all different views core provides in Standard installation since this is affected by configuration. We should also provide screenshots for the mini pager. We should also followup issue for updating the mini pager after the styleguide has been updated.
Comment #36
brightbold@lauriii identified the following core modules that are not enabled by default but which contain views that should also be tested:
Migration groups also can show a pager, but it looks like that page isn't technically a view? I'd think we should include that as well, however.
Comment #37
lauriiiI confirmed manually that the pager configuration is the same in all views in core. Pager configuration is consistent across views in core, so testing on the content page is enough.
The mini pager looks fine, but we could probably do better so I opened a follow-up to make improvements to that.

I also rerolled the patch.
Comment #38
lauriiiComment #39
bnjmnmEverything spotted is using the /pager path via the helper module mentioned earlier in this issue
.pager__link.is-activetakes precedence over.pager__link.is-activeWill return to this later in the week to review the code itself, but wanted to provide a little bit of time to potentially address the issues I found during cross browser testing.
Comment #40
bnjmnmComment #41
bnjmnmThis addresses the items I found in #39
#39.1 The previously-not-happening hover behavior with the current item now matches hover behavior of any pager items. There's currently nothing in Figma for this state, but can be updated fairly easily to accommodate any design updates. Since it's still a link (even if it goes to the same page), it should get the same visual treatment as its siblings.
#39.2 Moved the icon positions to match Figma
#39.3 Added two high-contrast-mode specific styles. Hovering over links in the pager underlines them, since the background-color effect is not visible. The current item is circled as seen in the screenshot (the focus ring in high contrast mode is a dashed square, so this won't overlap with this)

#39.4 Fixed this by adding display:block; to the row separator in
.pager__items::beforeAlso ran into a tab order issue similar to the one reported in #3053457: Flex order breaks tabbing order on tabs . On narrow viewports, the First/Previous/Next/Last items are positioned below the page numbers, but the tab order continues to be First > Previous > page numbers > Next > Last, so tabbing away from Previous can be confusing because it jumps up a line to go to the page numbers. It does not compromise tab navigation as much as the scenario described in 3053457, the items can still be accessed. Not sure at the moment if it merits a separate followup issue or perhaps this is acceptable behavior?
Comment #42
lauriiiThe difference between tabbing order and visual order could create confusion with users with low vision users. I think it would be a good idea to open a follow-up for that.
We should open a follow-up in the core queue to figure out what to do for this.
Comment #43
lauriiiIt seems like the arrow isn't positioned correctly on RTL.
Comment #44
bnjmnmComment #45
bnjmnm#42 Opened #3053752: Flex order breaks pager tab order for the tab order issue, and #3053707: Pager arrows should be easier to override in themes for the views pager arrows issue. Added a @todo to that issue in pager.html.twig
#43 The RTL arrow alignment is addressed

Comment #46
bnjmnm@lauriii pointed out that the relative positioning solution for aligning the arrows may not be ideal. To truly vertically center them, I think an approach like the details triangle alignment in #3038784: Details style update will be needed, where the SVG is the background in an absolutely positioned :before selector. This would require many more css rules, but the arrows would be truly vertically centered and would not require pushing pixels to accommodate RTL and LTR. Wouldn't be able to get to this for a bit anyway, so commenting here to see if anyone else has thoughts.
Comment #47
zrpnrI followed @bnjmnm suggestion to make the svg a background-image instead of content. I gave the icons an arbitrary height of 1rem which was slightly bigger than the svg, and centered the background.
Flexbox seemed like a good solution for centering everything vertically.
The other issue with RTL I think was rotation, the icons were not perfectly symmetrical in that direction but scaleX looks a little better, I attached a screenshot for reference.
Comment #48
lauriiiBackground images are not visible in high contrast mode but I think it might be fine in this case because the icons act just as complementary information.
I updated the icons to the most recent versions from Figma.
Comment #49
huzookaI'm reviewing this
Comment #50
huzookaWhen I just tried to get the Figma it turned out that the mobile design changed and it does not show action link labels (first, previous, next, last) anymore — we aggreed on that we should drop the current flex-order tricks and focus on the wide design (it's really close).
I'd remove these rules. This assumes that all of the items are rendered in the same row, but that is not true for narrow browser viewport sizes (or when there are a lot of page numbers displayed)
Comment #51
bnjmnmComment #52
bnjmnmPer #50, the
order:css is removed. as well as the left/right margins for .pager__itemAlso removed this rule
Since the r/l margins for .pager__items are both 0 already.
Comment #53
bnjmnmComment #54
huzookaI assume this was removed accidentally.
Visual remove in progress.
Comment #55
huzookaComment #56
huzookaComment #57
huzookaEdge high contrast: active pager item has a border issue:
Comment #58
lauriiiThis should address #57.
Comment #59
zrpnrI tested with the patch in #58 and then changed back
heighttoline-heightto try and see this bug in high contrast mode, I didn't see the "gaps" but it is more circular now.I liked it better with the flex order putting the next/prev at the end, but I understand why it changed with the need to wrap to multiple lines. Removing the extra margin makes sense.
If the high contrast issue was the last part I think this is RTBC unless @huzooka is still seeing a problem.
Comment #60
huzookaComment #61
huzookaRe #58:
I had to put back

line-heightfor Edge because it still had the broken border in high contrast mode:Comment #62
lauriiiLooks good! I think this is ready.
Comment #64
huzookaThank you everyone! 🎉
Comment #67
lauriii