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 use SASS variables in template

    Framework
    2
    3
    312
    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.
    • I
      imagine last edited by

      I would like to use SASS variable in the template as follows:

      <circle fill="$primary" class=“breath-circle” cx=“50%” cy=“50%” :r=“radius” />

      Is it possible?

      beets 1 Reply Last reply Reply Quote 0
      • beets
        beets @imagine last edited by

        @imagine You can use Quasar’s color helper:

        <template>
          <circle :fill="primary" class=“breath-circle” cx=“50%” cy=“50%” :r=“radius” />
        </template>
        <script>
        import { colors } from 'quasar'
        export default {
          data() {
            return {
              primary: colors.getBrand('primary')
            }
          }
        }
        </script>
        
        1 Reply Last reply Reply Quote 1
        • I
          imagine last edited by

          @beets Brilliant, thanks!

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