-
Notifications
You must be signed in to change notification settings - Fork 330
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
Feat: theme customization #175
Conversation
@leweyse is attempting to deploy a commit to the Measured Team on Vercel. A member of the Team first needs to authorize it. |
Hi @chrisvxd! This is not a complete proposal, but I'd like to know your opinion before moving forward. This approach is quite challenging, specially if the goal is to provide more customization options. |
Hey @leweyse! This is awesome. I'd say that I wasn't quite ready for us to jump into #139 (we typically marge issues as "Ready" when we're ready, but we haven't documented that process anywhere yet), but also appreciate it's easier to discuss things with code sometimes. General points on this implementation:
I think I would prefer the finer grained control, but I'm not totally sure. I imagine full control will probably be necessary for consumers to achieve on-brand color palettes, and accessibility. We could possibly use HSL (or Your CSS property suggestions are interesting. I need to think about this properly before giving a proper response because this is the most important piece of the proposal -- they essentially act as a public facing API and any renames become breaking changes. Initial impressions:
I'll probably have more thoughts on this, but wanted to share my first take. Would also be interested to hear what @monospaced thinks. |
May I suggest LCH instead of HSL, because they keep the lightness as perceived by human? :) |
Hi @leweyse! Really appreciate all the effort here. We'd be happy to consider the introduction of some descriptive CSS properties like you're suggesting, but would want to see some changes to your proposal:
Additionally, we would likely keep this undocumented until the styles are stabilised. This may involve us renaming these properties and introducing breaking changes. Some reasoning:
If you're happy with that approach, we'd appreciate it if you could update your PR with a new proposal. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Hi @chrisvxd! Sorry for not being active, I've been quite busy. From your first reply:
I agree with the comments shared. I think I overthought about a "simple" layer, but I agree that the best would be to have a granular way to customize the editor.
These are fair points and I'll be glad to work on those changes. I have a couple busy days ahead, so I'll share an update during the weekend or starting next week. |
Great thanks @leweyse! No rush on this one, just when you get the time. If you have to close it, we'll likely pick this up in due course. |
0c88093
to
4613df4
Compare
I close this PR to have a fresh start. Still working on it. |
Theme Customization #139
This is a proposal for a relatively light and controlled custom theming layer.
Points to cover
Challenge
Color customization is not easy if we want to keep the custom theming layer light. For example:
To use different color shades or opacity values (eg: Dropzone is selected or hovered) there are two options: create multiple custom properties for each interaction (hover, selected, dragging over, etc.) or create one custom property that Puck internally will use with different alpha values.
In this proposal I take the second option using
hsl()
. It's been used for most components to handle different interactions:ComponentListItem
andLayer
use it for hover interactions,Dropzone
andDraggableComponent
use it for the different states to highlight the dropzone, the target, etc.Solution
Default theme:
Editing_._.-.Google.Chrome.2023-10-19.10-36-57.1.mp4
Custom theme:
Editing_._.-.Google.Chrome.2023-10-19.10-37-50.1.mp4
Config used: