How can I style Drupal 8 modal window to achieve Instagram style and behaviour?

I'm creating modal through extending ControllerBase class, thus have full control of content. However I can't figure it out how to control outer DIV with ui-dialog classes.

class CustomModalController extends ControllerBase {

  public function modal($nid) {

    $options = [
      'dialogClass' => 'popup-dialog-class',
      'width' => 'auto',
      'height' => 'auto',
    $response = new AjaxResponse();
    $response->addCommand(new OpenModalDialogCommand(t('Modal title'), $html, $options));

    return $response;

  • Your code looks good... I'd start backtracking through OpenModalDialogCommand::render() to the ajax command openDialog. – Ryan Hartman Mar 10 at 5:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.