Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

Support nested theme properties in mapToTheme() #5

Closed
wants to merge 1 commit into from

Conversation

macklinu
Copy link

@macklinu macklinu commented Aug 2, 2017

Just came across this library and have found it very helpful. One thing that would allow me to use mapToTheme() would be to support nested object properties (my theme is a nested object, where the top level keys are namespaces):

// theme.js

export default {
  colors,
  button: {
    foreground,
    background,
    border,
  },
  // etc.
}

Would you be open to adding the dot-prop (or perhaps get-value) module as a dependency to support this feature request?

Thank you! 🙂

@scf4
Copy link
Owner

scf4 commented Aug 26, 2017

Hi @macklinu, thanks for the PR. I wanted to take a look at the dot-prop and get-value packages before responding.

Is there any reason to use dot-prop over get-value? It looks like get-value is slightly smaller and doesn't have any extra dependencies of its own, and we don't need to set props, so I think it would be the best option.

@macklinu
Copy link
Author

Hi @scf4, sorry for the delay, but I've updated the commit to use get-value over dot-prop. Thanks for taking a look and let me know if this is 👍 or if I can make any changes. 😄

@scf4
Copy link
Owner

scf4 commented Oct 23, 2017

Thanks @macklinu, looks good. I'll have time to test and merge this weekend!

@scf4 scf4 closed this Aug 8, 2018
@scf4
Copy link
Owner

scf4 commented Aug 8, 2018

This functionality has been added in 3.1.0-beta

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants