Replace these icons with the Libricon SVGs and use CSS to apply the image instead of an inline <img> tag

See: #1356602: [META] Clean up icons in misc

Remaining Tasks

Contributor tasks needed
Task Novice task? Contributor instructions Complete?
(Done-Comment #99, needs review) Draft a change record for the API changes Instructions
Update the patch to incorporate feedback from reviews (include an interdiff) Instructions

Before and after screenshots:

This issue improving the arrow display--using SVGs in place of PNGs, which takes care of poor quality on high-quality displays. Aside from a slight change in the sizing of the arrows, the before and after should appear to be the same. Please see comment #97 to see all the screen images.

Seven (Administrative Theme)
Up Arrow Before

Up Arrow After

Down Arrow Before

Down Arrow After

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Task because it's code cleanup
Unfrozen changes Unfrozen because it only changes HTML/CSS

CommentFileSizeAuthor
#127 replace_arrow_asc_and-2405057-127.patch11.87 KBnlisgo
#126 Screenshot 2015-09-19 02.29.04.jpg720.62 KBlewisnyman
#125 replace_arrow_asc_and-2405057-125.patch6.68 KBmadhavvyas
#124 replace_arrow_asc_and-2405057-124.patch5.22 KBmadhavvyas
#121 replace_arrow_asc_and-2405057-121.patch4.59 KBmadhavvyas
#113 Screen_Shot_2015-09-04_at_09_51_52.png4.06 KBemma.maria
#113 Screen_Shot_2015-09-04_at_09_51_46.png3.58 KBemma.maria
#111 replace_arrow_asc_and-2405057-111.patch12.32 KBavitslv
#111 bartik_arrow_desc.jpg31.56 KBavitslv
#108 bartik-after.jpg195.09 KBavitslv
#108 replace_arrow_asc_and-2405057-108.patch17.68 KBavitslv
#105 replace_arrow_asc_and-2405057-105.patch11.01 KBjoelpittet
#97 Stark-UpArrow-Before.png7.49 KBkarolus
#97 Stark-UpArrow-After.png7.58 KBkarolus
#97 Stark-DownArrow-Before.png7.51 KBkarolus
#97 Stark-DownArrow-After.png7.59 KBkarolus
#97 Seven-UpArrow-Before.png145.78 KBkarolus
#97 Seven-UpArrow-After.png145.87 KBkarolus
#97 Seven-DownArrow-Before.png126.27 KBkarolus
#97 Seven-DownArrow-After.png126.54 KBkarolus
#97 Classy-UpArrow-Before.png7.6 KBkarolus
#97 Classy-UpArrow-After.png7.53 KBkarolus
#97 Classy-DownArrow-Before.png7.45 KBkarolus
#97 Classy-DownArrow-After.png7.59 KBkarolus
#97 Bartik-UpArrow-Before.png7.41 KBkarolus
#97 Bartik-UpArrow-After.png7.57 KBkarolus
#97 Bartik-DownArrow-Before.png7.42 KBkarolus
#97 Bartik-DownArrow-After.png7.43 KBkarolus
#94 Seven-UpArrow-Before.png145.78 KBkarolus
#94 Seven-UpArrow-After.png145.87 KBkarolus
#94 Seven-DownArrow-Before.png126.27 KBkarolus
#94 Seven-DownArrow-After.png126.54 KBkarolus
#93 Bartik-ArrowDisappearing.png142.5 KBkarolus
#92 DownArrow-After.png115.16 KBkarolus
#92 DownArrow-Before.png116.71 KBkarolus
#92 UpArrow-After.png134.98 KBkarolus
#92 UpArrow-Before.png139.2 KBkarolus
#90 replace_arrow_asc_and-2405057-90.patch9.82 KBwmortada
#81 Screen Shot 2015-05-10 at 17.04.46.jpg10.4 KBlewisnyman
#81 Screen Shot 2015-05-10 at 17.04.41.jpg9.97 KBlewisnyman
#81 Screen Shot 2015-05-10 at 17.05.51.jpg8.84 KBlewisnyman
#81 Screen Shot 2015-05-10 at 17.05.45.jpg9.78 KBlewisnyman
#73 replace_arrow_asc_and-2405057-73.patch9.8 KBnlisgo
#73 interdiff-2405057-68-73.txt1.25 KBnlisgo
#70 interdiff-2405057-68-70.txt613 bytesmanjit.singh
#70 replace_arrow_asc_and-2405057-70.patch10.14 KBmanjit.singh
#68 interdiff-2405057-65-68.txt534 bytesmanjit.singh
#68 replace_arrow_asc_and-2405057-68.patch9.8 KBmanjit.singh
#65 replace_arrow_asc_and-2405057-65.patch9.81 KBmanjit.singh
#61 replace_arrow_asc_and-2405057-61.patch9.8 KBnlisgo
#61 interdiff-2405057-59-61.txt662 bytesnlisgo
#59 replace_arrow_asc_and-2405057-59.patch9.16 KBnlisgo
#59 interdiff-2405057-56-59.txt836 bytesnlisgo
#57 Screenshot 2015-04-29 20.27.11.png354.65 KBNoe_
#57 Screenshot 2015-04-29 20.23.51.png58.79 KBNoe_
#56 replace_arrow_asc_and-2405057-56.patch8.34 KBnlisgo
#56 interdiff-2405057-48-56.txt627 bytesnlisgo
#54 interdiff-2405057-48-49.txt5.42 KBnlisgo
#53 interdiff-2405057-48-49.txt3.71 KBmanjit.singh
#49 replace_arrows-2405057-49.patch8.36 KBmanjit.singh
#48 replace_arrow_asc_and-2405057-48.patch8.35 KBnlisgo
#40 replace_arrows-2405057-39.patch8.33 KBemma.maria
#34 Screenshot 2015-01-23 13.55.31.jpg318.51 KBlewisnyman
#34 Screenshot 2015-01-23 13.46.06.jpg311.98 KBlewisnyman
#34 Screenshot 2015-01-23 13.31.49.jpg342.08 KBlewisnyman
#34 Screenshot 2015-01-23 13.23.19.jpg342.67 KBlewisnyman
#34 replace_arrows-2405057-34.patch8.33 KBlewisnyman
#34 interdiff.txt6.66 KBlewisnyman
#28 replace_arrows-2405057-28.patch2.31 KBdernetzjaeger
#16 replace_arrow_asc_and-2405057-16.patch2.7 KBctraltdel
#13 Bartik After Css 2.png10.33 KBctraltdel
#13 Bartik After Css 1.png10.35 KBctraltdel
#13 replace_arrow_asc_and-2405057-13.patch2.72 KBctraltdel
#11 bartik before 2.png21.21 KBcilefen
#11 bartik before 1.png20.63 KBcilefen
#11 bartik after 2.png21.79 KBcilefen
#11 bartik after 1.png21.83 KBcilefen
#3 2405057-screenshots.png54.62 KBctraltdel
#1 replace_arrow_asc_and-2405057-1.patch2.27 KBctraltdel

Comments

ctraltdel’s picture

StatusFileSize
new2.27 KB

I replaced the arrow-asc.png and arrow-desc.png files in /core/misc with /core/misc/icons/bebebe/twistie-down.svg and /core/misc/icons/bebebe/twistie-up.svg. Modified template_preprocess_tablesort_indicator in /core/includes/theme.inc to set the 'arrow_asc' and 'arrow_desc' values in $variables to the new icons.

Note that in the default admin theme, Seven, these values are overridden to point to $theme_path . '/images/arrow-asc.png' and $theme_path . '/images/arrow-desc.png.' Based on https://www.drupal.org/node/2032773 it looks like that would be a separate issue that has already been discussed.

cilefen’s picture

@ctraltdel: Could you please put before and after screenshots in the issue summary?

ctraltdel’s picture

Issue summary: View changes
StatusFileSize
new54.62 KB
cilefen’s picture

Status: Active » Needs review
davidhernandez’s picture

In the screenshots the arrows are slightly smaller and they end up higher. The size doesn't matter, but is there any CSS attached to these that needs to be adjusted?

cilefen’s picture

Status: Needs review » Reviewed & tested by the community

This looks good in classy as well. I am wondering why Seven didn't go with these. @ctraltdel, maybe you could discuss on that related issue if it was just overlooked.

cilefen’s picture

Status: Reviewed & tested by the community » Needs work

@davidhernandez Good point. I should have waited for you first!

cilefen’s picture

Since these are SVGs, I assume we can just make them bigger.

davidhernandez’s picture

I'm not actually seeing any CSS attached to them, so if that is the case I would leave it be. I wouldn't add extra CSS unless Lewis thinks moving them is important.

lewisnyman’s picture

Status: Needs work » Needs review
Issue tags: +Needs screenshots

I think the only visual problem is the position of the arrow but I don't want to add CSS just to make Stark or Classy look good. I think we need to get a screenshot of Bartik to make sure that still looks ok?

cilefen’s picture

Issue summary: View changes
StatusFileSize
new21.83 KB
new21.79 KB
new20.63 KB
new21.21 KB

Screenshots in IS.

davidhernandez’s picture

Status: Needs review » Needs work

I just talked to emmamaria in IRC and she would like to fix the alignment in Bartik. It should only be a small bit of CSS. Add it to table.css in Bartik's components folder.

ctraltdel’s picture

Issue summary: View changes
StatusFileSize
new2.72 KB
new10.35 KB
new10.33 KB

I updated the table.css stylesheet in Bartik to align the images.

ctraltdel’s picture

Status: Needs work » Needs review
lewisnyman’s picture

Status: Needs review » Needs work
Issue tags: -Needs screenshots
  1. +++ b/core/themes/bartik/css/components/table.css
    @@ -38,6 +38,11 @@ table tr th a:focus {
    +table tr th a img {
    

    We don't need so many elements here. table and tr are redundant because you can only have th within those elements anyway.

    I would suggest: th img

  2. +++ b/core/themes/bartik/css/components/table.css
    @@ -38,6 +38,11 @@ table tr th a:focus {
    +  padding-bottom: .188em;
    +  margin-left: .25em;
    

    We always include leading 0's before decimal points in CSS. Also why have padding for bottom and margin for left? Maybe we can combine them into one property?

ctraltdel’s picture

StatusFileSize
new2.7 KB

I made the suggested css updates. The end result has not changed from previous screenshots.

ctraltdel’s picture

Status: Needs work » Needs review
davidhernandez’s picture

Just a quick FYI. When only changing part of a patch, it is good to upload an interdiff. It makes reviewing a little easier. https://www.drupal.org/documentation/git/interdiff

pbull’s picture

Status: Needs review » Reviewed & tested by the community

Tested #16 in OSX (10.9.5) under Firefox 35.0, Safari 7.1.2, Chrome 39.

Looks good in Bartik, Stark and Classy.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 16: replace_arrow_asc_and-2405057-16.patch, failed testing.

Status: Needs work » Needs review
ruthsieg’s picture

Tested #16 on windows 7 home premium sp 1 under Firefox 34.0.5, IE 11.0.9600, Chrome 39.0.2171.99.

Bartik, Stark, Classy and Seven look fine.

davidhernandez’s picture

Status: Needs review » Reviewed & tested by the community

Well, it's green again. Did we have temporary bot problems?

pbull’s picture

@davidhernandez the first run failed in an unrelated test in ViewExecutableTest.

ruthsieg’s picture

Assigned: Unassigned » ruthsieg
ruthsieg’s picture

Assigned: ruthsieg » Unassigned
dernetzjaeger’s picture

Assigned: Unassigned » dernetzjaeger
dernetzjaeger’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new2.31 KB

changed markup in tablesort-indicator.html.twig to

{% if style == 'asc' -%}
  <span {{attributes.addClass('tablesort tablesort--asc') }}></span>
{% else -%}
  <span {{attributes.addClass('tablesort tablesort--dsc') }}></span>
{% endif %}

so we don't need template_preprocess_tablesort_indicator in theme.inc, also we can change the indicator- style themewise with only drop some lines of css.

All Drupal Core Themes should then add tablesort-indicator.css in their css components.

joelpittet’s picture

Status: Needs review » Needs work

@dernetzjaeger thank you for the patch and the idea. It was RTBC'd before so will this change give that much improvement? Glad to see the preprocess go away, so that's nice:)

Is there supposed to be CSS with this new patch? Can you somehow get the accessibility back via aria-descriptions or something?

Here's a bit of Twig/class name review:

+++ b/core/includes/theme.inc
index 2edbb17..0000000
--- a/core/misc/arrow-asc.png

+++ b/core/modules/system/templates/tablesort-indicator.html.twig
@@ -12,7 +12,7 @@
+  <span {{attributes.addClass('tablesort tablesort--asc') }}></span>
...
+  <span {{attributes.addClass('tablesort tablesort--dsc') }}></span>

Minor nit pick but don't put a space before the starting print curlies but do but it after because when attributes print it puts a space before each attribute printed.

And 'desc' would be slightly more preferable to 'dsc' as we usually don't use abbreviations with missing letters.

I'm fine with the previous RTBC patch in #16 as well except th img {} is a bit too generic of a selector for the CSS, if this issue goes back to that, I think that should be addressed if possible.

dernetzjaeger’s picture

@joelpittet it was RTBC'd and then resetted to needs work, that was confusing.

Yes, i think it's an improvement, because if you would like to change the indicator style, you don't need to rewrite the preprocessing function.

No, there is no css in that patch, because I think that is more theme related. We should then open issues for each theme. Here is a related issue for Seven Clean up images used in the Seven theme.

ARIA: sure, you are right!
We could add aria-sort attribute to both spans.

Thanks for your notes and yeah "desc" is quit better ;)

davidhernandez’s picture

If the graphic is being removed in favor of a css based solution, there should be a core equivalent. The arrows are functional and not just for styling.

dernetzjaeger’s picture

@davidhernandez
Yes, of course we need to add the arrows to a core css.

.tablesort--asc {
  background-image: url(../../../../misc/icons/5181c6/twistie-down.svg);
}
.tablesort--desc {
  background-image: url(../../../../misc/icons/5181c6/twistie-up.svg);
}

but the positioning can be done in theme css using .tablesort class.

dernetzjaeger’s picture

Assigned: dernetzjaeger » Unassigned
lewisnyman’s picture

Status: Needs work » Needs review
Issue tags: -Novice
StatusFileSize
new6.66 KB
new8.33 KB
new342.67 KB
new342.08 KB
new311.98 KB
new318.51 KB

Good work, love this patch! I did a few things here:

  1. Moved the table indicator CSS into system.module.css as it's functional
  2. Added some visually hidden text to the links so it's accessible to screenreaders
  3. Rewrote the template a little to be DRY-er
  4. Removed the Seven custom preprocessing and template and added the custom CSS and icons

Stark before:

Stark after:

Seven before:

Seven after:

Status: Needs review » Needs work

The last submitted patch, 34: replace_arrows-2405057-34.patch, failed testing.

idebr’s picture

+++ b/core/modules/system/templates/tablesort-indicator.html.twig
@@ -11,8 +11,18 @@
+<span {{attributes.addClass( classes ) }}>
+  <span class="visually-hidden">
+    {% if style == 'asc' -%}
+      {{ 'Sort ascending.'|t }}
+    {% else -%}
+      {{ 'Sort descending.'|t }}
+    {% endif %}
+  </span>
+</span>

The text for screenreaders is causing the test to fail. I wonder if this could go in a followup or if it should be fixed in this issue?

davidhernandez’s picture

+<span {{attributes.addClass( classes ) }}>

Spacing here needs to be fixed. Should be:

+<span{{ attributes.addClass(classes) }}>

davidhernandez’s picture

@idebr, all patches have to pass testing or they won't get committed, so it will have to be fixed here.

idebr’s picture

@davidhernandez Yes, I'm aware :). I was just wondering if the additional text for screenreaders should be added in this issue or in a followup, since I didn't expect it to be included in this issue based on its current title and issue summary.

emma.maria’s picture

Status: Needs work » Needs review
StatusFileSize
new8.33 KB

Added the fix mentioned #37.

joelpittet’s picture

@emma.maria thank you for fixing that.

@idebr Do you know why screenreader tests are failing?

@LewisNyman et al Should those new SVGs be added to seven theme folder as their specific to that theme?

Status: Needs review » Needs work

The last submitted patch, 40: replace_arrows-2405057-39.patch, failed testing.

idebr’s picture

Old markup for a clicksortable table header:

<a title="sort by ID" href="/test_click_sort?order=id&amp;sort=desc">
  ID
  <img width="13" height="13" title="sort descending" alt="sort descending" src="http://drupal8.localhost/core/misc/arrow-desc.png">
</a>

New markup for a clicksortable table header:

<a title="sort by ID" href="/test_click_sort?order=id&amp;sort=desc">
  ID
  <span class="tablesort tablesort--desc">
    <span class="visually-hidden"> Sort descending. </span>
  </span>
</a>

The test fails on

$this->clickLink(t('ID'));
lewisnyman’s picture

@LewisNyman et al Should those new SVGs be added to seven theme folder as their specific to that theme?

I think they should go in the global icons folder, just so they are easily available for contrib

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 40: replace_arrows-2405057-39.patch, failed testing.

nlisgo’s picture

Issue tags: +Needs reroll
nlisgo’s picture

Status: Needs work » Needs review
StatusFileSize
new8.35 KB
manjit.singh’s picture

StatusFileSize
new8.36 KB

rerolling patch :)

@lewisnyman Can you please verify

davidhernandez’s picture

Issue tags: -Needs reroll

What is the difference between #48 and #49? Please upload an interdiff. #49 was green, so I don't know why it needed to be rerolled.

manjit.singh’s picture

@davidhernandez Actually i was talking to lewisnyman on IRC about this issue, After that i have reroll a patch and upload it but forget to reload browser. But in the mean time nlisgo also uploaded the same.

nlisgo’s picture

Happy for my file to be hidden and the patch @Manjit.Singh provided to be put forward for review but an interdiff would be useful as there does appear to be a small difference in the patch files.

manjit.singh’s picture

StatusFileSize
new3.71 KB

creating interdiff first time, can you please check whether i have'nt done it wrong :)

nlisgo’s picture

StatusFileSize
new5.42 KB

There were some issues with the interdiff in #53. I use the 'Create interdiff using git' approach documented in https://www.drupal.org/documentation/git/interdiff

Here is the interdiff.

nlisgo’s picture

Assigned: Unassigned » nlisgo
Status: Needs review » Needs work

There are some issues with both patches in #48 and #49 but less with #48 so I will resupply a patch with an interdiff with #48.

Feedback for the patch in #49:

The svg paths have a fill colour of #787878 but I believe this should be the fill colour #004875 or #008ee6 depending on which folder the svg is in.
The name of the tablesort-indicator.css.css file is incorrect and should be tablesort-indicator.css

I incorrectly applied the patch to system.theme.css in #48 which is why I need to prepare it again.

nlisgo’s picture

Assigned: nlisgo » Unassigned
Status: Needs work » Needs review
StatusFileSize
new627 bytes
new8.34 KB

The interdiff highlights the mistake in the patch prepared in #48 but this is really just a reroll of #40.

Please review.

Noe_’s picture

Status: Needs review » Needs work
StatusFileSize
new58.79 KB
new354.65 KB

I love the fact that someone is taking the time to make the PNG's into SVG's. It saves a lot of space and it automatically scales for retina devices, so that is great.

However, it doesn't load the SVG's. If I apply the patch (which it does brilliantly) and I go to /admin/people I get nothing.

<a href="/admin/people?user=&role=All&permission=All&status=All&=Filter&order=created&sort=asc" title="sort by Member for"> Member for <img src="" width="13" height="13" alt="sort ascending" title="sort ascending" /> on Seven.

Here is a picture from the Chrome Devtools inspector:

Also, I don't see anything from the tablesort-indicator.html.twig when I search for it in the source code.

I really do hope this get's into Drupal8.

cilefen’s picture

@Noe_ I see the same.

nlisgo’s picture

Status: Needs work » Needs review
StatusFileSize
new836 bytes
new9.16 KB

Needed to get rid of the template in the classy theme also. See the interdiff.

Status: Needs review » Needs work

The last submitted patch, 59: replace_arrow_asc_and-2405057-59.patch, failed testing.

nlisgo’s picture

Status: Needs work » Needs review
StatusFileSize
new662 bytes
new9.8 KB

Addressed failing tests.

Noe_’s picture

#61 looks pretty good. It just works on the Seven theme right?
I changed the theme to Bartik and there it doesn't work.

lewisnyman’s picture

Status: Needs review » Needs work
Issue tags: +Needs screenshots, +Needs issue summary update

This patch should work in Bartik, Stark, and Classy. We should upload before/after screenshots.

@Noe_ It looks like you might need to clear your cache or reinstall, you are still loading the old templates.

The only other point here is that this patch does a lot more than it states in the title and issue summary. We are removing a template and replacing it with CSS. We need to make that clear in the issue summary and title, we also need sign off from a theme system maintainer, or we should move that change to a another issue where it can be discussed separately.

  1. +++ b/core/modules/system/css/system.module.css
    @@ -179,6 +179,22 @@ table.sticky-header {
    + * Markup generated by tablesort-indicator.html.twig.
    + */
    +.tablesort {
    

    This also requires a blank line

  2. +++ b/core/themes/seven/css/components/tablesort-indicator.css
    @@ -0,0 +1,22 @@
    + * @file
    + * Tablesort indicator styles.
    + */
    + .tablesort {
    

    This requires a blank line after the comment

lewisnyman’s picture

+++ b/core/modules/system/css/system.module.css
@@ -179,6 +179,22 @@ table.sticky-header {
 /**
+ * Markup generated by tablesort-indicator.html.twig.
+ */
+.tablesort {

Manjit pointed out on IRC that this is not a @file comment so it doesn't need a blank line below.

manjit.singh’s picture

Status: Needs work » Needs review
StatusFileSize
new9.81 KB

@lewisnyman Please verify.

lewisnyman’s picture

Assigned: Unassigned » joelpittet

Yep that looks good, we just need a theme system maintainer to verify that we can remove a template in this issue. Joel has been involved so assigning to him.

joelpittet’s picture

Assigned: joelpittet » Unassigned
Status: Needs review » Needs work

I love the way this is looking, less need for preprocess to add an image is a big win IMO.

Template removal should be fine.

We should get some screenshots and Issue Summary Update resolved.

  1. +++ b/core/modules/system/templates/tablesort-indicator.html.twig
    @@ -11,8 +11,18 @@
    +<span {{ attributes.addClass(classes) }}>
    

    got an extra space in there before the {{, that can be removed.

  2. +++ b/core/modules/system/templates/tablesort-indicator.html.twig
    @@ -11,8 +11,18 @@
    +      {{ 'Sort ascending.'|t }}
    ...
    +      {{ 'Sort descending.'|t }}
    

    Do these need periods? It wasn't before, the capitol is fine though I think(remember to change the click link test if you remove the period.

manjit.singh’s picture

Status: Needs work » Needs review
StatusFileSize
new9.8 KB
new534 bytes

@joelpittet Please find and review the patch :)

joelpittet’s picture

Status: Needs review » Needs work
+++ b/core/modules/system/templates/tablesort-indicator.html.twig
@@ -11,8 +11,18 @@
+      {{ 'Sort ascending.'|t }}
...
+      {{ 'Sort descending.'|t }}

+++ b/core/modules/views/src/Tests/Handler/FieldWebTest.php
@@ -74,7 +74,7 @@ public function testClickSorting() {
+    $this->clickLink(t('ID Sort descending.'));

Please remove the periods from these too.

manjit.singh’s picture

Status: Needs work » Needs review
StatusFileSize
new10.14 KB
new613 bytes
manjit.singh’s picture

Issue tags: +SprintWeekend2015

Status: Needs review » Needs work

The last submitted patch, 70: replace_arrow_asc_and-2405057-70.patch, failed testing.

nlisgo’s picture

Addressing feedback in #69.

nlisgo’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 73: replace_arrow_asc_and-2405057-73.patch, failed testing.

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 73: replace_arrow_asc_and-2405057-73.patch, failed testing.

Status: Needs work » Needs review
manjit.singh’s picture

@nlisgo Patch is looks like good... but don't know why testing is failed everytime.
@lewis Can you have some time to look upon.

from myside all (UI) looks good :)

nlisgo’s picture

@Manjit.Singh sometimes testbot will fail but it is not due to the code.

See: https://www.drupal.org/automated-testing/troubleshooting

I was not able to reproduce the error locally so I determined that it was an issue with the testbot and simply queued the patch for a retest.

lewisnyman’s picture

Title: Replace arrow-asc and arrow-desc images with Libricons » Replace arrow-asc and arrow-desc images with Libricons and implement using CSS
Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs screenshots, -Needs issue summary update
StatusFileSize
new9.78 KB
new8.84 KB
new9.97 KB
new10.4 KB

Nice, I've updated the issue summary and here are the screenshots for Seven.

manjit.singh’s picture

Screenshots looks fine for me !! thanks lewis

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs change record
+++ b/core/includes/theme.inc
@@ -968,25 +968,6 @@ function template_preprocess_table(&$variables) {
 /**
- * Prepares variables for tablesort indicator templates.
- *
- * Default template: tablesort-indicator.html.twig.
- *
- * @param array $variables
- *   An associative array containing:
- *   - style: Set to either 'asc' or 'desc'. This determines which icon to show.
- */
-function template_preprocess_tablesort_indicator(&$variables) {
-  // Provide the image attributes for an ascending or descending image.
-  if ($variables['style'] == 'asc') {
-    $variables['arrow_asc'] = file_create_url('core/misc/arrow-asc.png');
-  }
-  else {
-    $variables['arrow_desc'] = file_create_url('core/misc/arrow-desc.png');
-  }
-}

This needs a change record

cilefen’s picture

I started a draft CR.

cilefen’s picture

Issue summary: View changes
Issue tags: +Novice

A novice can finish the change record.

lewisnyman’s picture

I would be nice to show the markup before and after, as well as how someone would override the icons after this patch.

cilefen’s picture

I would be nice to show the markup before and after, as well as how someone would override the icons after this patch.

In case you are wondering, this information is needed in the change record.

deepakaryan1988’s picture

Issue tags: -SprintWeekend2015

Removing sprint weekend tag!!
As suggested by @YesCT

karolus’s picture

Issue tags: +Needs reroll

Tried to apply the patch, changes to Seven theme YAML file.

wmortada’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new9.82 KB

I've re-rolled this patch against the latest commit (251ca21).

There was a conflict in the file core/themes/seven/seven.libraries.yml - an additional CSS file was added by this patch and in the main branch. I kept both CSS files.

I've tested the changes and it appears to work as expected.

karolus’s picture

Status: Needs review » Needs work

Just tested the #90 patch--all appears to be in working order, tested under Classy, Bartik, and Stark themes. To be sure that things were OK, a few displays were checked across the site.

karolus’s picture

Status: Needs work » Needs review
StatusFileSize
new139.2 KB
new134.98 KB
new116.71 KB
new115.16 KB

Manually tested the #90 patch across different displays in Classy, Stark, and Bartik themes. Also did a review of all lines in the patch, and they appear to be in the scope of the issue (but could stand to have more experienced eye review) of the patch code, and changes appear OK. Switching back to the 8.0.x branch to compare gave further indication the patch is working as advertised.

karolus’s picture

Issue summary: View changes
Status: Needs review » Needs work
StatusFileSize
new142.5 KB

While going back to make screenshots to document the patch changes, I noticed another issue--In the Bartik theme, the arrows appear to disappear, since they are the same color as the default table heads. This is evident in the highlighted file.
Disappearing Arrows

karolus’s picture

Issue summary: View changes
StatusFileSize
new126.54 KB
new126.27 KB
new145.87 KB
new145.78 KB
karolus’s picture

Issue summary: View changes

Added remaining tasks to issue summary. Am now going to work on change record.

karolus’s picture

karolus’s picture

New screen grabs, to be referenced in the issue summary.

karolus’s picture

Issue summary: View changes

Issue summary updated.

karolus’s picture

Issue summary: View changes

There is a draft change record now--the first I've ever written. Link

clacina’s picture

I'm going to fix the problem with the Bartik theme that was mentioned in comment #93

amanda.drupal’s picture

I'm checking the beta evaluation

amanda.drupal’s picture

I'm not sure if this is unfrozen because it does change the PHP test and a yml file but both of those look like minor changes.

clacina’s picture

I have confirmed that it works in every theme except for Bartik.

This was part of a Drupal Association sprint. The sprint is over, so other people are free to take over the issue.

mgifford’s picture

@clacina - what was your plan for Bartik? We can't change the default table heads for Bartik I assume.

I'm assuming we should just create a new twistie-down.svg & twistie-up.svg pair for Bartik that is a lighter shade. I think this is the grey that is closer to what is there #b6b6b6 so we could just create a:
core/themes/bartik/images/b6b6b6/twistie-down.svg

joelpittet’s picture

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

Here's a re-roll because a few things moved around. For bartik, I suggest providing some svg icons with better colors. Because it is there but the color just matches the background. @emma.marie do you have a bartik color palette to work with for those colors?

In the re-roll I moved
core/modules/system/css/components/tablesort.theme.css
and what added to core/modules/system/css/system.module.css
into
core/modules/system/css/components/tablesort.module.css

Hope I got the name correct (barely understand module/theme structure)

joelpittet’s picture

+++ b/core/themes/seven/css/components/tablesort-indicator.css
@@ -0,0 +1,26 @@
+[dir="rtl"] .tablesort {
+  float: left;
+}

Oh also added this for RTL.

mgifford’s picture

Issue tags: +svg
avitslv’s picture

Issue summary: View changes
StatusFileSize
new17.68 KB
new195.09 KB

For bartik added

core/misc/icons/ffffff/twistie-up.svg
core/misc/icons/ffffff/twistie-down.svg and
core/themes/bartik/css/components/tablesort-indicator.css

White icons on gray background. See screnshot how it looks and should be reviewed by theme maintainer.

bartik-arrows

jiv_e’s picture

What's happening in system.libraries.yml? There's 'every_page: true' added on every css component. Is this intended and what does it do?

davidhernandez’s picture

Status: Needs review » Needs work

every_page was removed from core so that shouldn't be there. @avitslv make sure your development copy of Drupal 8 is up to date with the latest head. You should see those every_page entries go away.

avitslv’s picture

StatusFileSize
new31.56 KB
new12.32 KB

Resubmitted patch. Fixed the mixup for system.libraries.yml, thanks @jiv_e @davidhernandez

This time added Desc arrow screenshot for bartik:
bartik arrow desc

avitslv’s picture

Status: Needs work » Needs review
emma.maria’s picture

I checked out the arrow-asc and arrow-desc in Bartik. They look great! Such a visual improvement for Bartik having the arrows white and the arrows work as expected in all tables. Thanks everyone!

Screenshots for good measure.
 

 

joelpittet’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs change record

There seems to be a couple change records so removing that tag.

Had a quick glance at Seven theme and it's still good too.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 111: replace_arrow_asc_and-2405057-111.patch, failed testing.

lewisnyman’s picture

Status: Needs work » Reviewed & tested by the community

Back to RTBC

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 111: replace_arrow_asc_and-2405057-111.patch, failed testing.

jaxxed’s picture

patch #111 needs a reroll

davidhernandez’s picture

Issue tags: +Needs reroll
madhavvyas’s picture

StatusFileSize
new4.59 KB

Patch rerolled #111

madhavvyas’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
mgifford’s picture

Shouldn't this patch also remove core/misc/arrow-asc.png core/misc/arrow-desc.png and any references to them?

madhavvyas’s picture

StatusFileSize
new5.22 KB

Patch updated as per #123

madhavvyas’s picture

StatusFileSize
new6.68 KB

Forget to remove reference for arrow-asc and arrow-desc files

lewisnyman’s picture

Issue summary: View changes
Status: Needs review » Needs work
StatusFileSize
new720.62 KB

It looks like this patch is missing the changes to the twig file.

+++ b/core/includes/theme.inc
@@ -971,10 +971,10 @@ function template_preprocess_table(&$variables) {
-    $variables['arrow_asc'] = file_create_url('core/misc/arrow-asc.png');
+    $variables['arrow_asc'] = file_create_url('core/misc/icons/bebebe/twistie-down.svg');
...
-    $variables['arrow_desc'] = file_create_url('core/misc/arrow-desc.png');
+    $variables['arrow_desc'] = file_create_url('core/misc/icons/bebebe/twistie-up.svg');

+++ b/core/themes/seven/seven.theme
@@ -102,8 +102,8 @@ function seven_preprocess_admin_block_content(&$variables) {
 function seven_preprocess_tablesort_indicator(&$variables) {
   $theme_path = drupal_get_path('theme', 'seven');
-  $variables['arrow_asc'] = file_create_url($theme_path . '/images/arrow-asc.png');
-  $variables['arrow_desc'] = file_create_url($theme_path . '/images/arrow-desc.png');
+  $variables['arrow_asc'] = file_create_url('core/misc/icons/bebebe/twistie-down.svg');
+  $variables['arrow_desc'] = file_create_url('core/misc/icons/bebebe/twistie-up.svg');

These lines could also be removed, because they are changing the src for the img tag instead of in CSS.

nlisgo’s picture

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

The sizes of the patch files for #121, #124 and #125 are significantly smaller than the patch in #111 which was RTBC. I just quickly attempted a re-roll and the size of my patch file is around 12K. So something has gone wrong.

Here is a re-roll of #111 for review.

emma.maria’s picture

@nlisgo you beat me to it I agree with a reroll of #111. The patch in #127 contains everything that was in #111.

Setting to RTBC when the patch goes green.

lewisnyman’s picture

Status: Needs review » Reviewed & tested by the community

I manually tested this patch and it looks the same as the screenshots above.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 127: replace_arrow_asc_and-2405057-127.patch, failed testing.

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 127: replace_arrow_asc_and-2405057-127.patch, failed testing.

davidhernandez’s picture

New CI passes. Old testbot has AWS errors?

Status: Needs work » Needs review
davidhernandez’s picture

Status: Needs review » Reviewed & tested by the community

Setting back to RTBC per #129. The fails were testbottiness.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Markup and templates are yet frozen. And bartik looks much better - nice work everyone. Committed 8bcdbf2 and pushed to 8.0.x. Thanks!

  • alexpott committed 8bcdbf2 on 8.0.x
    Issue #2405057 by nlisgo, Manjit.Singh, ctraltdel, madhavvyas, avitslv,...

Status: Fixed » Closed (fixed)

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