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

Proof-of-concept for theme props approach #29

Closed
wants to merge 1 commit into from

Conversation

davidtheclark
Copy link
Contributor

Relates to #26

The first commit on this PR does a few things:

  • Modify the Button component to have a theme prop that fits the convention proposed in Extend theme* props to accept functions that receive the default class list #26: string values are appended, function values replace.
  • Create an applyTheme function that we can use to apply the same convention all over the place.
  • Modify the documentation to de-emphasize theme* props, since they are for advanced users, and explain them all in one place.

If we like this approach, I guess the next step would be to modify all the existing components to follow the new convention. To be clear, it would a breaking change: usage of theme* strings right now would have to adjust to accommodate the change. The intended benefit of the change is to help the most common use case and the less advanced users. If you disagree and think we should just stick with the current theme* behavior — where theme* props take a string and that string replaces the class list wholesale — please let me know! cc @tristen @mapbox/studio @frontend

Here are some shots of what the docs look like:

screen shot 2018-08-03 at 5 15 21 pm

screen shot 2018-08-03 at 5 15 28 pm

screen shot 2018-08-03 at 5 15 39 pm

screen shot 2018-08-03 at 5 15 46 pm

@davidtheclark
Copy link
Contributor Author

Throwing this out in favor of removing theme* props, as described in #26

@davidtheclark davidtheclark deleted the theming-new-components branch August 8, 2018 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant