'forms-inline' class should ensure all direct descendants are inline

Created on 13 September 2021, about 3 years ago
Updated 6 June 2023, over 1 year ago

This is a followup from #3224958: Olivero should style Views exposed filters as inline (currently are stacked) /

Within Olivero we're adding the following code which ensures that all direct descendants will be inline (which is the expectation when setting that CSS class)

.form--inline > * {
   display: inline-block;
   margin-top: 0.5625rem;
   margin-bottom: 0;
   vertical-align: top; /* Ensure proper alignment if description is present. */
 }

We should do this within all of Drupal core, as it's a more robust solution rather than relying on the child elements CSS class.

The file /core/themes/claro/css/classy/components/inline-form.css is currently located in the classy directory because it is an exact copy of the Classy theme. However, since the file will be modified, it is recommended to move it outside of the classy directory.

📌 Task
Status

Needs work

Version

11.0 🔥

Component
CSS 

Last updated about 16 hours 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.

  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

  • Field UX

    Usability improvements related to the Field UI

  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

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.

  • 🇺🇸United States bnjmnm Ann Arbor, MI

    Tagging Field UX as there's a good chance of future developments making greater use of inline form elements.

    If there are backwards compatibility concerns with the solution as proposed that don't seem sufficiently addressed by stable, another option is to create a new class that has the proposed changes targeting direct descendants, but keep the current one working as is.

  • 🇮🇳India rckstr_rohan

    The CSS codes are available in the repository.

    grep -r 'form--inline' core/themes/olivero

  • Status changed to Needs review over 1 year ago
  • 🇮🇳India gauravvvv Delhi, India

    Addressed #17, attached interdiff for same. please review

  • Status changed to Needs work over 1 year ago
  • 🇺🇸United States smustgrave

    Why are we adding a css folder to core?

    /core/css/form--inline.css

  • Status changed to Needs review over 1 year ago
  • 🇮🇳India gauravvvv Delhi, India

    I have updated the code in all themes instead of creating a single directory inside the core, as in patch #21. I have updated the patch and attached an interdiff for the same.

  • 🇮🇳India rckstr_rohan

    the issue, summary say Olivero theme but the above patch is for claro, demo_umami and starterkit_theme, looks summary needs to be updated:
    Suggestion:

    The 'forms-inline' class should ensure all direct descendants are inline within all the core themes provided namely: claro, olivero, demo_umami and starter kit

  • 🇮🇳India Aziza Anwari Gujarat

    Checked the patch given on #23 apply cleanly and looks good to proceed

  • Status changed to Needs work over 1 year ago
  • 🇺🇸United States smustgrave

    Could the issue summary be updated for what the target themes are please

  • Status changed to RTBC over 1 year ago
  • 🇺🇸United States smustgrave

    Reread it and the issue summary mentions we should be done in all of core and since those are the themes should be fine.

  • Open in Jenkins → Open on Drupal.org →
    Environment: PHP 8.1 & MySQL 5.7
    last update over 1 year ago
    29,202 pass
  • Status changed to Needs work over 1 year ago
  • 🇫🇮Finland lauriii Finland
    index b5201a78c9..a230e0982f 100644
    --- a/core/profiles/demo_umami/themes/umami/css/classy/components/inline-form.css
    
    --- a/core/profiles/demo_umami/themes/umami/css/classy/components/inline-form.css
    +++ b/core/profiles/demo_umami/themes/umami/css/classy/components/inline-form.css
    
    index b5201a78c9..e762ff9682 100644
    --- a/core/themes/claro/css/classy/components/inline-form.css
    
    --- a/core/themes/claro/css/classy/components/inline-form.css
    +++ b/core/themes/claro/css/classy/components/inline-form.css
    

    At the moment these CSS files are in the classy directory because they are exact copies of Classy. However, not that we are modifying these, it is no longer the case. For that reason, we should move them outside the classy directory.

  • 🇮🇳India narendraR Jaipur, India

    Addressed #28

  • 🇺🇸United States bnjmnm Ann Arbor, MI
    +++ b/core/themes/claro/claro.libraries.yml
    @@ -40,6 +40,7 @@ global-styling:
           css/components/form--select.css: {}
           css/components/help.css: {}
           css/components/image-preview.css: {}
    +      css/components/inline-form.css: {}
           css/components/menus-and-lists.css: {}
           css/components/modules-page.css: {}
           css/components/node.css: {}
    

    This looks good, but the library definition should also have its reference to css/classy/components/inline-form.css: {}
    removed

  • Status changed to Needs review over 1 year ago
  • Open in Jenkins → Open on Drupal.org →
    Environment: PHP 8.1 & MySQL 5.7
    last update over 1 year ago
    29,283 pass
  • 🇮🇳India narendraR Jaipur, India

    Addressed #30

  • Status changed to Needs work over 1 year ago
  • 🇺🇸United States smustgrave

    Since we are moving files can we update the issue summary please.

  • Status changed to Needs review over 1 year ago
  • Open in Jenkins → Open on Drupal.org →
    Environment: PHP 8.1 & MySQL 5.7
    last update over 1 year ago
    29,282 pass, 1 fail
  • 🇮🇳India narendraR Jaipur, India
  • Status changed to RTBC over 1 year ago
  • 🇺🇸United States smustgrave

    Thanks for the IS update.

  • Open in Jenkins → Open on Drupal.org →
    Environment: PHP 8.1 & MySQL 5.7
    last update over 1 year ago
    29,301 pass, 1 fail
  • Open in Jenkins → Open on Drupal.org →
    Environment: PHP 8.1 & MySQL 5.7
    last update over 1 year ago
    29,303 pass, 1 fail
  • 🇺🇸United States bnjmnm Ann Arbor, MI

    I'm seeing some regressions with this change. It's probably worth checking all usages of .form--inline and making sure they continue to look OK.

  • Assigned to ravi kant
  • Status changed to Needs work over 1 year ago
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • Open in Jenkins → Open on Drupal.org →
    Environment: PHP 8.1 & MySQL 5.7
    last update over 1 year ago
    Patch Failed to Apply
  • 🇮🇳India ravi kant Jaipur

    The issue appears when the "Exposed form" is displayed in a block. During the display "Exposed form" in the block, the form--inline class adds on outer div instead form tag. so fixed the issue according to it and created a patch.

  • Status changed to Needs work over 1 year ago
  • 🇺🇸United States bnjmnm Ann Arbor, MI

    Probably best to disregard #40, but hopefully the feedback here helps you give it another shot @ravi kant

    The issues reported in #38 are happening in the Claro theme

    The change in #40 is being made to the Olivero theme. This would have no impact whatsoever.

    In addition, the changes were made to form.css. Olivero and Claro changes need to be made to .pcss.css files, then the build process creates the css files.

    Nothing in #38 deals with views exposed forms so that's probably not the place to target. Also, screenshots of html isn't particularly helpful, but seeing how it appears as an actual styled page can be helpful.

  • 🇺🇸United States bnjmnm Ann Arbor, MI

    Currently the issue summary explains this change should happen Olivero is doing it. #38 points out there are regressions. The issue summary should be updated to better explain why this is a beneficial change. If that is documented, we can better decide if making the actual potential-regression-causing change is worthwhile.

  • 🇺🇸United States bnjmnm Ann Arbor, MI
Production build 0.71.5 2024