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.
Pager quick specification
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)

CommentFileSizeAuthor
#61 interdiff-3023242-58-61--without-reroll.txt405 byteshuzooka
#61 claro-pager-3023242-61.patch11.92 KBhuzooka
#61 Claro-pager-Edge-patch-58.png4.94 KBhuzooka
#59 ie11-high-contrast-pager.png70.13 KBzrpnr
#59 ie-pager-height.png71 KBzrpnr
#58 interdiff.txt477 byteslauriii
#58 claro-pager-3023242-58.patch11.89 KBlauriii
#57 Screenshot 2019-05-13 at 16.43.56.png29.9 KBhuzooka
#56 interdiff-3023242-52-56.txt354 byteshuzooka
#56 claro-pager-3023242-56.patch11.9 KBhuzooka
#52 3023242-52.patch11.88 KBbnjmnm
#52 interdiff_48-52.txt1.34 KBbnjmnm
#48 interdiff.txt2.66 KBlauriii
#48 claro-pager-3023242-48.patch12.48 KBlauriii
#47 pagination-icon-center.png112.96 KBzrpnr
#47 interdiff-45-47.txt3.78 KBzrpnr
#47 3023242-47.patch12.6 KBzrpnr
#45 3023242-45.patch12.45 KBbnjmnm
#45 interdiff_41-45.txt1.17 KBbnjmnm
#45 rtl-arrow.png37.89 KBbnjmnm
#43 Screen Shot 2019-05-09 at 20.51.59.png4.34 KBlauriii
#41 high-contrast-pager.png70.23 KBbnjmnm
#41 claro-pager-3023242-41.patch12.24 KBbnjmnm
#41 interdiff_37-41.txt1.13 KBbnjmnm
#39 rtl-pager.gif103.21 KBbnjmnm
#39 ie11-middle-page.png85.1 KBbnjmnm
#39 last-arrow-css.png9.76 KBbnjmnm
#39 last-arrow-figma.png7.83 KBbnjmnm
#37 claro-pager-3023242-37.patch11.95 KBlauriii
#37 Screen Shot 2019-04-19 at 15.05.40.png4.54 KBlauriii
#34 interdiff-29--34.txt5.57 KBfinnsky
#34 3023242-34.patch14.31 KBfinnsky
#34 elliipsis.png16.23 KBfinnsky
#33 mini.png14.31 KBfinnsky
#31 suggestion.png114.5 KBfinnsky
#30 mobilecollision.png27.63 KBfinnsky
#30 wrongmargin.png19.9 KBfinnsky
#29 interdiff-27-29.txt1.5 KBimalabya
#29 claro-pager-3023242-29.patch12.4 KBimalabya
#27 interdiff_23-27.txt2.11 KBjds1
#27 3023242-remove-extra-arrows-27.patch12.23 KBjds1
#25 Screen Shot 2019-04-03 at 00.49.05.png4.92 KBlauriii
#25 Screen Shot 2019-04-03 at 00.49.00.png21.67 KBlauriii
#23 interdiff_18-23.txt7.63 KBkostyashupenko
#23 3023242-23.patch12.15 KBkostyashupenko
#21 09--Pager--Android--Chrome--he--merged.png58.16 KBhuzooka
#21 01--Pager--macOS--Safari--he--merged.png55.46 KBhuzooka
#21 Pager-icon-3.png22.3 KBhuzooka
#21 Pager-icon-2.png20.55 KBhuzooka
#21 Pager-icon-1.png23.64 KBhuzooka
#19 Снимок экрана 2019-03-25 в 15.01.48.png72.11 KBkostyashupenko
#18 3023242-18.patch11.37 KBmlncn
#17 3023242-17.patch11.1 KBmlncn
#16 3023242-16.patch10.91 KBmlncn
#15 3023242-15.patch10.65 KBmlncn
#14 Screenshot 2019-03-05 at 11.27.20.png120.11 KBhuzooka
#14 Screenshot 2019-03-05 at 11.06.40.png182.27 KBhuzooka
#13 interdiff.txt2.06 KBlauriii
#13 3023242-13.patch10.64 KBlauriii
#12 interdiff-3023242-9-12.txt7.78 KBhuzooka
#12 claro-pager-3023242-12.patch11.2 KBhuzooka
#9 3023242-9.patch8.79 KBlauriii
#8 Pagers-screenshot-Seven.png104.73 KBhuzooka
#4 pager.png30.82 KBckrina
#4 old-pager.png12.74 KBckrina

Comments

antonellasev created an issue. See original summary.

antonellasev’s picture

Issue summary: View changes
saschaeggi’s picture

Version: » 8.x-1.x-dev
Status: Active » Postponed

Needs final design specs

ckrina’s picture

Issue summary: View changes
StatusFileSize
new12.74 KB
new30.82 KB
ckrina’s picture

Issue summary: View changes
Status: Postponed » Active
ckrina’s picture

Issue summary: View changes
lauriii’s picture

Assigned: Unassigned » lauriii

I will work on this 🤠

huzooka’s picture

StatusFileSize
new104.73 KB

Seven screenshot:
Pagers in Seven theme

Test module produces this markup is here.

lauriii’s picture

Status: Active » Needs review
StatusFileSize
new8.79 KB

Still 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.

huzooka’s picture

Status: Needs review » Needs work
  1. +++ b/css/src/components/pager.css
    @@ -2,44 +2,63 @@
    -  margin: 0.25em 0 0.25em 1.5em; /* LTR */
    

    We'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

  2. +++ b/css/src/components/pager.css
    @@ -2,44 +2,63 @@
    +  margin: 1rem;
    

    We're losing space with this approach, let's change this to margin-top: 1rem, margin-bottom: 1rem;

  3. +++ b/css/src/components/pager.css
    @@ -2,44 +2,63 @@
    +  margin: 0 0.5rem 0 0;
    

    I'd prefer margin-right: 0.25rem margin-left 0.25rem here, that's symmetrical.

  4. +++ b/css/src/components/pager.css
    @@ -2,44 +2,63 @@
       margin: 0;
    

    Just margin-right: 0.

  5. +++ b/css/src/components/pager.css
    @@ -2,44 +2,63 @@
    +  border-radius: 38px;
    

    where is this dimension coming from?

  6. +++ b/css/src/components/pager.css
    @@ -2,44 +2,63 @@
    +  padding: 0.30rem 0.75rem;
    

    If you add only a minimal right and left padding for page number links, most of your issues with these will gone

  7. +++ b/css/src/components/pager.css
    @@ -2,44 +2,63 @@
    +  min-width: 32px;
    

    Space var? rem?

  8. +++ b/css/src/components/pager.css
    @@ -2,44 +2,63 @@
    +  box-shadow: 0 0 0 3px #26A769;
    

    Pls use a variable!

  9. +++ b/css/src/components/pager.css
    @@ -2,44 +2,63 @@
    +  background: #E6ECF8;
    

    Variable!

  10. +++ b/css/src/components/pager.css
    @@ -2,44 +2,63 @@
    +  border: 2px solid #fff;
    

    Variables!

  11. +++ b/css/src/components/pager.css
    @@ -2,44 +2,63 @@
    +  margin: -2px -2px;
    

    I don't see why is this negative margin needed. Shorthand.

  12. +++ b/css/src/components/pager.css
    @@ -2,44 +2,63 @@
    +  border-radius: 2px;
    

    Variable?

  13. +++ b/css/src/components/pager.css
    @@ -2,44 +2,63 @@
    +  background: #0048DC;
    +  color: #fff;
    

    Variables here!

  14. +++ b/css/src/components/pager.css
    @@ -2,44 +2,63 @@
    +  margin: 0 0.5rem 0 0;
    ...
    +  margin: 0 0 0 0.5rem;
    

    Dont overqualify these, just use margin-right and margin-left.

  15. +++ b/templates/pager.html.twig
    @@ -0,0 +1,119 @@
    +        <li class="pager__item pager__item--first">
    ...
    +        <li class="pager__item pager__item--previous">
    ...
    +        <li class="pager__item pager__item--next">
    ...
    +        <li class="pager__item pager__item--first">
    

    If you add a common modifier for these, you will be able to manage the padding of these items separated from page number links

  16. The two-row design of narrow screen sizes is completely missing. Suggestion: wrap first prev into a .pager__back element (same for next and last links with a .pager__forward), and you'll be able to solve it by flex.
    • Add
          display: flex;
          flex-wrap: wrap;
          justify-content: center;

      to .pager__items

    • add
          order: 1;
          width: 50%;
          justify-content: flex-end; // flex-start for .pager__forward
          display: flex;

      to the new .pager__back

