-
-
Notifications
You must be signed in to change notification settings - Fork 386
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
Use css custom properties for colors #599
Use css custom properties for colors #599
Conversation
I am not able to review this, but from the description, it seems like there are multiple changes included in single PR and generally I would advise to move them to separate PRs to simplify the reviewer job. |
@paskal Of course it can be split, but it doesn't make sense most of changed files is replace by full search and if I split this request on smaller, it can't help with review this request. |
It's up to other reviewers, but in such a situation I personally would prefer having two more PRs with 1 file changes in each and this with 63 files, rather than one with 65. Mixing multiple intentions in single PR usually makes my life as a reviewer harder, and it seems that this PR is a mix of custom properties added plus some style and linter improvements that are outside of that scope. |
Linter is not outside of that scope. You can consider it like tests, it verifies that I don't miss any css files witch contains css colors. |
this is an interesting idea. The question I have – is it limited to colors only? From your example, it looks like fonts will be supported as well, correct me if wrong. What else (if any) can we support in the same way? |
Yes, |
5be4f4b
to
396d1e0
Compare
Another question - wouldn't be uploading a regular css more generic and easier to implement? I mean adding some API method allowing admins to upload css file with whatever user need? The method (smth like Am I missing something and this is not a good idea? To me, it sounds like almost no work on the UI side (well, maybe minimize and consolidate styles to make it more friendly for "rewrites") and mostly trivial change for the backend. I have seen something similar in both matermost and rocket chat, both allow to enter css manually. |
Theoretically this "migration issue" can be mitigated on the server-side. I.e. we provide several basic selectors and maintain proper mapping. Not sure I like this approach as it leaks parts of frontend logic to the backend side. Or even better - we define a list of "exposable selectors" and never change them. This will definitely make ui development less flexible as those selectors going to be a part of "public API". Either way - up to you, just an idea I wanted to share. |
I support the approach with adding CSS files.
It is a long way to make it good enough for using and I think we can start to provide this feature like alfa or beta, because our "API" can change before we make final version. P.S. Example with Slack is good but it is a standalone application and theming it is a minor feature for them. But for us, it can be a major feature because I think any comment system provides it. |
959d056
to
03c188a
Compare
03c188a
to
f6e7329
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM from code point of view.
@umputun could you merge it? |
I wws going to comment (prompted from #5 (comment) ) but I would only repeat what umputun has said above:
|
There is POC of theme api. It can be merged safely. I suppose, it is not should affect current behavior for end user.
What I did:
postcss-custom-properties
plugin for fallback for browsers which doesn't support css custom propertiesHow does it work?
You can uncomment in
index.ejs
and notice that comment change color
I use
__colors__
because it not final implementation.What is next?
Comments are welcome.