Problem/Motivation

Desktop before:

Mobile before:

Desktop after:

Mobile after:

Testing steps

  1. Install drupal 8
  2. Change admin theme to /admin/appearance to bartik
  3. Create a node /node/add/article
  4. Edit the node
  5. View the form buttons in both >600px and <600px

Proposed resolution

  1. Style the Save button arrow as rounded.
  2. Set preview & delete buttons full width on mobile.

Remaining tasks

  1. Test patch #31 with 8.2.x.
  2. Address dropdown toggle corners
  3. Per comment #38 - "code review and more manual testing"
CommentFileSizeAuthor
#70 submit-buttons-Desktop.png13.54 KBManjit.Singh
#70 submit-buttons-Mobile.png20.06 KBManjit.Singh
#65 2643206-65-after-with-delete.png29.24 KBseanpclark
#65 interdiff-2643206-58-65.txt1.14 KBseanpclark
#65 bartik_fix_button-2643206-65.patch1.65 KBseanpclark
#58 interdiff-2643206-51-58.txt480 bytesaofficer
#58 bartik_fix_button-2643206-58.patch1.48 KBaofficer
#57 2643206-edit-with-delete.png18.23 KBdrnikki
#57 2643206-edit-without-delete.png14.19 KBdrnikki
#53 2643206-save-after-mobile.png25.26 KBaofficer
#53 2643206-save-after-desktop.png17.75 KBaofficer
#52 interdiff-2643206-31-51.txt524 bytesaofficer
#51 bartik_fix_button-2643206-51.patch1.48 KBaofficer
#50 2643206-save-before-mobile.png14.51 KBseanpclark
#50 2643206-save-before-desktop.png14.54 KBseanpclark
#49 interdiff-2643206-19-31.txt406 bytesseanpclark
#39 delete button color.png52.67 KBsyamnath
#35 2643206-35 AFTER.png14.13 KBwaybigsky
#35 2643206-35 BEFORE.png14.83 KBwaybigsky
#31 bartik-form-button-appearance-2643206-31.patch860 bytesRisse
#31 after.png7.26 KBRisse
#31 before.png6.62 KBRisse
#27 buttons.png5.51 KBprateekS
#25 Buttons.png41.46 KBsoumyajit.basu
#19 bartik-form-button-appearance-2643206-19.patch836 bytestherealssj
#17 after-patch.png11.83 KBSakthivel M
#17 bartik-form-button-appearance-2643206-11.patch910 bytesSakthivel M
#16 After_patch.png21.87 KBTruptti
#16 Patch_applied.JPG21.48 KBTruptti
#15 bartik_form_button_appearance-2643206-15.patch794 bytesAnishnirmal
#11 Buttons.png20.49 KBjohnrosswvsu
#11 bartik-form-button-appearance-2643206-11.patch835 bytesjohnrosswvsu
#8 form_css_patch-2643206-8.patch1.04 KBSakthivel M
#8 After.png9.87 KBSakthivel M
#6 buttons-with-delete.png6.63 KBpsebborn
#5 issue-2643206-5-8.patch607 bytesgnuget
#2 buttons.png17.15 KBgnuget
bartik-node-buttons.png6.44 KBChi
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Chi created an issue. See original summary.

gnuget’s picture

FileSize
17.15 KB

Can you provide more info ? I can't replicate the bug, this is how it looks to me:

buttons

Chi’s picture

@gnuget just set Bartik as administration theme. It looks you have tested it in Seven theme.

Btw, 'Delete' link on your screenshot does not look well. Does it?

Chi’s picture

gnuget’s picture

Status: Active » Needs review
FileSize
607 bytes

Not sure if this is the best way to do it but here my first attempt

patch attached.

psebborn’s picture

Status: Needs review » Needs work
FileSize
6.63 KB

The fix in #5 does improve the display of the of the preview button, but if you're editing a pre-existing node, there's a delete button as well which doesn't sit nicely (see screenshot).

Also, rather than using an ID for the CSS selector, I'd use a class, perhaps something like:

.form-actions .button,
.form-actions input { ... }

I'm not that well up on Drupal coding standards though so someone else might be better placed to help you on the specifics!

gnuget’s picture

First I tried using classes instead of the ID but then the .form-actions class could appear in a different non-related page, so I used the ID to force those buttons to look ok on that specific page.

But true, we can use classes and after do manual tests to make sure to it looks ok everywhere.

