react-nodegui icon indicating copy to clipboard operation
react-nodegui copied to clipboard

StyleSheets like React Native (for tooling interoperability)

Open skotchpine opened this issue 3 years ago • 2 comments

Having the same (or similar) APIs to react native means we can share tooling. In my case, I'd like to use react-native-tailwindcss, but can't

I'd like to be able to use javascript objects to style components, like react native does (though the features shouldn't be 100% same, probably.

Is it reasonable? How would we implement this?

skotchpine avatar Jul 10 '21 16:07 skotchpine

Hi

I did something similar to RN stylesheets here: https://github.com/Solant/nodegui-stylesheet You can create a main stylesheet with all reused utility classes

However, there are some differences between regular CSS, RN styles, and Qt CSS, so they won't be 100% compatible

edit: Also there are some new pseudo-elements presented from Qt: https://doc.qt.io/archives/qt-4.8/stylesheet-syntax.html (like QComboBox::down-arrow) so sometimes you just have to get back to plain/inline CSS stylesheets

Solant avatar Jul 10 '21 18:07 Solant

That's pretty close to what I was looking for.

I'll see how I can get around the unit function and avoid actually calling create.

skotchpine avatar Jul 10 '21 19:07 skotchpine