Follow-up to #2582911: Styling of buttons breaks in Blocks UI whilst using Bartik as an administration theme

Problem/Motivation

Styling of draghandles break while using Bartik as admin theme (or anywhere draghandles are used, actually). Please have a look at the dotted line attached screenhots and note exists outside the table (overflows). It shouldn’t even be displayed.

Proposed resolution

User interface changes

css change to correctly render draghandles.

API changes

none.

Data model changes

none - just css.

===========================================

SOLUTION

BEFORE

AFTER Chrome

AFTER Firefox

CommentFileSizeAuthor
#71 2683433-71-hover-chrome.png23.13 KBccjjmartin
#71 2683433-71-no-hover-chrome.png23.29 KBccjjmartin
#70 interdiff-67-70.txt387 bytesgnuget
#70 table_drag_handle_icons-2683433-70.patch451 bytesgnuget
#69 2683433-69.png9.91 KBstar-szr
#67 interdiff-2683433-30-67.txt549 bytesrachel_norfolk
#67 table_drag_handle_icons-2683433-67.patch424 bytesrachel_norfolk
#63 Block_layout-Drupal 8-IE-after.png68.94 KBVidushi Mehta
#63 Block_layout-drupal-8-Safari-after.jpg229.28 KBVidushi Mehta
#60 Block-layout-drupal 8-chrome-after.jpeg112.96 KBVidushi Mehta
#60 Block-layout - drupal-8 2016-05-16 23-13-01-ff-after.png51.93 KBVidushi Mehta
#51 after_nola2016.png85.27 KBnathanc
#51 before_nola2016.png93.49 KBnathanc
#48 2683433-firefox.png14.01 KBradioflyer
#48 2683433-chrome.png12.97 KBradioflyer
#39 table_drag_handle_icons-2683433-33.patch390 bytesemallove
#38 table_drag_handle_icons-2683433-32.patch395 bytesemallove
#37 table_drag_handle_icons-2683433-31.patch405 bytesemallove
#30 interdiff-2683433-27-30.txt431 bytesrachel_norfolk
#30 table_drag_handle_icons-2683433-30.patch569 bytesrachel_norfolk
#27 table_drag_handle_icons-2683433-26.patch990 bytesNitinSP
#26 FF_underline.png180.49 KBNitinSP
#19 interdiff-2683433-16-19.txt491 bytesrachel_norfolk
#19 table_drag_handle_icons-2683433-19.patch636 bytesrachel_norfolk
#18 FF_underline.png94.12 KBManjit.Singh
#18 chrome-underline.png67.08 KBManjit.Singh
#16 interdiff.txt382 byteskostyashupenko
#16 table_drag_handle_icons-2683433-16.patch568 byteskostyashupenko
#16 tabledrag-border.png22.01 KBkostyashupenko
#13 Screen Shot 2016-04-26 at 11.16.11.png76.31 KBemma.maria
#5 2683433-2-after-screenshot.png49.2 KBrachel_norfolk
#4 styling_of_tables_break-2683433-4.patch551 byteskostyashupenko
#3 styling_of_tables_break-2683433-3.patch618 byteskostyashupenko
#3 table-rtl.png22.69 KBkostyashupenko
#3 table-ltr.png20.21 KBkostyashupenko
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rachel_norfolk created an issue. See original summary.

rachel_norfolk’s picture

Status: Reviewed & tested by the community » Active
kostyashupenko’s picture

Status: Active » Needs review
FileSize
20.21 KB
22.69 KB
618 bytes

Fixed styles for draggable dots. Check styles for ltr & rtl on screens

table-ltr.png
table-rtl.png

kostyashupenko’s picture

Sorry, removed unnecessary lines

rachel_norfolk’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
49.2 KB

The css change does indeed correct the issue of the dotted line overflowing. See

after screenshot

The css is reasonably constrained to the area concerned, too.

Looks good to me.

rachel_norfolk’s picture

Title: Styling of tables break while using Bartik as administration theme theme » Styling of tabledrag draghandles break while using Bartik as administration theme theme
Issue summary: View changes
Status: Reviewed & tested by the community » Needs work

Been thinking a little about this and, really, the dotted line shouldn’t be appearing at all, should it? It is there because the draghandle is a link and the Bartik theme applies a dotted border-bottom to all links.

