Git Product home page Git Product logo

Comments (2)

kossnocorp avatar kossnocorp commented on May 18, 2024

Hey, thanks for the questions! Here are the answers:

Is it correct that defaultProps accepts a mapping from Component to HTML element/props?

Yes, that's right but decss-loader doesn't use defaultProps. In fact, I completely forgot about this feature that I wrote in the early stages of development.

If so, does this mean you can't use this mapping when using decss-loader?

Yup.

If both of the above are true, could we maybe extend your rules to allow the html element to be specified? I was thinking along the lines of:

That's tricky, but I believe it's possible. Although it will require a lot of changes to css-loader. Initially, I did plan to make it this way (you can see it by the presence of defaultProps) but it turned out to be challenging so I gave up on this. In the end, I used to pass tag whenever I need it, but sometimes I forgot to do so and end up with "div buttons", so I feel your pain.

If you feel brave enough you might try to send a PR to css-loader or make a fork. I'll gladly accept any changes necessary to decss. I've tried to contribute to css-loader once but with no luck.

from nyancss.

Download avatar Download commented on May 18, 2024

Thanks for your response! I actually already cloned the repo and perused the code but I think it's a bit too much for me at the moment to make a PR. But good to see that my understanding was correct. Thanks!

from nyancss.

Related Issues (14)

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.