Provide theme support for Claro

Created on 3 August 2020, over 4 years ago
Updated 5 September 2023, over 1 year ago

Purpose/motivation

Layout Builder Modal currently supplies CSS based on the Seven theme to provide an administrative look and feel for the modal, which renders in the context of the site's front-end theme. With the advent of Drupal 9, this module should support, and potentially default to, CSS that mimics Drupal core's Claro theme.

Proposed Resolution

Keep the `theme/seven` declarations in this module. Add equivalent declarations for Claro, registered in a separate theme library. Add a configuration option to this module's settings form that allows sites to choose which administration theme to use.

Original issue description (reported as a bug)

Problem/Motivation

Checkboxes found on Layout Builder Modal windows that include a checkbox fail to be visible. This includes the default Display Title checkbox.

Steps to reproduce

Attempt to place a block using Layout Builder and notice the Checkbox only shows the border, compressed to a vertical 'line'.

The code that is causing this can be seen in the inspector here:

Proposed resolution

Change the CSS to not apply width:auto to checkboxes, and also provide some right margin.

Feature request
Status

Needs work

Version

1.1

Component

Code

Created by

🇺🇸United States himerus

Live updates comments and jobs are added and updated live.
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.

  • Hi!

    I'm using this patch on version Drupal core 10.1.2 and Layout Builder Modal 8.x-1.2.

    My modal needs 2 clicks to be openned and I receive the next error on the first click:

    ajax.js?v=10.1.2:1119 An error occurred during the execution of the Ajax response: The following files could not be loaded: /corporativo/modules/contrib/layout_builder_modal/theme/claro/css/table.css?s0icd922

    I noticed that is missspelled and is missing an 's' after 'table.css'. It should be 'tables.css'.

    I'm attaching the new patch. Is exactly the same, with this error fixed.

    Thanks!

  • 🇨🇦Canada phjou Vancouver 🇨🇦 🇪🇺

    Just tried the patch #22, it doesn't work for me.

    First the library is not even added for me, it might be a different bug. I suspect that because the configure block is an ajax request, the #attached from the form are not added into the page.

    But even when adding manually that into a preprocess_page, the styling is definitely not great.
    $variables['#attached']['library'][] = 'layout_builder_modal/claro';
    I noticed some changes though, like fixing the z-index of the modal, or button styles, but lots of it doesn't look good, wrong color of the modal header, close button invisible, selects/checkboxes are not styled.

  • 🇮🇹Italy kopeboy Milan

    +1! How can this show the option to use "Administration (Seven)" when it's not even installed on my site?!
    And shouldn't the default theme be the default drupal core admin theme, ie. Claro?

    Also, why do we need to provide custom CSS when in core we already have everything styled & coherent?
    Dialogs are used by Claro so I don't understand why we should override it with ugly jQuery-like dialogs.
    Maybe it's a matter of the HTML & CSS classes produced by this module?

    I think we should align those.

    layout_builder_modal mess with styles:

    example of a beautiful dialog provided by core with claro theme:

    PS: yes, I'm using the admin theme when editing content, so that should be used on the modal form as well.

  • 🇺🇸United States mark_fullmer Tucson

    +1! How can this show the option to use "Administration (Seven)" when it's not even installed on my site?!
    And shouldn't the default theme be the default drupal core admin theme, ie. Claro?

    Also, why do we need to provide custom CSS when in core we already have everything styled & coherent?

    For all the reasons stated here, this is why the module Layout Builder iFrame Modal is preferable! See https://www.drupal.org/project/layout_builder_modal/issues/3163024#comme... Provide theme support for Claro Needs work

    If there is a reason why you can't switch to that module, please explain!

  • 🇨🇦Canada amykhailova

    2 cents here. I have been using layout builder iframe modal until we ran into AJAX issues of adding media to the blocks in the modal. Then we switched back to this module and the issue was gone. I don't remember all the details but basically there was an error in the console and the media wasn't attached. It started with updates to D10 for D9 the module worked just fine. So I wonder if iFrame isn't going to work in all situations

  • 🇺🇸United States mark_fullmer Tucson

    I don't remember all the details but basically there was an error in the console and the media wasn't attached. It started with updates to D10 for D9 the module worked just fine.

    Hrm... our team uses Layout Builder iFrame Modal and has many components that involve media uploads, and haven't encountered any issues. Our setup could be different than yours, however. If it's not too much trouble to test again and see if you can reproduce, and then report any issues in the Layout Builder iFrame Modal queue, that would be awesome. If it is a generalized issue, fixing it in that module could be an easier solution than moving this issue for Layout Builder Modal forward.

Production build 0.71.5 2024