Deeply merging enhancement
See original GitHub issueDeeply merging: theme objects are merged and if a key is present in more than one object, the values for each objects are concatenated.
While this does offer the most flexibility, I think it can be improved to override styles set by parent themes/defaults.
<ThemeProvider theme={global}>
<ThemeProvider theme={specialCase}>
<App />
</ThemeProvider>
</ThemeProvider>
Take this example. I think it would be cool to see specific nested styles defined in global overwritten if also defined by specialCase.
@javivelasco If I am understanding correctly, this might be pending work on postcss-apply?
Post Edit:
Note current work arounds are to use selectors that are more specific and/or override using !important
.
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Developers - Deeply merging enhancement - - Bountysource
Deeply merging : theme objects are merged and if a key is present in more than one object, the values for each objects...
Read more >Radar Object Detection Using Data Merging, Enhancement ...
Owing to taking full advantage of data merging, enhancement and fusion, this paper proposes an effective ROD system with only radar images ...
Read more >Support recursive merging of maps - deepmerge function
Concatenate the new sequence onto the end of the original sequence. Treat the element indices as if they were mapping keys and do...
Read more >deep merge objects with AngularJS - Stack Overflow
Angular 1.4 or later. Use angular.merge : Unlike extend() , merge() recursively descends into object properties of source objects, performing a deep copy....
Read more >Don't Fear the Repo: Enhanced Git Flow Explained - Toptal
All features accumulated in the develop branch up to some cut-off point will shape the new release. Squash Merges. I strongly recommended using...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I would actually be super interested in merging themes in ThemeProvider if there was already ThemeProvider higher in component tree. We have a multi-module application where you would define styles in app root (first ThemeProvider) and then modify them on per module basis.
Would you be ok with such change? I am willing to make a pr, if needed.
In any case it’s better if you check the priority of the selector in the browser and boost your own by replicating the same plus a classname for example. I have to revisit react toolbox styles to try to reduce specific selectors as much as possible.
Anyway apply will solve some issues soon 😃