huzooka’s picture

Assigned: lauriii » huzooka
huzooka’s picture

Assigned: huzooka » Unassigned
StatusFileSize
new11.2 KB
new7.78 KB

Publishing 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).

lauriii’s picture

Status: Needs work » Needs review
StatusFileSize
new10.64 KB
new2.06 KB

Next iteration. This makes the pager links 10 and above follow the style guide.

huzooka’s picture

Status: Needs review » Needs work
StatusFileSize
new182.27 KB
new120.11 KB

Re #13:

  1. RTL pagers aren't aligned exactly to center
  2. RTL arrow icons needs work (I'm sure that we shouldn't add icons to the template and this is a good example why not to do that)
  3. first/prev/next/last pager links have margin issues on lower screen sizes

Screenshots attached.

mlncn’s picture

StatusFileSize
new10.65 KB

Just a re-roll so it applies again for the moment.

mlncn’s picture

StatusFileSize
new10.91 KB

And here it is with the right to left issues fixed, or at least, taking into account right to left equally as right to left.

mlncn’s picture

StatusFileSize
new11.1 KB

Forgot a language-direction-specific section of the pagers.

mlncn’s picture

Status: Needs work » Needs review
StatusFileSize
new11.37 KB

And 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!

kostyashupenko’s picture

#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 ?

Kami Amiga’s picture

  1. +++ b/css/src/components/pager.css
    @@ -2,44 +2,107 @@
    +  padding-right: 9px;
    +  padding-left: 9px;
    

    Maybe we should use var(-space-xs) which is 8px instead

  2. +++ b/css/src/components/pager.css
    @@ -2,44 +2,107 @@
    +  outline: 1px dotted transparent;
    

    = outline: unset maybe ?

huzooka’s picture

Status: Needs review » Needs work
StatusFileSize
new23.64 KB
new20.55 KB
new22.3 KB
new55.46 KB
new58.16 KB

Re #18:

This is still wrong, issues highlighted in #14 aren't addressed yet.

  1. RTL pagers aren't aligned exactly to center
  2. RTL arrow icons are still wrong
  3. first/prev/next/last pager links have margin issues on lower screen sizes
  4. Canvas of the SVG icons isn't sized properly.

Screenshots attached.

P.s: Please, do not add these icons by the template!

kostyashupenko’s picture

Assigned: Unassigned » kostyashupenko
kostyashupenko’s picture

Status: Needs work » Needs review
StatusFileSize
new12.15 KB
new7.63 KB

What 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.

kostyashupenko’s picture

Assigned: kostyashupenko » Unassigned
lauriii’s picture

Issue summary: View changes
Status: Needs review » Needs work
StatusFileSize
new21.67 KB
new4.92 KB

It 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?

kostyashupenko’s picture

Status: Needs work » Needs review
Issue tags: +Needs issue summary update
jds1’s picture

StatusFileSize
new12.23 KB
new2.11 KB

