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 do responsive typography

    Help
    3
    4
    567
    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.
    • E
      Ewa last edited by

      Hi

      I need that my header text should be h4 on desktop screen, but h5 on tablets and mobiles. But something like:

      <div class="text-h4-sm text-h5 q-my-lg text-center">{{ title }}</div>
      

      won’t work and I can’t found how to do it in documentation.

      metalsadman qyloxe 2 Replies Last reply Reply Quote 0
      • metalsadman
        metalsadman @Ewa last edited by metalsadman

        @Ewa use computed class (you will find it in Vue docs) and quasar platform plugin .ie

        <.. :class="computedClass + ' q-my-lg text-center'" .. >...
        ...
        computed: {
          computedClass () {
           return this.$q.platform.is.desktop ? 'text-h4-sm' : 'text-h5'
        ...
        

        see https://quasar.dev/options/platform-detection#Introduction, there’s no detection for tablet (see properties), you can also use screen plugin https://quasar.dev/options/screen-plugin#Introduction, to check for screen sizes instead.

        1 Reply Last reply Reply Quote 1
        • E
          Ewa last edited by

          @metalsadman thank you

          1 Reply Last reply Reply Quote 0
          • qyloxe
            qyloxe @Ewa last edited by

            @Ewa there is this old thread here:
            https://forum.quasar-framework.org/topic/3483/fluid-typography-solved?_=1588065751435

            In it you will find a simple solution for css typography, more thorough discussion and link to rfs library.

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