cms icon indicating copy to clipboard operation
cms copied to clipboard

Bard add set button overlaps content on small bard container

Open lecoa opened this issue 1 month ago • 4 comments

Bug description

The issue occurs when the width of the bard field/container is less than 32 rem. When smaller the bard field has reduced padding, see: https://github.com/statamic/cms/blob/566eb8ba117d15e471ba48a0424a7332cb9f359d/resources/css/components/fieldtypes/bard.css#L13-L14

This issue could be resolved by adjusting the offsets for smaller screen: https://github.com/statamic/cms/blob/566eb8ba117d15e471ba48a0424a7332cb9f359d/resources/css/components/fieldtypes/bard.css#L166

How to reproduce

Use a Bard field with the + icon set to always visible while the bard container is smaller than 32rem

Logs


Environment

Environment
Application Name: x
Laravel Version: 10.48.28
PHP Version: 8.2.29
Composer Version: 2.9.2
Environment: local
Debug Mode: ENABLED
URL: x
Maintenance Mode: OFF

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: file
Database: mysql
Logs: stack / daily, flare
Mail: smtp
Queue: sync
Session: file

Statamic
Addons: 6
Sites: 4 (Nederlands, Duits, Engels, Pools)
Stache Watcher: Disabled
Static Caching: Disabled
Version: 5.48.0 PRO

Statamic Addons
aerni/advanced-seo: 2.10.2
aerni/font-awesome: 3.0.2
heidkaemper/statamic-toolbar: 1.3.0
jacksleight/statamic-bard-texstyle: 3.4.1
statamic-rad-pack/runway: 8.1.2
statamic/collaboration: 1.0.0

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

lecoa avatar Dec 05 '25 21:12 lecoa

Can you share a screenshot so I can visualize what you're talking about?

jackmcdade avatar Dec 08 '25 21:12 jackmcdade

@jackmcdade Sure.

Currently the icon overlaps with the first character, which makes selecting hard:

Image

I have already made a PR that fixes this, which moves the button out of the way:

Image

lecoa avatar Dec 09 '25 07:12 lecoa

We should add inner padding on the content then so we can get that + to line up right on the line. It looks heckin' weird just sorta kinda overlapping it a little.

jackmcdade avatar Dec 09 '25 13:12 jackmcdade

So this is what it currently looks like when the bard field is equal or wider than 32rem: Image

The overlapping only happens on the smaller bard field because it reduces the inner padding, which is fine with me since it allows for more text per line.

So to keep it a simple quick fix I suggested to just move the button a little.

lecoa avatar Dec 09 '25 20:12 lecoa