The styling of the dialog element needs adjusting.

Created on 19 January 2024, 8 months ago
Updated 26 January 2024, 8 months ago

Problem/Motivation

Currently, when a dialog element is displayed as data-dialog-type="modal" it looks fine. Using data-dialog-type="dialog" instead, the styling is very off.

We did some basic styling in "dialogNative.css" but further work needs to be done here.

Steps to reproduce

Create an ajax dialog link using the WYSIWYG editor and copy in:

<a class="use-ajax" 
    data-dialog-options="{&quot;width&quot;:400}" 
    data-dialog-type="dialog" 
    href="/node/1">
    First article displayed in modal dialog.
</a>

Source: https://www.drupal.org/docs/develop/drupal-apis/ajax-api/ajax-dialog-boxes

Proposed resolution

Adjust styling of the dialog element "dialog" dialog type. The modal dialog element might also need some styling. That should also be checked please.

Only core component styles (sizes, position, ...), no "design", which is a core / contrib theme task.

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Active

Version

1.0

Component

Code

Created by

🇩🇪Germany Grevil

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Grevil
  • 🇩🇪Germany Anybody Porta Westfalica
  • 🇩🇪Germany Anybody Porta Westfalica
  • 🇩🇪Germany Anybody Porta Westfalica
  • 🇩🇪Germany hexabinaer Berlin, Germany

    Awesome initiative, I've been impatiently waiting for full support on the html element - thanks for taking it even a step further!

    As to the styling, avoid overdoing. The required additions should rather go into the core themes. Module-related CSS will just make it harder to override in custom themes whereas native theming support in core should help a lot. After all, this is just an html element ;-)

  • 🇩🇪Germany Anybody Porta Westfalica

    @hexabinaer thanks, yes that's correct! We should eventually try to replicate the previous classes and styling in the adapter CSS as far as it makes sense. For the native css we should do as little as possible / required. Eventually just fixes to the HTML element, if needed.

    Rest should go into core templates.

  • 🇷🇸Serbia finnsky

    I think we need here:

    `dialog.dialog-native:not(:modal) {`

    1. avoid usage of html `dialog`. It is not really good in BEM point of view. Instead it we need simple class `.drupal-dialog` with BEM style elements. EG: `.drupal-dialog__header`

    2. Avoid complexity in CSS https://web.dev/articles/reduce-the-scope-and-complexity-of-style-calcul...
    Everything should be styled with lowest possible CSS complexity. EG: `.drupal-dialog__header` :)
    It was huge problem with jQuery UI `.ui-dialog .ui-dialog-header ... {} `

    3. Use css custom props everywhere. It will give lot of theming options for developers.

  • 🇷🇸Serbia finnsky

    @thomas.frobieter are you still working on it?
    I have some ideas.

  • @finnsky Not started yet, and I can't tell when this will happen, as I am currently very busy. So, feel free to add your thoughts here!

  • Issue was unassigned.
  • 🇩🇪Germany Grevil

    I think @thomas.frobieter is quite busy currently, but a quick review shouldn't be a problem, so feel free to work on it yourself @finnsky! :)

Production build 0.71.5 2024