So, we need to do something similar to the seven theme and override the tabledrag.module.css in bartik.info.yml and provide our own, adapted to the special way Bartik styles things (I think - not tried that before!).

Manjit.Singh’s picture

@Emma @rachel I was thinking that why we are aligned this dragholder line n all , I mean, Is there any requirement to do this in Bartik ? Can't we remove the underline from dragholders from all tables ?
I have checked the Seven theme there is no underline in Draggable element.

Here is the screenshot that what i want to say.

Only local images are allowed.

kostyashupenko’s picture

So please, let's make it correct. Do we need this border or what? Describe a task, what should we do?

kostyashupenko’s picture

Maybe needs design?

emma.maria’s picture

Status: Needs work » Postponed

Bartik is supposed to be a front-end theme with support for adding/editing content (which is an overriding option in the Administration theme settings and also within user permissions).

If we need to override styles within the theme itself to make it serve more than the purpose it is supposed to have, it is too much.

I'm going to postpone this issue and a few other admin type ones, based on wanting to explore this issue further #550102: Allow a theme to set itself as an admin or frontend theme exclusively.

star-szr’s picture

Title: Styling of tabledrag draghandles break while using Bartik as administration theme theme » Styling of tabledrag draghandles break while using Bartik as administration theme

My only reservation is table drag seems like a UI that for better or for worse would also be exposed sometimes to front-facing users, or at least to users with less permissions (such as access admin theme).

But I do agree we probably shouldn't go too far in this direction in general.

Getting rid of a redundant "theme" in the title.

Manjit.Singh’s picture

Agree with the Feedbacks on #10 and #11.
But Is there any possibility that there would not a major structure breaking frontend issues, Otherwise it's good.

emma.maria’s picture

Issue summary: View changes
Status: Postponed » Active
Issue tags: +CSS, +Novice
FileSize
76.31 KB

As the crosshair is visible on the node add /edit pages (which we should visually support for Bartik), I'm opening this issue back up.
 

 
The patch in #4 only focuses on margin and I would like to have the underline removed from crosshairs please.
Please try and follow the Drupal CSS standards for choosing good CSS selectors here https://www.drupal.org/coding-standards/css/architecture#goals .

I also want to stress again that Bartik should *not* be supported as a full admin theme, but I very much appreciate the attention to visual detail that people pay towards Bartik.

Thanks everyone!

emma.maria’s picture

Title: Styling of tabledrag draghandles break while using Bartik as administration theme » Table drag handle icons should not have an underline in Bartik.
kostyashupenko’s picture

Assigned: Unassigned » kostyashupenko
kostyashupenko’s picture

Status: Active » Needs review
FileSize
22.01 KB
568 bytes
382 bytes

Removed border for handle icons in Bartik theme

tabledrag-border.png

kostyashupenko’s picture

Assigned: kostyashupenko » Unassigned
Manjit.Singh’s picture

Status: Needs review » Needs work
FileSize
67.08 KB
94.12 KB

Looks good in Chrome.

chrome underline

but this is still visible in Firefox.

chrome underline

rachel_norfolk’s picture

Kind of entertaining how that particular dotty line is a text decoration, not a bottom border…

Anyway - patch:

rachel_norfolk’s picture

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

Status: Needs review » Needs work

There are a few improvements that need to be made to the patch.

  1. The underline on the <abbr> tag and the padding change on the tabledrag are out of scope for this issue, we should only be removing the border bottom on the tabledrag component.
  2.  

  3. We are not following the CSS coding standards for the selector.

    1. Avoid reliance on HTML structure #

    • - CSS should define the appearance of an element anywhere and everywhere it appears.
    • - Use classes to assign appearance to markup. Never use id selectors in CSS.
    • - Keep selectors short. The best selector is a single class or element!

    Referenced from CSS Architecture - Best practices
     
    Therefore we should be using the class on the <a> for the tabledrag icon.

  4.  

  5. The CSS in the patch subsequently needs to be put in a *new* component file that matches the class name to follow the SMACSS conventions. For further explanation take a peek in other files in the components CSS folder.

Thanks

idebr’s picture

