No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Dialog plugin (v1.0.0-beta.15), how do I style the dialog background? Used to work I think. Bug?

    Help
    2
    5
    595
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • F
      Fancellu last edited by

      this.$q.dialog({
      title: ‘Alert’,
      message: ‘Are you sure you want to delete?’,
      className: ‘bg-red text-white’,
      cancel: true
      }).onOk(() => {
      console.log(‘OK’)
      }).onCancel(() => {
      console.log(‘Cancel’)
      })

      But the dialog is still white, and the background behind it is red. I’m sure this worked fine before is this a bug?

      1 Reply Last reply Reply Quote 0
      • F
        Fancellu last edited by

        https://codepen.io/fancellu/pen/axZOqJ?editors=1010

        1 Reply Last reply Reply Quote 0
        • lucasfernog
          lucasfernog last edited by

          The className prop is applied on QDialog root, so you must create a CSS targeting your className and a child .q-dialog__inner > .q-card

          e.g.

          className: 'dialog-bg-red',
          
          CSS:
          .dialog-bg-red .q-dialog__inner > .q-card {
             background-color: #000;
          }
          
          1 Reply Last reply Reply Quote 1
          • lucasfernog
            lucasfernog last edited by

            To use the same color as bg-red you have to import quasar variables into your style file

            1 Reply Last reply Reply Quote 0
            • F
              Fancellu last edited by Fancellu

              Thanks, got it to work with

              .dialog-bg-red .q-dialog__inner > .q-card > * {
              background-color: #FF0000;
              color: #fff ;
              }

              Also to make the buttons white (blue looked nasty against red background)

              ok: {
              color: ‘text-white’,
              flat: true
              },
              cancel: {
              color: ‘text-white’,
              flat: true
              }

              1 Reply Last reply Reply Quote 0
              • First post
                Last post