Problem/Motivation

Proposed resolution

There are quite a few images in the Seven theme that are not being used.

Remaining tasks

For each image, check it is not being used; if they are, replace them with the correct Libricon in core/misc/icons

User interface changes

Some nice and shaper icons ;-)

None

API changes

None

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dernetzjaeger’s picture

Assigned: Unassigned » dernetzjaeger
dernetzjaeger’s picture

Status: Active » Needs review
FileSize
2.54 KB

checked all files

found 2 references in tablesort-indicator.html.twig and forms.css.

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 %}

added css/components/tablesort-indicator.css

dernetzjaeger’s picture

FileSize
2.6 KB

found missing @file in forms.css and forgot "." on @file comment in tablesort-indicator.css

dernetzjaeger’s picture

LewisNyman’s picture

Status: Needs review » Needs work

@dernetzjaeger Thanks for the work here. I think you're miss the extra table sort indicator file. The best way to include it in the patch is to make a commit adding a file and then do git diff HEAD~1 to create the patch.

Also, I do agree with the CSS only changes in principle, but I think we should make that change globally across core in another issue (I can't find it right now)

dernetzjaeger’s picture

@LewisNyman Yes, just saw tha the file is missing. I had some trouble with git, sorry for that.

I think it's that issue Replace arrow-asc and arrow-desc images with Libricons

dernetzjaeger’s picture

I just investigated that a bit.

We need to make changes to modules/system/templates/tablesort-indicator.html.twig as shown in #2.

Then we could remove

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');
  }
}

from theme.inc

In the next step all Themes can implement classes .tablesort and .tablesort--asc/dsc to customize the table- sorting item as prefered.

dernetzjaeger’s picture

Status: Needs work » Needs review
FileSize
2.47 KB
dernetzjaeger’s picture

Assigned: dernetzjaeger » Unassigned
stefan.r’s picture

FileSize
3.27 KB
7.17 KB

This also removes some unused files:

./themes/seven/images/add.png
./themes/seven/images/arrow-asc-active.png
./themes/seven/images/arrow-desc-active.png
./themes/seven/images/arrow-next.png
./themes/seven/images/arrow-prev.png
./themes/seven/images/task-check.png
./themes/seven/images/task-item-rtl.png
./themes/seven/images/task-item.png
^ Not used anywhere.

./themes/seven/images/arrow-asc.png
./themes/seven/images/arrow-desc.png
./themes/seven/images/required.svg
^ Replaced by libricon.
LewisNyman’s picture

Status: Needs review » Needs work
FileSize
315.68 KB
336.09 KB

Looking good! We have a bit of a regression here with the size and the color of the table sort arrows. I have taken before and after screenshots:

Before

After

dernetzjaeger’s picture

Assigned: Unassigned » dernetzjaeger
dernetzjaeger’s picture

Assigned: dernetzjaeger » Unassigned
Status: Needs work » Needs review
FileSize
75.57 KB
1.06 KB
7.95 KB

@stefan.r
Thanks :)

@LewisNyman
I didn't add the template file to the patch and if that got applied, we won't need an extra template file in Seven.

After

LewisNyman’s picture

Status: Needs review » Postponed
mgifford’s picture

emma.maria’s picture

Version: 8.0.x-dev » 8.1.x-dev
Status: Postponed » Needs review

Un-postponing as the issue mentioned in #14 was committed and the Seven is not frozen for changes, so clean up tasks can take place.

We just need to check that the most recent patch in #13 has everything we need in it.

falufalump’s picture

