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

    How to prevent CSS conflicts when creating a UI component using Quasar app extension?

    [v1] App Extensions
    3
    5
    276
    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.
    • G
      greenzone last edited by greenzone

      I am creating a Quasar App Extension for a UI component that I plan to distribute via NPM. I have created the UI component. However, when I place it on various websites then the CSS conflicts are leading to a broken UI. I am familiar with VueJS and I have used Quasar for building applications.

      As we can use Quasar in existing project, I believe, that someone must have faced this issue.

      How to develop a UI App Extension that can be used on multiple websites without breaking existing UI?

      What I am planning?

      • Append some text to all the CSS rules. This will change the names of all the rules and likely prevent CSS conflicts
        • I need suggestions for a smart way to do this
      • Write the whole plugin from scratch just using VueJS and CSS
      dobbel 1 Reply Last reply Reply Quote 0
      • G
        greenzone last edited by

        Update on the first plan: I am using a PostCSS plugin to append some text to all the CSS rules. Will update further.

        1 Reply Last reply Reply Quote 0
        • dobbel
          dobbel @greenzone last edited by

          @greenzone

          Just very curious of what you’re doing. So you are building a standalone Quasar App Extension, with a UI component.

          So does that mean that your Quasar extension can be used outside of Quasar Apps?

          If so then why did you choose to create your standalone ‘UI widget’ as a Quasar App extension instead of using Quasar’s UMD to avoid css conflicts?

          G 1 Reply Last reply Reply Quote 0
          • G
            greenzone @dobbel last edited by greenzone

            @dobbel said in How to prevent CSS conflicts when creating a UI component using Quasar app extension?:

            So does that mean that your Quasar extension can be used outside of Quasar Apps?

            Yes, this component can be used outside of Quasar applications.

            @dobbel said in How to prevent CSS conflicts when creating a UI component using Quasar app extension?:

            If so then why did you choose to create your standalone ‘UI widget’ as a Quasar App extension instead of using Quasar’s UMD to avoid css conflicts?

            • Familiarity with Quasar, and
            • to get started quickly in presence of fair amount of complexity in the plugin
              are the reasons why I chose Quasar.

            When we build the plugin and use the UMD version generated by the build, then we have to use Quasar’s UMD CSS and scripts in order to get the plugin working.

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

              @greenzone Quasar and official App Extensions follow (for the most part) the BEM methodology for CSS naming. It helps prevent collisions.
              Here are some links:
              https://css-tricks.com/bem-101/
              http://getbem.com/naming/

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