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

    SVG convertor to import as icon

    Framework
    3
    10
    432
    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.
    • N
      ncamaa last edited by

      SVG Formatter
      https://quasar.dev/vue-components/icon#svg-icon-format
      Do we have a script somewhere that does this conversion automatically?
      I mean, paste the <svg> code, click ‘submit’, then get the icon-ready string for import.

      L 1 Reply Last reply Reply Quote 0
      • Hawkeye64
        Hawkeye64 last edited by

        @ncamaa No, but I have been thinking we could create a cli for this…

        1 Reply Last reply Reply Quote 0
        • L
          lazaroofarrill @ncamaa last edited by

          @ncamaa I wrote a tool for that last weekend. svg-stringifier

          1 Reply Last reply Reply Quote 0
          • N
            ncamaa last edited by

            @lazaroofarrill Thanks! Can you explain more about the usage for noob users? Readme wasn’t clear enough for me.

            L 1 Reply Last reply Reply Quote 0
            • N
              ncamaa last edited by

              That what I get after installing: zsh: command not found: svg-stringify

              L 1 Reply Last reply Reply Quote 0
              • L
                lazaroofarrill @ncamaa last edited by

                @ncamaa normal install is for running from package.json if you want to run it from command line install it globally.

                1 Reply Last reply Reply Quote 0
                • Hawkeye64
                  Hawkeye64 last edited by

                  https://github.com/quasarframework/quasar/issues/8662

                  1 Reply Last reply Reply Quote 0
                  • L
                    lazaroofarrill @ncamaa last edited by

                    @ncamaa after installing you pass as first argument to the executable the directory containing your svg icons. It will create inside that directory a js file containing an object with the string versions of the icons.

                    1 Reply Last reply Reply Quote 0
                    • N
                      ncamaa last edited by

                      Thanks a lot, @labarberabarber. It works now. does it support all of the attributes or just the d and the viewBox ?

                      L 1 Reply Last reply Reply Quote 0
                      • L
                        lazaroofarrill @ncamaa last edited by

                        @ncamaa I don’t know the svg specification very well, right now it supports the style and transforms tag. I’ll implement separated style properties later. If you find it doesn’t work for a particular icon, let me have it so I can figure out where I got it wrong.

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