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
    1. Home
    2. sandroden
    • Profile
    • Following 0
    • Followers 0
    • Topics 12
    • Posts 26
    • Best 3
    • Groups 0

    sandroden

    @sandroden

    5
    Reputation
    34
    Profile views
    26
    Posts
    0
    Followers
    0
    Following
    Joined Last Online
    Location Usmate Velate - Italy

    sandroden Follow

    Best posts made by sandroden

    • RE: How to style q-btn with :to

      Thanks @metalsadman, that is exactly what I referred to with using explicitly. I hoped there was a way to ask q-btn :to to behave the same way, that would keep the syntax very symple.

      posted in Framework
      sandroden
      sandroden
    • How to style q-btn with :to

      Hi,

      I’m trying to style a q-btn in a toolbar with :to prop as a way to navigate. While q-list item with :to prop set css class a.q-router-link--active--exact that allow an easy styling, q-btn does not. Am I using the wrong element for that purpose? How am I supposed to detect which is the active button?

      My code in MyLayout is roughly:

      <q-toolbar class="q-pt-md bg-primary text-grey-10">
              <router-link to="/"> <q-img ...  /></router-link>
              <q-space />
              <div class="gt-sm">
                <q-btn stretch flat label="base scout"  size="1em" :to="{name: 'base'}" />
                <q-btn stretch flat label="info"  size="1em" :to="{name: 'info'}" />
                <q-btn stretch flat label="foto"  size="1em" :to="{name: 'foto'}" />
      

      Clearly I can use router-link explicitly and that works but :to on the button is a terse and nice syntax. I’d like to understand if the missing css class is the desired behaviour or not.

      Thanks in advance
      sandro

      posted in Framework
      sandroden
      sandroden
    • RE: scrollToElement with a fixed header

      I solved this by forcing the offset in the scrollToElement function. I subtract the offsetTop of the element that has the “scroll” class.
      So my final working function is:

      scrollToElement (el) {
        const target = getScrollTarget(el)
        const offset = el.offsetTop - target.offsetTop // adjust the scrolling
        const duration = 100
        setScrollPosition(target, offset, duration)
      }
      

      UPDATE: The adjustment (- target.offsetTop) is only needed if the scrollable element is not positioned. In that case el.offsetTop is referred to the offsetParent that is the closest positioned ancestor.

      posted in Framework
      sandroden
      sandroden

    Latest posts made by sandroden

    • Documenting components as in quasar.dev

      Hi,
      is there a tool to generate documentation same functionalities as in quasar.dev, ie: API in a simple to browse place and examples?
      I’m mainly a Python programmer and in that language Sphinx is used by most people due to its great instrospection possibilities. What is there available for vuejs/quasar containers?

      posted in Framework
      sandroden
      sandroden
    • RE: change color site-wise conflicts with "text-color"

      Thanks @rab, I understand that setting the color on the p element makes a difference but is totally impracticable when the content comes from the user via an editor.

      I don’t use any app.sass con (btw I use stylus and quasar.variables.stylus), but that doesn’t seem a solution to me.

      The main problem is that text-color applied on the parent will have low impact in some circumtancies, links in particular as those are already directly styled by the user agent, so that to style them the only solution I see is to address them directly (a {color: ...}) or with the class text-color.

      In my original case I wanted to style buttons in a router-link in the toolbar and the only option I had was to attach color to each of them.
      I I use:

      * {
         color: brown ;
      }
      

      the style is set everywhere and you cannot almost override (unless inline). Even `<q-btn text-color=“red”> will fail. I you use

      body {
         color: brown ;
      }
      

      everything seems ok apart from ‘a’ element, in that case the color is blue… (I guess a browser’s default). Adding body a makes it almost ok with something I have not been able to understand. I cant undertand why a button within a router link and a button with to behave differently.
      7a019ac5-0376-4568-a1cc-124c954f1fe7-image.png
      Links in the drawer + q-list style correctly if using text-<color>. A codesandbox example can be found here.

      posted in Framework
      sandroden
      sandroden
    • RE: change color site-wise conflicts with "text-color"

      I solved it by setting color on body element. This curiously leave non styled the menu button (toolbar > div > router-link > q-btn) that gets a purple color on firefox and a blue color on chrome. I wasn’t able to find where does it come from and why. Any hints?

      posted in Framework
      sandroden
      sandroden
    • change color site-wise conflicts with "text-color"

      Hi,

      I’d like to set a color for fonts site-wise. I used to do that in App.vue in non scoped style section for p element, h* elem…
      I just realized that setting a non-scoped style section there will prevent the possibility to use eg: text-color class that will loose against the specificity of a p element. This is demostrated in this codepen (independent from quasar).

      Is there a working way to set a default color that does not brake the possibility to use text-color classes?

      sandro

      posted in Framework
      sandroden
      sandroden
    • RE: How to style q-btn with :to

      Thanks @metalsadman, that is exactly what I referred to with using explicitly. I hoped there was a way to ask q-btn :to to behave the same way, that would keep the syntax very symple.

      posted in Framework
      sandroden
      sandroden
    • How to style q-btn with :to

      Hi,

      I’m trying to style a q-btn in a toolbar with :to prop as a way to navigate. While q-list item with :to prop set css class a.q-router-link--active--exact that allow an easy styling, q-btn does not. Am I using the wrong element for that purpose? How am I supposed to detect which is the active button?

      My code in MyLayout is roughly:

      <q-toolbar class="q-pt-md bg-primary text-grey-10">
              <router-link to="/"> <q-img ...  /></router-link>
              <q-space />
              <div class="gt-sm">
                <q-btn stretch flat label="base scout"  size="1em" :to="{name: 'base'}" />
                <q-btn stretch flat label="info"  size="1em" :to="{name: 'info'}" />
                <q-btn stretch flat label="foto"  size="1em" :to="{name: 'foto'}" />
      

      Clearly I can use router-link explicitly and that works but :to on the button is a terse and nice syntax. I’d like to understand if the missing css class is the desired behaviour or not.

      Thanks in advance
      sandro

      posted in Framework
      sandroden
      sandroden
    • RE: scrollToElement with a fixed header

      I solved this by forcing the offset in the scrollToElement function. I subtract the offsetTop of the element that has the “scroll” class.
      So my final working function is:

      scrollToElement (el) {
        const target = getScrollTarget(el)
        const offset = el.offsetTop - target.offsetTop // adjust the scrolling
        const duration = 100
        setScrollPosition(target, offset, duration)
      }
      

      UPDATE: The adjustment (- target.offsetTop) is only needed if the scrollable element is not positioned. In that case el.offsetTop is referred to the offsetParent that is the closest positioned ancestor.

      posted in Framework
      sandroden
      sandroden
    • scrollToElement with a fixed header

      Hi,

      I’m trying to setup a page with a scrollToElement . I have not really understood how I should prepare the parent. I managed to obtain a scrollToElement correctly working if the div with “scroll” class is the outer div in the content area.

      If I have a header (where I place the links that I’d like to stay visible) the scroll has a wrong offset.
      I prepared a codesandbox to show the two different situations.
      Which is the suggested solution for this kind of layout/request?

      thanks in advance
      Sandro

      posted in Framework
      sandroden
      sandroden
    • RE: Table width and table's scrollbar

      Thanks Scott! I don’t even remember why that was there…
      Your help as always is incredibly valuable!

      posted in Framework
      sandroden
      sandroden
    • Table width and table's scrollbar

      Hi,

      I don’t understand how scrollbar works in tables.

      If I set the width and is less than required to represent the data, the scrollbar appears. If I don’t set the width, the page just enlarges beyond the left side and the scrollbar of the page appears that makes the pagination and search field to be hidden.

      What’s the normal way to set the width to “the max that is visible” ie: 100vw - the width of the drawer(s) (unless they are in overlay mode…

      I have a codepen here, in case it’s not clear

      sandro

      posted in Framework
      sandroden
      sandroden