Removed the arrows with a twig filter in pager.html.twig. Patch + interdiff attached.

imalabya’s picture

Status: Needs review » Needs work
+++ b/css/src/components/pager.css
@@ -2,44 +2,143 @@
+/**
+ * Vars.
+ */
+:root {
+  --pager-size: 2rem; /* --space-m × 2 */
+  --pager-border-width: 0.125rem; /* 2px */
+  --pager-fg: var(--color-davysgrey);
+  --pager-bg: var(--color-white);
+  --pager-bg--hover: var(--color-bgblue-active);
+  --pager-bg--focus: var(--color-focus);
+  --pager-fg--active: var(--color-white);
+  --pager-bg--active: var(--color-absolutezero);
+  --pager-action-border-radius: var(--pager-border-width);
+}

Shouldn't this be moved to the `variable.css` file?

imalabya’s picture

Status: Needs work » Needs review
StatusFileSize
new12.4 KB
new1.5 KB

Added a patch which moved the variables of pager from pager.css to variables.css

finnsky’s picture

Assigned: Unassigned » finnsky
Status: Needs review » Needs work
StatusFileSize
new19.9 KB
new27.63 KB

1. --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
wrong margin
mobile collision

finnsky’s picture

StatusFileSize
new114.5 KB

i have suggestion to override margins-shadows policy. to cover design
suggestion

finnsky’s picture

and remove them from list items.

finnsky’s picture

StatusFileSize
new14.31 KB

mini pager has own template
mini

finnsky’s picture

Assigned: finnsky » Unassigned
Status: Needs work » Needs review
StatusFileSize
new16.23 KB
new14.31 KB
new5.57 KB

also fixed ellipsis in case of "Number of pager links visible" option setted to small number.

ellipsis

lauriii’s picture

We 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.

brightbold’s picture

@lauriii identified the following core modules that are not enabled by default but which contain views that should also be tested:

  • Aggregator
  • Content Moderation (requires Workflows)
  • Media
  • Media library

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.

lauriii’s picture

Issue summary: View changes
Issue tags: -Needs manual testing, -Needs followup
Related issues: +#3049321: Mini pager
StatusFileSize
new4.54 KB
new11.95 KB

I 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.

lauriii’s picture

Issue tags: +alpha target
bnjmnm’s picture

Status: Needs review » Needs work
StatusFileSize
new7.83 KB
new9.76 KB
new85.1 KB
new103.21 KB

Everything spotted is using the /pager path via the helper module mentioned earlier in this issue

  1. When the current item is hovered over, there are no visual changes other than the pointer changing. I suspect the intent is to have it match the hover behavior of not-current items, but .pager__link.is-active takes precedence over .pager__link.is-active
  2. The alignment of the first/last/prev/next SVGs does not match the comps in Figma. While this observation might seem pixel-pedantic, I think it would impact first impressions enough to be worth doing.

  3. In IE11 high-contrast mode, current items have no visual distinction and hovered-over items are only differentiated by the mouse pointer changing.
  4. In IE11, the First/Prev/Next/Last links all appear after the page numbers instead of the expected First/Prev appearing on the left.
  5. Reviewed RTL by installing Hebrew. Everything seems fine and matches the behavior of RTL pagers on Bartik, but to be on the safe side (I don't work with RTL often) I'm providing screenshots in different use cases.

Will 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.

bnjmnm’s picture

Assigned: Unassigned » bnjmnm
bnjmnm’s picture

Assigned: bnjmnm » Unassigned
Status: Needs work » Needs review
StatusFileSize
new1.13 KB
new12.24 KB
new70.23 KB

This 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::before

Also 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?

lauriii’s picture

The 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.

+++ b/templates/pager.html.twig
@@ -0,0 +1,123 @@
+              {{- items.last.text|default('Last'|t)|replace({'»': ''}) -}}

We should open a follow-up in the core queue to figure out what to do for this.

lauriii’s picture

Issue summary: View changes
Status: Needs review » Needs work
StatusFileSize
new4.34 KB

It seems like the arrow isn't positioned correctly on RTL.

bnjmnm’s picture

Assigned: Unassigned » bnjmnm
bnjmnm’s picture

Assigned: bnjmnm » Unassigned
Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new37.89 KB
new1.17 KB
new12.45 KB

#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

bnjmnm’s picture

@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.

zrpnr’s picture

StatusFileSize
new12.6 KB
new3.78 KB
new112.96 KB

I 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.

lauriii’s picture

StatusFileSize
new12.48 KB
new2.66 KB

Background 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.

huzooka’s picture

I'm reviewing this

huzooka’s picture

Status: Needs review » Needs work

When 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).

