craftcms / cms

Build bespoke content experiences with Craft.
https://craftcms.com
Other
3.28k stars 634 forks source link

[5.5.2]: Fields with 25% width are displayed with 50% width #16165

Open jakobhaerter opened 2 days ago

jakobhaerter commented 2 days ago

What happened?

Description

Fields with 25% width get width: 50%, together with 50% fields – even with more than enough space available. I'm guessing there's something wrong with css specificity. This part in the CP CSS seems to be responsible:

#content :not(.meta) > .flex-fields,
#content > .flex-fields,
.draghelper.drag-in-content .flex-fields {
  & > :not(h2, hr, .line-break) {
    &,
    &:last-child {
      // 4 cols for >= 1536px
      @media only screen and (min-width: $minXlUiWidth) {
        &.width-25 {
          width: 25%;
        }

        &.width-50 {
          width: 50%;
        }

        &.width-75 {
          width: 75%;
        }
      }

      // 2 cols when container is > 720px
      @container (min-width: 45em) {
        &.width-25,
        &.width-50 {
          width: 50%;
        }
      }
    }
  }
}

Steps to reproduce

  1. Create a 75% field and a 25% field inside an entry type.
  2. See the 25% wrap into the second row as it gets width: 50%.

Expected behavior

Fields with 25% width should get width: 25% if space is available.

Actual behavior

Fields with 25% width get width: 50%.

Craft CMS version

5.5.2

PHP version

8.3

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

-

brianjhanson commented 2 days ago

Thanks for reporting! Looks like this was an unintended consequence of #16117. I've opened https://github.com/craftcms/cms/pull/16170 to address it.

MoritzLost commented 8 hours ago

@brianjhanson Any ETA on when this fix gets merged and deployed? We can't stay on an earlier 5.5.x version because of #16145, but the latest version broke all our field layouts …