Skip to content

[6.x] Remove mb-1.5 when no visible content in a Label#14710

Open
martyf wants to merge 1 commit into
statamic:6.xfrom
martyf:fix/remove-label-margin-when-no-visible-content
Open

[6.x] Remove mb-1.5 when no visible content in a Label#14710
martyf wants to merge 1 commit into
statamic:6.xfrom
martyf:fix/remove-label-margin-when-no-visible-content

Conversation

@martyf
Copy link
Copy Markdown
Contributor

@martyf martyf commented May 22, 2026

When a Field is configured to not show the Display Label, the mb-1.5 is still applied.

This PR only applies the mb-1.5 when the label has visible content.

This is related to #14707, and requires that be resolved to be notice.

@jaygeorge
Copy link
Copy Markdown
Contributor

@martyf Hey Marty, cheers for the PR.

I checked this branch out but I still see a margin of mb-2 when hiding a display label:

2026-05-26 at 13 00 19@2x

Let me know if I'm missing something! – here's my blueprint

tabs:
  main:
    display: Main
    sections:
      -
        display: Content
        collapsible: true
        fields:
          -
            handle: title
            field:
              type: text
              required: true
              localizable: false
              validate:
                - required
          -
            handle: content
            field:
              type: markdown
              localizable: true
          -
            handle: hello
            field:
              type: text
              display: Hello
              localizable: false
              hide_display: true
  sidebar:
    display: Sidebar
    sections:
      -
        fields:
          -
            handle: slug
            field:
              type: slug
              localizable: true
              validate:
                - 'max:200'
                - 'new \Statamic\Rules\UniqueEntryValue({collection}, {id}, {site})'
                - 'new \Statamic\Rules\UniqueEntryValue({collection}, {id}, {site})'
          -
            handle: date
            field:
              type: date
              required: true
              default: now
              localizable: false
              validate:
                - required
title: Documentation

@martyf
Copy link
Copy Markdown
Contributor Author

martyf commented May 26, 2026

That's a different issue - see #14707

That is one I tried to fix up, but is deeper than just changing one file (I believe).

The mb-2 and mb-1.5 are both problematic - so while the mb-2 is still there in this branch, it resolves the mb-1.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants