GithubHelp home page GithubHelp logo

Comments (7)

matthew-dean avatar matthew-dean commented on August 20, 2024

I was able to workaround this for my Surplus demo tomorrow with:

            const svgClass = { class: $style.callout__quotation } //...
            <svg
                version="1.1"
                {...svgClass}
                x="0px"
                y="0px"
                viewBox="0 0 48 42.1"
            >

😄

from surplus.

adamhaile avatar adamhaile commented on August 20, 2024

Hmm, good catch. Looks like the HTML-friendly property aliases, which translate class -> className, are firing for SVG too, which they shouldn't. In fact, they should probably fire in reverse, translating className -> class, since we set attributes, not properties, on SVG nodes.

Have to think about this one. There's a quick fix which will get almost all the SVG tags but not all. The ones it would miss would be the tags which are common to both SVG and HTML, like , <title>, etc. To get them, I have to add a little more context to the translation layer. I'd like to make a 100% fix for this.

from surplus.

matthew-dean avatar matthew-dean commented on August 20, 2024

@adamhaile No worries, there's no hurry, I can use the workaround for now.

from surplus.

adamhaile avatar adamhaile commented on August 20, 2024

Whaa? I tried to reply to your workaround and ended up editing it.

Was trying to say that you can also use a small fn to set the class for the time being:

            <svg
                version="1.1"
                fn={el => el.setAttribute("class", $style.callout__quotation)}
                x="0px"
                y="0px"
                viewBox="0 0 48 42.1"
            >

from surplus.

matthew-dean avatar matthew-dean commented on August 20, 2024

@adamhaile Ah, that's also cool. I'll save that for next time!

from surplus.

adamhaile avatar adamhaile commented on August 20, 2024

Should be fixed with 5ceff5b .

from surplus.

adamhaile avatar adamhaile commented on August 20, 2024

Unit tests are passing now, so closing this issue. Let me know if you have any other problems with it!

from surplus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.