-
Notifications
You must be signed in to change notification settings - Fork 21
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: load space's custom colors #1090
base: master
Are you sure you want to change the base?
Conversation
1e0d6bd
to
f56edab
Compare
b1df423
to
c361c43
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.
We may need a way to test skins without need of DB, It will be easy for space admins to test without need of custom domain/wait for us to update DB
See Phase 2 from https://github.com/snapshot-labs/workflow/issues/238#issuecomment-2575387325 |
Summary
Toward https://github.com/snapshot-labs/workflow/issues/238
This PR will load an apply the new custom colors defined in the space's settings
Context
Instead of referencing a pre-defined skin, each space now have a new section in their settings, named
skinsColors
, which hold an object of variables, e.g.:The
skin
property is not used anymore, and the variables above will be transformed into CSS variables, then injected in the<head>
.This allow each space to customize their colors directly from their space settings. For now, colors are coming from the
skin
they're using, and imported from v1 using snapshot-labs/snapshot-sequencer#490Only whitelabel spaces will have access to custom colors, which will also overwrite and disable the
dark
/light
theme togglerHow to test
Depend on snapshot-labs/snapshot-hub#971
Here's a list of colors from the most used skins:
VITE_WHITE_LABEL_MAPPING='127.0.0.1;mod.eth' yarn dev
VITE_WHITE_LABEL_MAPPING='127.0.0.1;astronos.eth' yarn dev
VITE_WHITE_LABEL_MAPPING='127.0.0.1;friesdao.eth' yarn dev
VITE_WHITE_LABEL_MAPPING='127.0.0.1;balancer.eth' yarn dev
VITE_WHITE_LABEL_MAPPING='127.0.0.1;gmdao.eth' yarn dev
Uniswap
Astronos
Fries
Balancer
Light
Notes
Not all themes are working 100%, this will be fixed on another PR, as this PR is focused on laoding the custom colors, and not refactoring the styles/classname