Problem/Motivation

When loading entity browser in iframe and if Claro is active as an admin theme and loaded iframe is in admin path Claro will load it system.admin library which will load next CSS file `css/layout/system-admin--layout.css` which has next CSS rules:

.layout-container {
  margin-right: 1em;
  margin-left: 1em;
}
...
@media screen and (min-width: 38em) {
  .toolbar-tray-open:not(.toolbar-vertical) .layout-container,
  body:not(.toolbar-tray-open) .layout-container {
    margin-right: 3em;
    margin-left: 3em;
  }
...

EB iframe content is also in div.layout-container wrapper. EB also has margin reset rules for this in `/entity_browser/css/entity_browser.entity_browser.css`:

.layout-container {
  margin: 0;
}

But the problem is that Claro rules are for margins are much stronger and will override EB reset rules.

Steps to reproduce

Use EB in iframe, for example the next screenshot is produced with paragraph media add action which uses EB media browser in iframe:

Proposed resolution

There are two ways to fix this:

1. Easy fix is to just add `!important` CSS declaration to EB margin reset rule.

2. It seems that EB iframe does not need any of the Claro `system.admin` library CSS rules. We could try to disable loading of this library for EB iframe routes.

CommentFileSizeAuthor
Screenshot_from_2024-08-09_12-39-45.png348.78 KBpivica
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

pivica created an issue. See original summary.

pivica’s picture

Status: Active » Needs review

Discussed with @berdir and his preference is to go with easiest option for now which would be option 1. MR created.

berdir made their first commit to this issue’s fork.

  • berdir committed b3b3891e on 8.x-2.x authored by pivica
    Issue #3467582 by pivica: Entity browser layout-container margin reset...
berdir’s picture

Status: Needs review » Fixed

Merged.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.