Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Cascading Styles #40

Open
SamuelScheit opened this issue Mar 18, 2021 · 3 comments
Open

[Feature] Cascading Styles #40

SamuelScheit opened this issue Mar 18, 2021 · 3 comments
Labels
Question❓ Further information is requested Wontfix 🚫 This will not be worked on

Comments

@SamuelScheit
Copy link

I'm currently working on a themeable react native project and wanted to implement cascading styles with child selectors.
I saw that you wrote in your FAQ, that cascading childs and complex CSS selectors are not supported:

There is no cascade, CSS properties are not inherited from parent elements.
No complex CSS selectors. There is only support for simple CSS class selector that maps 1-to-1 with an element.

and wanted to add this optional feature.
I had a look at the internal react properties and theoretically could make child selectors, however can't subscribe for child element updates.
Do you have any idea how this feature could theoretically be implemented?

@SamuelScheit
Copy link
Author

it would be very easy to support multiple classes className="button primary" if you patch the React.createElement method and add the corresponding style.props for the classNames.

@SamuelScheit
Copy link
Author

oh as already mentioned in issue #3 it would also be possible with babel transform

@kristerkari
Copy link
Owner

kristerkari commented Jul 18, 2021

It's definitely possible to implement cascading styles, but in my opinion it's much work and little benefit to do so.

React Native already provides a functioning way of applying styles, so I think that it's a good idea to stick with it.

@kristerkari kristerkari added Question❓ Further information is requested Wontfix 🚫 This will not be worked on labels Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question❓ Further information is requested Wontfix 🚫 This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants