Refactor Claro's "node form" layout to not use floats

Created on 20 June 2022, over 2 years ago
Updated 19 March 2023, over 1 year ago

Claro's node form's layout is handled by floats that were originally written for the Seven theme back in the dark ages of CSS.

This task is to refactor this to use either Grid of Flexbox. There should be no visual or functional differences. Care must be taken not to break focus order.

๐Ÿ“Œ Task
Status

Fixed

Version

10.1 โœจ

Component
Claroย  โ†’

Last updated 2 days ago

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States mherchel Gainesville, FL, US

Live updates comments and jobs are added and updated live.
  • CSS

    It involves the content or handling of Cascading Style Sheets.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia gauravvvv Delhi, India
  • @gauravvv opened merge request.
  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia gauravvvv Delhi, India
  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Not sure if #10.2 has been addressed either.

    Will need screenshots since .css file changed.

  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia gauravvvv Delhi, India

    I have added before/after patch screenshots for reference:

    Before patch

    After patch

  • Status changed to RTBC over 1 year ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Only nit picky maybe could be
    .layout-region--node-footer .layout-region__content
    but don't think that will hold up the issue.

  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ซ๐Ÿ‡ฎFinland lauriii Finland

    Unfortunately, this introduces some regressions with RTL.

    Before:

    After:

  • Gaurav-drupal โ†’ made their first commit to this issueโ€™s fork.

  • Status changed to Needs review over 1 year ago
  • I have fixed the RTL specific styling. please review

  • Status changed to RTBC over 1 year ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Confirmed the issue on #25 has been addressed.

  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ซ๐Ÿ‡ฎFinland lauriii Finland

    There's no margin on RTL ๐Ÿค”

  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States mherchel Gainesville, FL, US

    Uploading this as a patch, since it's a radical departure from the MR above.

    IMO, this CSS could be radically simplified.

    Because there's multiple rows, it's much easier to use grid than flex
    Both grid and flex have built in RTL support, we should make use of that using the gap property

    I ended up refactoring this down to 32 lines of CSS (from 80 in the MR) and IMHO is easier to understand. PCSS is below (for better readability) and patch is attached.

    /**
     * Layout overrides for node add/edit form.
     */
    .layout-region {
      box-sizing: border-box;
    }
    
    .layout-region--node-footer .layout-region__content {
      margin-top: var(--space-l);
    }
    
    /**
     * Move to two column layout at wider widths.
     */
    @media (min-width: 61rem) {
      .layout-node-form {
        display: grid;
        grid-template-columns: 3fr minmax(360px, 1fr);
        gap: var(--space-l);
      }
    
      .layout-region--node-main,
      .layout-region--node-footer {
        margin-inline: auto;
        width: min(832px, 100%);
      }
    
      /* Push sidebar down to horizontal align with form section. */
      .layout-region--node-secondary {
        margin-block-start: var(--space-l);
      }
    }
    
  • Status changed to Fixed over 1 year ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024