The most recent patch (#13) does not currently apply cleanly. It may need a re-roll.

emma.maria’s picture

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

@mccartj5 yes, if a patch cannot be applied cleanly it definitely needs a re-roll. Feel free next time to set the issue to "Needs Work" and also tag it with "Needs reroll".

ChuChuNaKu’s picture

Issue tags: -Needs reroll +Needs preroll, +SprintWeekend2016, +SprintWeekendBOS

We're taking a look at this as part of the sprint weekend.

ChuChuNaKu’s picture

Status: Needs work » Needs review
FileSize
5.19 KB

Patch #13 generated the following errors:

~>git apply --check issue-2407955-13.patch
error: core/themes/seven/css/components/tablesort-indicator.css: already exists in working directory
error: patch failed: core/themes/seven/seven.libraries.yml:32
error: core/themes/seven/seven.libraries.yml: patch does not apply
error: patch failed: core/themes/seven/seven.theme:110
error: core/themes/seven/seven.theme: patch does not apply
error: core/themes/seven/templates/tablesort-indicator.html.twig: No such file or directory

We (leslieg and chuchunaku) made the following changes and re-rolled the patch:
deleted: core/themes/seven/images/add.png
deleted: core/themes/seven/images/arrow-asc-active.png
deleted: core/themes/seven/images/arrow-asc.png
deleted: core/themes/seven/images/arrow-desc-active.png
deleted: core/themes/seven/images/arrow-desc.png
deleted: core/themes/seven/images/arrow-next.png
deleted: core/themes/seven/images/arrow-prev.png
deleted: core/themes/seven/images/required.svg
deleted: core/themes/seven/images/task-check.png
deleted: core/themes/seven/images/task-item-rtl.png
deleted: core/themes/seven/images/task-item.png

modified: core/themes/seven/css/components/form.css

Bojhan’s picture

Looks good to me!

ironkiat’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +drupalconasia2016

Applied the patch, successfully removed all the images in seven theme.
All looks good to go!

star-szr’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: -Needs preroll
+++ b/core/themes/seven/css/components/form.css
@@ -91,7 +91,7 @@ label[for] {
-  background-image: url(../../images/required.svg);
+  background-image: url(../../../core/misc/icons/ee0000/required.svgg);

Thanks, this looks pretty reasonable (all the images removed do look to be unused and all of the remaining images in Seven are used) but this one line looks a bit off - svgg instead of svg I think :)

ironkiat’s picture

Status: Needs work » Needs review
FileSize
5.19 KB

Updated patch file to remove that extra g in the css.

Bojhan’s picture

Status: Needs review » Reviewed & tested by the community

My bad, back to RTBC!

star-szr’s picture

Assigned: Unassigned » star-szr

Thanks! Will take a look soonish :)

star-szr’s picture

Assigned: star-szr » Unassigned
Issue summary: View changes
Status: Reviewed & tested by the community » Needs work
+++ b/core/themes/seven/css/components/form.css
@@ -91,7 +91,7 @@ label[for] {
-  background-image: url(../../images/required.svg);
+  background-image: url(../../../core/misc/icons/ee0000/required.svg);

So I looked at this closer and Classy's form.css has this CSS:

.form-required:after {
  content: '';
  vertical-align: super;
  display: inline-block;
  /* Use a background image to prevent screen readers from announcing the text. */
  background-image: url(../../../../misc/icons/ee0000/required.svg);
  background-repeat: no-repeat;
  background-size: 6px 6px;
  width: 6px;
  height: 6px;
  margin: 0 0.3em;
}

That makes the background-image line redundant. We can rely on Classy here and remove the line.

darketaine’s picture

According to #27 here goes the patch
(maybe all the form-required:after is redundant?)

darketaine’s picture

Status: Needs work » Needs review

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

wellme’s picture

It is working. Can be made as RTBC.

mgifford’s picture

@wellme that's great. Can you describe the tests you've done and change the status? Thanks!

wellme’s picture

  • Checked the console whether any 404 errors are occuring.
  • Using grep, checked whether deleted images are used anywhere in the seven theme.
  • Confirmed whether the non-deleted images are actually used.
wellme’s picture

Status: Needs review » Reviewed & tested by the community
mgifford’s picture

Great. Thanks @wellme

star-szr’s picture

Title: Clean up images used in the Seven theme » Clean up unused images in the Seven theme
Status: Reviewed & tested by the community » Fixed

This is just cleanup so committing to 8.2.x only. Thanks all :)

  • Cottser committed 24f7662 on 8.2.x
    Issue #2407955 by dernetzjaeger, darketaine, stefan.r, ChuChuNaKu,...
Wim Leers’s picture

Status: Needs review » Fixed

d.o, you're weird. #36 is marked as "fixed", but here it says "needs review". WTF.

Status: Fixed » Closed (fixed)

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