Thanks for the patch, Rachel. I did a review on 8.1.x:

  1. +++ b/core/themes/bartik/css/components/table.css
    @@ -47,6 +47,17 @@ tr th {
    +  overflow: hidden;
    

    This line has no visual effect on the tabledrag component and can be removed.

  2. +++ b/core/themes/bartik/css/components/table.css
    @@ -47,6 +47,17 @@ tr th {
    +tr.draggable a.tabledrag-handle {
    

    The selector can be simplified to .tabledrag-handle

  3. +++ b/core/themes/bartik/css/components/table.css
    @@ -47,6 +47,17 @@ tr th {
    +  margin-left: -0.5em; /* LTR */
    

    This margin adds indentation to the drag handle, which removed the vertical alignment with the row header. This change seems unnecessary to me, I would like to suggest we follow Seven and align the tabledrag handle with the row header.

  4. +++ b/core/themes/bartik/css/components/table.css
    @@ -47,6 +47,17 @@ tr th {
    +  border: none;
    

    By using border-bottom-width: 0; the border is effectively removed.

  5. +++ b/core/themes/bartik/css/components/table.css
    @@ -47,6 +47,17 @@ tr th {
    +[dir="rtl"] tr.draggable a.tabledrag-handle {
    

    This statement can be removed if the margin-left above is removed.

  6. +++ b/core/themes/bartik/css/components/table.css
    @@ -47,6 +47,17 @@ tr th {
    +tr.draggable abbr.tabledrag-changed {
    

    This selector can be simplified to abbr.tabledrag-changed in line with Seven.

emma.maria’s picture

@idebr! It's so good to see you!

I agree with all of #22 apart from the tr.draggable abbr.tabledrag-changed { styles are out of scope for this issue, the abbreviated text on the end of a block title has nothing to do with the tabledrag icon itself. So these changes can be removed please :-)

NitinSP’s picture

Assigned: Unassigned » NitinSP
rachel_norfolk’s picture

are you still doing something with this, NitinSP, or do you want to un-assign yourself?

NitinSP’s picture

FileSize
180.49 KB

Hi Rachel,

This underline issue in firefox is resolved and as well as do the changes as per comment #22, please review the patch.

NitinSP’s picture

As per comment number #18 resolved this dotted underline issue in firefox.

NitinSP’s picture

Status: Needs work » Needs review
NitinSP’s picture

Assigned: NitinSP » Unassigned
rachel_norfolk’s picture

Removing the out-of-scope change, as per #23.

Looks good apart from that, NitinSP!

NitinSP’s picture

Assigned: Unassigned » NitinSP
NitinSP’s picture

Assigned: NitinSP » Unassigned
emma.maria’s picture

Hi @NitinSP, thanks for the updated patch.

The dotted underline on the abbreviation is out of scope for this issue. We are only focussing on the tabledrag icon itself.

I have stated this clearly in #21 and #23.

The following code needs to be removed.

+++ b/core/themes/bartik/css/components/table.css
@@ -45,8 +45,17 @@ table tbody tr th {
+abbr.tabledrag-changed {
+  text-decoration: none;
 }

Thanks!

emma.maria’s picture

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

Status: Needs work » Needs review

Ah! I had this issue open for a long time and didn't see the updated patch from @rachel_norfolk. Putting back to "Needs review".

emallove’s picture

Assigned: Unassigned » emallove
emallove’s picture

emallove’s picture

emallove’s picture

emallove’s picture

Assigned: emallove » Unassigned
davidmcgee’s picture

Drupalcon NOLA 2016 Reviewed and tested. It is working

armyguyinfl’s picture

armyguyinfl’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +neworleans2016
armyguyinfl’s picture

Version: 8.1.x-dev » 8.2.x-dev
davidmcgee’s picture

This is reviewed and tested successfully.

rachel_norfolk’s picture

Issue tags: +Needs screenshots

Hi davidmcgee - can you create and attach screenshots, using the browsers affected by the issue, from before and after the patch is applied, please?

Thanks

And thanks to you all for working on this!

Rachel

radioflyer’s picture

Issue summary: View changes
FileSize
12.97 KB
14.01 KB

I have attached screenshots of the fix in Chrome and FireFox.

akalata’s picture

Status: Reviewed & tested by the community » Needs work

HI radioflyer,

Having "before" screenshots, in addition to the "after", would be helpful. The before screenshots earlier in this issue are of a different interface, with makes it difficult to compare.

Also, I noticed in the screenshots that the bottom arrow of the icon is being cut off. This should be addressed.

nathanc’s picture

nathanc is working with edutrul on this issue at drupalcon 2016

we are going to upload the before and after screenshots within the correct interface

nathanc’s picture

FileSize
93.49 KB
85.27 KB

These are the before and after applying the patch images...

BEFORE
the before patch image

AFTER
the after patch issue

This is for RTBC

edutrul’s picture

Issue summary: View changes
edutrul’s picture

Status: Needs work » Reviewed & tested by the community
star-szr’s picture

Assigned: Unassigned » star-szr
aburrows’s picture

This is emallove first patch to Drupal 8 core, I mentored him on getting this in.

Manjit.Singh’s picture

patch https://www.drupal.org/node/2683433#comment-11187379 working fine for me :)

RTBC++

aburrows’s picture

RTBC++

aburrows’s picture

emma.maria’s picture

Assigned: star-szr » Unassigned
Status: Reviewed & tested by the community » Needs review

I need to point out something.

The patch in #37 (which was also duplicate posted in #38 and #39) has none of the same content as the patch that was 99% close to RTBC in #30.

The code in #37 does not meet CSS coding standards
(we shouldn't have an element in the selector and this code does not belong in elements.css either that file is for raw HTML element styling only).

The patch that should have always been considered for commit is in #30.

Unfortunately there is nothing to suggest that the recent screenshots are for the patch in #30.

Can someone please create review screenshots for the patch in #30 and specify that you have tested that specific patch please?

The CSS is all correct and has been thoroughly reviewed above it, we just need some final screenshots.

Thanks all!

Vidushi Mehta’s picture

@emma.maria I have reviewed the patch #30 and its working fine for me on my windows machine in Chrome and Firefox.
I have added a after screenshots. Please find the attached files.

gnuget’s picture

Ok, I just hide all these outdated patches and just left #30.

Also I put the images of #60 in the description of the issue so we can see how this look with #30.

So I think this RTBC but I will wait for emma.maria in case she wants to give this one final review.

Great work, thanks!

gnuget’s picture

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

Checked on IE and Safari as well.No issue found in that after applying the #30 patch. Added two more screenshots for more clarity.

Manjit.Singh’s picture

I am mentoring vidushi and I have tested it with her. RTBC++ for #30

Vidushi Mehta’s picture

star-szr’s picture

Has RTL testing been done? We are adding LTR comments (which is great!) but not adding RTL rules in #30.

rachel_norfolk’s picture

Sorry to be a pain, but…

In #66, Cottser has brought to my attention that the patch was looking at things outside the scope of the issue; namely, the drag handles habit of hanging around outside of its container. We already have a referenced issue above for that problem - this issue is only for the underlining.

I have updated #30 to simply meet the scope of the issue. It’s a *much* shorter patch than maybe people were expecting!

If someone can review and create screenshots on this 67 patch, I think we are there.

emma.maria’s picture

Status: Needs review » Reviewed & tested by the community
star-szr’s picture

Status: Reviewed & tested by the community » Needs work
FileSize
9.91 KB

Nice, I like keeping this focused. Thanks @rachel_norfolk!

The hover state looks like it needs a bit of work. The text jumps up and there is a solid 3px border on the bottom. Well these are definitely related of course :)


Hover state in block UI

Edit: @rachel_norfolk can you please add the related issue you mentioned as a related issue here? I looked quickly but didn't find it referenced here.

gnuget’s picture

Status: Needs work » Needs review
FileSize
451 bytes
387 bytes

Ok, In this patch I just fixed the problem exposed at #69

ccjjmartin’s picture

#70 Looks good to me.

I functionally tested on El Capitan running the latest versions of the following browsers:

Chrome
Firefox
Safari

They all look similar to this when not hovering:

2683433-71-no-hover-chrome

They all look similar to this when hovering:

2683433-71-hover-chrome

gnuget’s picture

Hi ccjjmartin!

This one seems ready to go, Can you RTBC this patch, please?

Thanks!

Manjit.Singh’s picture

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

I am working on this during DevDaysMilan,
I have tested it manually on local, Looks good to me :) moving it to RTBC.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 0fb2352 and pushed to 8.2.x. Thanks!

As a CSS fix for Bartik, committing to 8.2.x only.

  • alexpott committed 0fb2352 on 8.2.x
    Issue #2683433 by rachel_norfolk, kostyashupenko, emallove, NitinSP,...

Status: Fixed » Closed (fixed)

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

Vidushi Mehta’s picture