Problem/Motivation

While working on #2919795: Add visual hints that Layout Builder work is in tempstore and will not be lost, or take effect until saved discovered that RTL support is needed for Layout Builder styling in layout-builder.css

Proposed resolution

Add /* LTR */ inline comment where needed
Add RTL styling where needed

Remaining tasks

N/A

User interface changes

API changes

N/A

Data model changes

N/A

Comments

dead_arm created an issue. See original summary.

dead_arm’s picture

Status: Active » Needs review
StatusFileSize
new999 bytes

Adds additional CSS for RTL support.

tim.plunkett’s picture

Looks great! Just super nitpicks left.

  1. +++ b/core/modules/layout_builder/css/layout-builder.css
    @@ -12,10 +12,16 @@
     }
     
    +[dir="rtl"] .new-section__link,
    
    @@ -69,7 +75,12 @@
    +}
    +
    +[dir="rtl"] .layout-section .remove-section {
    

    Other places in core don't have a blank line between these blocks, as they are tightly paired.

  2. +++ b/core/modules/layout_builder/css/layout-builder.css
    @@ -69,7 +75,12 @@
    +  margin-left: -10px;  /* LTR */
    

    Extra double space here between ; and /

dead_arm’s picture

Assigned: dead_arm » Unassigned
StatusFileSize
new763 bytes
new966 bytes

Thank you for feedback, updated patch attached.

tim.plunkett’s picture

Category: Task » Bug report
Status: Needs review » Reviewed & tested by the community

Looks good, thanks!

dead_arm’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new433 bytes
new999 bytes

New patch to adjust the plus icon background image positioning.

tim.plunkett’s picture

Ooooooh, good catch!

+++ b/core/modules/layout_builder/css/layout-builder.css
@@ -12,9 +12,15 @@
   background: url(../../../misc/icons/787878/plus.svg) transparent top left / 16px 16px no-repeat;
...
+  background-position-x: right;

That would mean this line also gets a /* LTR */ comment, right?

tim.plunkett’s picture

Status: Needs review » Needs work
dead_arm’s picture

Status: Needs work » Needs review
StatusFileSize
new639 bytes
new1.06 KB

Added inline comment, interdiff and patch uploaded.

pcate’s picture

RTL support looks good!

Note related to RTL support, but for line #8:

transition: visually-hidden 2s ease-out, height 2s ease-in;

visually-hidden isn't a valid CSS property.

dead_arm’s picture

dead_arm’s picture

Opened https://www.drupal.org/project/drupal/issues/2995143 as a follow up to address CSS transition on new-section.

tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community

Fixes look great, thanks for opening the follow-up.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 9: 2994947-9.patch, failed testing. View results

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

tim.plunkett’s picture

Issue tags: +Needs reroll
kostyashupenko’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new1.18 KB
new1.14 KB

patch rerolled & updated with the correct css-selectors

mark_fullmer’s picture

Assigned: Unassigned » mark_fullmer
mark_fullmer’s picture

Patch coming shortly (DCon Seattle)...

mark_fullmer’s picture

Assigned: mark_fullmer » Unassigned
StatusFileSize
new2.48 KB
new85.67 KB

New patch added with the following motivation:

- The previous patch did not apply against the latest changes in core/modules/layout_builder/css/layout-builder.css (and accordingly, this post does not include an interdiff)
- The original RTL/LTR changes needed to be added to core/themes/stable/css/layout_builder/layout-builder.css

Screenshot of expected changes for testers:

LTR display / RTL display

- Add icon repositioned
- Remove icon repositioned

brad.bulger’s picture

We're trying to test the patch.

brad.bulger’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new52.73 KB
new21.16 KB
new52.61 KB

Applied the patch to 8.8.x and the reported issue looks fixed. Adding blocks with field content, all the controls have swapped sides. The only thing that seemed odd was that inline labels are on the left of the field, but that's how it works without Layout Builder too.

tim.plunkett’s picture

Status: Reviewed & tested by the community » Needs work

Thanks for the work on this! All the additions are correct, just one spot:

  1. +++ b/core/modules/layout_builder/css/layout-builder.css
    @@ -17,7 +17,14 @@
       padding-left: 24px;
    ...
    +  padding-left: 24px; /* LTR */
    

    This property is duplicated now, the first one can be removed

  2. +++ b/core/themes/stable/css/layout_builder/layout-builder.css
    @@ -17,7 +17,14 @@
       padding-left: 24px;
    ...
    +  padding-left: 24px; /* LTR */
    

    Same!

mark_fullmer’s picture

Status: Needs work » Needs review
StatusFileSize
new862 bytes
new2.55 KB

Whoops! Duplication removed. All other changes are the same. Ready for re-review!

nord102’s picture

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

Reviewed the interdiff and everything looks good!

alexpott’s picture

StatusFileSize
new1.85 KB
new2.55 KB

We've added a styleint plugin to core to make core's CSS property ordering correct. The new patch makes changes to the order that are not as per the standard.

You can work this out by running yarn run lint:css from the core directory. And can be fixed automatically by doing yarn run lint:css --fix

The patches attached are the result of doing that.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Adding credit to @tim.plunkett and @PCate for comments that had a material affect on the patch.

Committed and pushed 8ea7023787 to 8.8.x and 2d152f0c36 to 8.7.x. Thanks!

  • alexpott committed 8ea7023 on 8.8.x
    Issue #2994947 by dead_arm, mark_fullmer, alexpott, kostyashupenko, brad...

  • alexpott committed 2d152f0 on 8.7.x
    Issue #2994947 by dead_arm, mark_fullmer, alexpott, kostyashupenko, brad...

Status: Fixed » Closed (fixed)

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