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 can I use Stylus`s function on global of quasar ?

    Help
    1
    1
    75
    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.
    • R
      ryan3216 last edited by ryan3216

      Hi all,
      There is a function of stylus in local scope. It worked well.
      like this:

      // component/test.vue
      <style lang="stylus" type="text/stylus" scoped>
      px2rem(p)
        $fontSize = 37.5
        (p / $fontSize)rem
      
      .ebook
        position: relative;   // 使用相对布局
        .read-wrapper
          .mask
            .left
              flex:  1 1 px2rem(100)
              background-color #faa0b1
      </style>
      

      But if the function was removed to src/css/app.styl , It didn`t work.

      // css/app.styl
      px2rem(p)
          $fontSize = 37.5
          (p / $fontSize)rem
      // component/test.vue
      <style lang="stylus" type="text/stylus" scoped>
      .ebook
          position: relative;   // 使用相对布局
          .read-wrapper
            .mask
              .left
                flex:  1 1 px2rem(100)
                background-color #faa0b1
      </style>
      

      I want to set a function on global (i.e. src/css/app.styl), and use it in local file (i.e. src/components/XXXX.vue).
      I will appreciate this if any help. Thanks.

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