huzooka [3:31 PM]
mobile does not show action labels anymore
(first-prev-next-last)

lauriii [3:32 PM]
I think it has been changed since we first implemented the designs

huzooka [3:34 PM]
I'm sure that until March it did

lauriii [3:34 PM]
But I don’t think we should implement the simple version at least yet
it could have it’s own problems because of views configurations
I think it should be done in a follow-up

huzooka [3:35 PM]
than we should drop the flex-order thing
that only adds problems
+++ b/css/src/components/pager.css
@@ -2,44 +2,144 @@
+.pager__item:first-child {
+  margin-left: 0; /* LTR */
+}
+[dir="rtl"] .pager__item:first-child {
+  margin-left: calc(var(--space-xs) / 2);
+  margin-right: 0;
+}
+.pager__item:last-child {
+  margin-right: 0; /* LTR */
+}
+[dir="rtl"] .pager__item:last-child {
+  margin-right: calc(var(--space-xs) / 2);
+  margin-left: 0;
+}

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)

bnjmnm’s picture

Assigned: Unassigned » bnjmnm
bnjmnm’s picture

Status: Needs work » Needs review
StatusFileSize
new1.34 KB
new11.88 KB

Per #50, the order: css is removed. as well as the left/right margins for .pager__item

Also removed this rule

[dir="rtl"] .pager__items {
  margin-right: 0;
}

Since the r/l margins for .pager__items are both 0 already.

bnjmnm’s picture

Assigned: bnjmnm » Unassigned
huzooka’s picture

Status: Needs review » Needs work
+++ b/css/src/components/pager.css
@@ -99,7 +72,6 @@
-  height: 1rem;

I assume this was removed accidentally.

Visual remove in progress.

huzooka’s picture

Assigned: Unassigned » huzooka
huzooka’s picture

Assigned: huzooka » Unassigned
Status: Needs work » Needs review
StatusFileSize
new11.9 KB
new354 bytes
huzooka’s picture

Status: Needs review » Needs work
StatusFileSize
new29.9 KB

Edge high contrast: active pager item has a border issue:

lauriii’s picture

Status: Needs work » Needs review
StatusFileSize
new11.89 KB
new477 bytes

This should address #57.

zrpnr’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new71 KB
new70.13 KB

I tested with the patch in #58 and then changed back height to line-height to 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.

huzooka’s picture

Assigned: Unassigned » huzooka
Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs reroll
huzooka’s picture

Assigned: huzooka » Unassigned
Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new4.94 KB
new11.92 KB
new405 bytes

Re #58:

I had to put back line-height for Edge because it still had the broken border in high contrast mode:
Claro pager on high-contrast Edge with patch from #58

lauriii’s picture

Status: Needs review » Reviewed & tested by the community

Looks good! I think this is ready.

  • huzooka committed ac60cf0 on 8.x-1.x
    Issue #3023242 by lauriii, mlncn, huzooka, bnjmnm, finnsky, zrpnr,...
huzooka’s picture

Status: Reviewed & tested by the community » Fixed

Thank you everyone! 🎉

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

lauriii’s picture