react-toolbox / react-toolbox-themr

A tool to statically extract and generate custom themes for React Toolbox
MIT License
240 stars 24 forks source link

Styling component-specific themes #58

Open adrianmcli opened 7 years ago

adrianmcli commented 7 years ago

So I've got a ThemeProvider component that works as expected, but what if I want a specific theme for a specific component? Something like this:

import React from "react";

import ThemeProvider from "react-toolbox/lib/ThemeProvider";
import Button from "react-toolbox/lib/button/Button";

import theme from "../static/theme";
import btnTheme from "./btnTheme";

export default () => (
    <ThemeProvider theme={theme}>
      <Button theme={btnTheme} raised primary>Hello</Button>
    </ThemeProvider>
);

Basically, I want btnTheme to work as expected (i.e. as if I have CSS Modules enabled).

I'm using Next.js (not reflected above) so it is hard to have CSS modules, but I want to be able to have full control of individual components.

I just want to know if this is possible, or maybe it's just a feature that is incompatible with Next.js.

rntorm commented 7 years ago

+1
I am using create-react-app and would like to know the same thing. If it is only possible to change style in the package.json, its rather useless.

blainegarrett commented 7 years ago

I've asked this on stackoverflow as well. No responses yet. https://stackoverflow.com/questions/45679092/how-to-apply-theme-in-react-toolbox-2-when-using-create-react-app

Unrelated: Anyone know if there is still a discord channel for react-toolbox? I found a PR where the link was removed from the docs, but not mention of why or if there is a new channel.