Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow admin theme CSS for dialogs to be used on front-end #2659

Open
quicksketch opened this issue Apr 29, 2017 · 2 comments
Open

Allow admin theme CSS for dialogs to be used on front-end #2659

quicksketch opened this issue Apr 29, 2017 · 2 comments

Comments

@quicksketch
Copy link
Member

In #1725, we encountered an issue where it would be desirable to load the admin theme dialog styling rather than the front-end dialog styling. Take this example of deleting a block from the front-end:

screen-backdrop-pr-1615-cancel-button

As this is an admin-action, it may make sense to have this be styled in the admin theme.

@quicksketch
Copy link
Member Author

This would take some work, but I think it might be doable:

  • In places where we want a front-end dialog to use the admin theme, add a special class to the dialog, such as dialog-admin-theme.
  • Separate all admin theme CSS for dialogs into a separate file (this is already done for Seven).
  • Change or duplicate all classes in the CSS file from .ui-dialog to .dialog-admin-theme.
  • Add a line to the theme .info file for dialog_stylesheets[] = css/dialog.css (or something).
  • If the special class dialog-admin-theme was placed on the dialog, add an AJAX command to load the special dialog CSS file from the current admin theme.

This approach is essentially the reverse of what we do for CKEditor, where the front-end theme is loaded into the editor contents, even though the rest of the page is using the admin theme. We also use a line in the .info file:

ckeditor_stylesheets[] = css/ckeditor-iframe.css

@indigoxela
Copy link
Member

indigoxela commented Sep 22, 2021

I wonder if this ever got implemented elsewhere...

In fact, the admin theme gets applied to dialogs under some circumstances and causes trouble. See #5250

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants