Skip to content

Conversation

denisborovikov
Copy link
Contributor

Result of discussing started in #11

import theme from './section.css';

const Section = () => (
  <section className={theme.content}>
    <Button theme={theme} namespace="button" />
  </section>
);
/* Section.css */
.content {
  border: 1px solid red;
}

.buttonContent {
  color: red;
}

If namespace prop set, only namespaced keys will be passed to the component within theme. I.e. content will be dropped, buttonContent will be converted to content.

@javivelasco
Copy link
Owner

Amazing, thank you so much!

The only thing that worries me a bit is the usage of a namespace property instead of something like themeNamespace. It's cleaner this way but I wonder if somebody may find it troublesome. What do you think? should be use a more specific prop name?

Great work!

@denisborovikov
Copy link
Contributor Author

Thank you!

Let's make it clear. I've renamed namespace to themeNamespace.

@javivelasco
Copy link
Owner

Great! I think it's better like this. Also (in another issue) I think we should make homogeneous props namespacing compose the same way: themeCompose instead of composeTheme :)

@javivelasco javivelasco merged commit ceb27c6 into javivelasco:master Aug 22, 2016
@denisborovikov
Copy link
Contributor Author

And update documentation as well :) Thank you for the merge.

@klimashkin
Copy link

klimashkin commented Oct 29, 2016

And update documentation as well :) Thank you for the merge.

I accidently found namespaces support by searching word 'namespace' in themr.js, assuming it should be somewhere there.
Not by reading docs. Namespacing is the most demanded feature, using react-css-themr people independently come to question like was describe in #11. So, docs are really needed for newcomers)

@javivelasco
Copy link
Owner

You are right @klimashkin I'm opening an issue to update the docs. I'll try to do it as soon as possible but I'm really lacking time so contributions are very welcome on this

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.

3 participants