Comments (2)
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.
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)
- Zero-number children is not displayed
- How to make work with @each loop HOT 3
- What's the best way to use styles on existing components? HOT 1
- Classes mixing
- preact-cli-decss HOT 1
- Add class prop alias for className for Preact
- Define component tag in CSS HOT 5
- Parcel HOT 3
- TypeScript support
- Add reasonable error message for imports
- Make it work with extract-text-webpack-plugin HOT 1
- Example with Media Queries? HOT 2
- refs are attached to the decss wrapper
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nyancss.