Sakthivel M’s picture

Hi,
I have created a patch to solve the issue mentioned at #6.

Below is the screenshot After the patch applied

after

Sakthivel M’s picture

Status: Needs work » Needs review
gnuget’s picture

Status: Needs review » Needs work
Issue tags: +Needs manual testing, +Novice

Great work!

Some nitpicks in the last patch.

  1. +++ b/core/themes/bartik/css/components/form.css
    @@ -262,7 +262,7 @@ input.form-submit:focus {
       margin-bottom: 0.4em;
    -}
    +}`
     #edit-actions input {
       margin-right: 0.6em; /* LTR */
    

    We need to remove this change.

  2. +++ b/core/themes/bartik/css/components/form.css
    @@ -280,3 +280,24 @@ input.form-submit:focus {
    +}
    \ No newline at end of file
     
    

    All the files needs to have an extra new line in the end of the file.

Also this is going to need manual testing to make sure to this is not broke something else.

Thanks!

johnrosswvsu’s picture

Hi,

Based on @gnuget updates and @Sakthi M last passed patch, I have created a patch. This is done against 8.2.x and 8.1.x already.

PS: As per @gnuget this still needs manual testing.

Local testing has the following output for me, which confirms fix.

johnrosswvsu’s picture

Status: Needs work » Needs review
Sakthivel M’s picture

@gnuget @johnrosswvsu Thanks!

gnuget’s picture

+++ b/core/themes/bartik/css/components/form.css
@@ -280,3 +280,24 @@ input.form-submit:focus {
+    margin-left: 0;
+    margin-right: 0;
+    margin-top: 10px;

I think we can merge these 3 lines in one.

Anishnirmal’s picture

Hi,
gnuget It's a good suggestion and i have recreated the patch at #8. Good work @Sakthivel M.

 .form-item--error-message {
   color: #e32700;
 }
+
+/**
+ * Improve form element usability on narrow devices.
+ */
+@media all and (max-width: 600px) {
+  #edit-actions input#edit-preview {
+    float: none;
+    margin: 10px 0 0 0;
+    padding-bottom: 6px;
+    width: 100%;
+  }
+  .button--danger {
+    display: block;
+    margin: 10px 0;
+  }
+  .js .dropbutton .dropbutton-action > input, .js .dropbutton .dropbutton-action > a, .js .dropbutton .dropbutton-action > button {
+    text-align: center;
+  }
+}
Truptti’s picture

FileSize
21.48 KB
21.87 KB

Verified the patch ' bartik_form_button_appearance-2643206-15.patch' on drupal 8.0.x site
Steps performed are as follows
1.Installed Drupal 8.0.x and reproduced the issue
2.Applied the patch bartik_form_button_appearance-2643206-15.patch
3.Cleared cached and verified if buttons are aligned properly, but the changes are not reflected for delete button.
Attaching snapshot for reference.

Sakthivel M’s picture

I have recreated the patch for delete button #16

After Patch

patch

emma.maria’s picture

Status: Needs review » Needs work

The code must not contain IDs as this is going against the Drupal CSS architecture coding standards... https://www.drupal.org/coding-standards/css/architecture#avoid-structure

Use classes to assign appearance to markup. Never use id selectors in CSS.

This has already been pointed out in #7.

Please study the coding standards for Drupal Core carefully and try another fix.

Thanks.

therealssj’s picture

Modified the patch in accordance with comment #18
Also made some changes as the style was not getting applied on anchor tags of other pages.

therealssj’s picture

Status: Needs work » Needs review
gnuget’s picture

Also, the delete link doesn't look like a button for a reason this is on purpose because this makes the user to differentiate between the other actions and this one.

I'm not sure if we should just change the appearance of the button.

What do you think emma.maria ?

edurenye’s picture

This also happens if the actions are inside a wrapper that is too small.
It's possible to do it depending on the size of the parent element instead of the size of the screen?
Then it would work in both cases.

harilakshmanan’s picture

Assigned: Unassigned » harilakshmanan
therealssj’s picture

@gnuget in bartik administration theme the delete does look like a button
The only thing we changed was increase width and add margin

soumyajit.basu’s picture

FileSize
41.46 KB

Preview button appears to be fine. Save and publish button needs to be centre aligned

soumyajit.basu’s picture

Status: Needs review » Needs work
prateekS’s picture

FileSize
5.51 KB

I have checked this issue, and have applied patch as mentioned in comment #19, its working fine. I am attaching screenshot for reference.

To check this, i made 'bartik' theme as an admin theme for node add/edit page too, then tested.

prateekS’s picture

Status: Needs work » Needs review
harilakshmanan’s picture

@soumyajit.basu Save and publish button working perfectly when administration theme is bartik. maybe you are choosing your administration theme is seven at the time Save and publish button text does not come at center.

harilakshmanan’s picture

Assigned: harilakshmanan » Unassigned
Risse’s picture

So the issue is that centering the text in the dropdown button looks a bit off center.

Before

So my solution is to add left padding 2em, which is the size of the dropdown toggle on the right side.

After

Attached is the patch for this, otherwise the button seems to look fine.

Risse’s picture

Issue tags: +drupalcampfi
prateekS’s picture

I have checked this issue with patch mentioned in comment #19 and its working fine. I think we should close this issue.

waybigsky’s picture

I'm at MidCamp Drupal Sprint, and I'm looking at this.

waybigsky’s picture

FileSize
14.83 KB
14.13 KB

Just tested the patch on Simplytest.me running 8.0.5. Can also confirm patch at #31 works properly.

iMiksu’s picture

Issue tags: -drupalcampfi

Cleaning up drupalcampfi tags.

emma.maria’s picture

Issue tags: +CSS, +frontend
emma.maria’s picture

Assigned: Unassigned » emma.maria

I am assigning this to myself so I can take a look at this before this goes anywhere near RTBC. This needs at code review and more manual testing than just the specific component you are looking at here.

I also understand that Seven has exactly the same issue here #2643210: Seven theme: Fix text alignment on form submit buttons and we should also compare the work between issues.

syamnath’s picture

FileSize
52.67 KB

Hi I have a suggestion on the presentation of the delete button. I have tried to revert the colors. so that it will be more deletious :)
I am attaching the Mock up
Only local images are allowed.

emma.maria’s picture

Title: Bartik: fix button appearance on node add/edit form (small devices) » Bartik: fix button layout appearance on node add/edit form (small devices)
Version: 8.0.x-dev » 8.1.x-dev

The design of the buttons themselves are out of scope for this issue.

However, we can raise a brand new issue for the theming of the Primary (eg. Save) and Danger (eg. Delete) buttons in Bartik.

@syamnath_zyxware please have a read of these issues about the design of components in the Seven theme and button styles specifically.
Proposal: A Style Guide for Seven
#2278715: Introduce a primary-danger link/button class
#1986074: Buttons style update

emma.maria’s picture

Hi
@Sakthivel M,
@johnrosswvsu,
@Anishnirmal,
@therealssj,
@Risse

When you create a patch can you please please *please* also create and upload an interdiff file.

It shows the differences between your patch and the previous one so a reviewer can clearly see the changes and decisions made between patches.
https://www.drupal.org/documentation/git/interdiff

Thanks!

therealssj’s picture

The css was so small and had a simple change that's why i skipped interdiff.
Will keep that in mind in any future patches.

shinjanidhar’s picture

Status: Needs review » Closed (works as designed)
therealssj’s picture

Status: Closed (works as designed) » Needs review

Why this closed without any discussion?
The patch also hasn't been merged yet!

stpaultim’s picture

Assigned: emma.maria » Unassigned
Issue summary: View changes

Unassigned this from Emma Maria at DrupalCon New Orleans and asked for an interdiff file between the two most recent patches.

emma.maria’s picture

Thanks @stpaultim!

seanpclark’s picture

Hey I'm at Drupalcon New Orleans and I'll work on the interdiff for you.

aofficer’s picture

Im at Drupalcon New Orleans and Im looking at this.

seanpclark’s picture

FileSize
406 bytes

Worked on this with @aofficer. Attached is an interdiff of #31 and #19.

seanpclark’s picture

Version: 8.1.x-dev » 8.2.x-dev
Issue summary: View changes
FileSize
14.54 KB
14.51 KB
aofficer’s picture

This patch scales and rounds corners of the save button.

aofficer’s picture

FileSize
524 bytes

Attached is an interdiff of #31 and #51.

aofficer’s picture

aofficer’s picture

Issue summary: View changes

Status: Needs review » Needs work

The last submitted patch, 51: bartik_fix_button-2643206-51.patch, failed testing.

drnikki’s picture

Status: Needs work » Needs review

I'm reviewing this patch now.

drnikki’s picture

Status: Needs review » Needs work
FileSize
14.19 KB
18.23 KB

This is a HUGE improvement over the unpatched version. The stack with the delete button looks good in desktop and mobile, but without the delete button the rounding is off on mobile. Two screenshots attached:

With delete, looking snazzy
With Delete

Without delete, looking almost snazzy
w/o delete

aofficer’s picture

This patch handles one pixel issue.

aofficer’s picture

Status: Needs work » Needs review
drnikki’s picture

Status: Needs review » Reviewed & tested by the community

There's now a 1px in the other direction, but I'm marking this as RTBC and we can open another issue for the small, teeny, TINY offset.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 58: bartik_fix_button-2643206-58.patch, failed testing.

The last submitted patch, 58: bartik_fix_button-2643206-58.patch, failed testing.

cmanalansan’s picture

Status: Needs work » Reviewed & tested by the community

The test passed. Previous failures a false negative possibly due to Migrate.

emma.maria’s picture

Assigned: Unassigned » emma.maria
seanpclark’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
1.65 KB
1.14 KB
29.24 KB

This patch should address #60 and issues that may arise from different radius units. Rather than apply the radius to multiple elements, this adjusts the position of the parent so that the absolute positioned child (.dropbutton-toggle) honors the overflow:hidden of its container.

After, with delete:
2643206-65-after-with-delete.png

drnikki’s picture

Status: Needs review » Needs work

If the ticket is still open for a pixel nitpick, the grey semi-circle is still a pixel too-high, but I'd mantain it's best to open a second issue for that and get this one merged in.

Only local images are allowed.

drnikki’s picture

Status: Needs work » Reviewed & tested by the community
emma.maria’s picture

Status: Reviewed & tested by the community » Needs review

I'm going to take a look at the latest patch and review the CSS against the Drupal coding before handing it to @Cottser to assess for commit :-)

chetan2111’s picture

Hi,

Tested the functionality and it is working as expected the changes are correct on multiple browsers and mobile devices.

Not moving the status as @emma.maria will review the code.
(Reviewing patch first time!)

Manjit.Singh’s picture

Code looks good to me. I have done some manual testing, here are some screenshots that i captured in narrow device.

buttons

But i have some confusion about the desktop view. There are irrelevant margin in delete button as compared to preview button.
I have already checked the issue description but Is it the part of bartik design ?

buttons

Anishnirmal’s picture

@Manjit.Singh : Can you please suggest me the proposed solution. Is it a part of bartik.? or needs to fix the margin for the delete button.?

starshaped’s picture

Status: Needs review » Reviewed & tested by the community

I reviewed this patch. It fixes the original issues, and I can confirm that the spacing issue brought up in #70 was not introduced by this patch - it exists on a bare install of Drupal 8.2. If we think this is a major problem, a new issue should be created for fixing the spacing.

Manjit.Singh’s picture

@starshaped Agree with the thoughts.
Thanks.

emma.maria’s picture

Assigned: emma.maria » Unassigned
xjm’s picture

Assigned: Unassigned » star-szr

Thanks, all! Assigning to @Cottser as per above.

star-szr’s picture

Issue tags: +rc deadline

This should make it into 8.2.x and can go in during beta. If not it can still go into 8.3.x.

star-szr’s picture

Assigned: star-szr » Unassigned
Status: Reviewed & tested by the community » Fixed
Issue tags: -Needs manual testing

There are definitely some flaws with dropbuttons in Bartik but that's outside of the scope here and I think at least one issue exists already. (Background color of the arrow when hovering, and the arrow background not filling up the entire space.)

This is a big improvement and code-wise looks good. Removing the manual testing tag since that did happen (and I just tested as well).

Committed d9a6637 and pushed to 8.2.x. Thanks!

  • Cottser committed d9a6637 on 8.2.x
    Issue #2643206 by aofficer, Sakthivel M, seanpclark, Risse, gnuget,...

  • Cottser committed d9a6637 on 8.3.x
    Issue #2643206 by aofficer, Sakthivel M, seanpclark, Risse, gnuget,...

  • Cottser committed d9a6637 on 8.3.x
    Issue #2643206 by aofficer, Sakthivel M, seanpclark, Risse, gnuget,...

Status: Fixed » Closed (fixed)

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