question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Deeply merging enhancement

See original GitHub issue

Deeply 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:open
  • Created 7 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
mpodlasincommented, Mar 8, 2017

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.

1reaction
javivelascocommented, Aug 23, 2016

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 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found