Active
Project:
Dialog Native
Version:
1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
19 Jan 2024 at 12:41 UTC
Updated:
26 Jan 2024 at 15:52 UTC
Jump to comment: Most recent
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.
Create an ajax dialog link using the WYSIWYG editor and copy in:
<a class="use-ajax"
data-dialog-options="{"width":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
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.
Comments
Comment #2
anybodyComment #3
anybodyComment #4
anybodyComment #5
grevil commentedComment #6
hexabinaerAwesome 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, please 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 (without the module as a dependency) in core should help a lot. After all, this is just an html element ;-)
Comment #7
anybody@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.
Comment #8
finnsky commentedI 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`
https://en.bem.info/methodology/css/#combining-a-tag-and-a-class-in-a-se...
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.
Comment #9
finnsky commented@thomas.frobieter are you still working on it?
I have some ideas.
Comment #10
thomas.frobieter@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!
Comment #11
grevil commentedI 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! :)