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

    Overriding error style for Input

    Help
    2
    3
    623
    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.
    • A
      AdrianG last edited by

      Hi

      I’m trying to learn CSS and is in a situation where I’m looking for a way to override the style when error prop in Input field is set to true
      The simple change is just to get rid of the icon, while keeping the red borders. I’m not sure if it’s possible just to get rid of the icon, so I might have to create a new style just to add the red border

      I tried to go through the styles used for the elements in Input field to see if I could figure out how to do it, but so far no luck

      Any help would be greatly appreciated

      1 Reply Last reply Reply Quote 0
      • s.molinari
        s.molinari last edited by

        An easy way to remove the icon via CSS is to add this to your component.

        .q-icon {
          display: none;
        }
        

        However, that would mean you can’t use any icons for other purposes, and that wouldn’t be very useful.

        What you can do is simply empty the icon definition for the error icon. See this codepen for how:

        https://codepen.io/smolinari/pen/GRJbmWQ?editors=1010

        Scott

        A 1 Reply Last reply Reply Quote 1
        • A
          AdrianG @s.molinari last edited by

          @s-molinari
          Great, thanks 🙂
          I’m using the option for removing the icon from the iconset. I can it only hides the icon, but still keeps space for it, causing the label not to use the full space. This is fine as I’ll just use stack-label on the fields

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