-
Notifications
You must be signed in to change notification settings - Fork 233
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
Theming #139
Comments
Hi @chrisvxd ! I definitely support using custom properties. A great example of a similar implementation is I use Tailwind CSS and would love it if the theme customization could be easily extended to Custom Fields or Plugins in my projects. |
I think if you want to appease everyone you're probably going to need both inline And just to throw an extra complication into the works, there'll be people using styled-components that would like to be able to wrap your existing components instead of applying global styles. This might be able to be achieved in a similar way to how react-markdown allows customizing elements.... If you had an interface that allowed overriding/extending the styles in one place (in addition to noIdeaWhatToCallThis: {
Button: (ExistingComponent) => ({className, props}) => (
<ExistingComponent {...props} className={classNames(className, 'extra')} />
),
// Styled component example
Button: (ExistingComponent) => styled(ExistingComponent)`color: red;`
} |
@leweyse also a big fan of custom properties, so there could be something here. This might be a good way of doing a relatively light and controlled custom theming layer. @JakeSidSmith I think what you're suggesting is the "custom render functions" option combined with "classNames", which is full UI override. This is definitely the most powerful option and would allow people to do whatever they want, but I have concerns around the trade-off in making the internals part of a public API. If you remove a component internally, you now have to issue a breaking change. I imagine the risk of this happening decreases as Puck becomes more stable. |
I agree with the simple solution with custom properties. They are well-known and supported and they can cover a lot of use-cases. Custom render functions would be for complete white-labelling, which is way to advanced (and heavily paid in solutions like Builder.io). |
I think #224 may unlock this work, and should probably be a blocker here. |
Puck is being deployed in a wide variety of situations that require different themes. We should support theming to support this.
Some ideas:
Let's have a discussion and form this into a more fully fledged series of proposals.
Related #122
The text was updated successfully, but these errors were encountered: