Skip to content
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

[Feature Request] - Local Persist Customized Theme #8

Open
MUYANGGUO opened this issue Jun 14, 2022 · 0 comments
Open

[Feature Request] - Local Persist Customized Theme #8

MUYANGGUO opened this issue Jun 14, 2022 · 0 comments

Comments

@MUYANGGUO
Copy link
Member

MUYANGGUO commented Jun 14, 2022

Currently, I have implemented the persist local storage theme by storing the entire theme object to browser local stroage.

Story:

By clicking the theme button. A "my theme" option will be shown.
If user select the "my theme" option, a dialog will pop up in the middle of the screen.
The dialog will display a form, field as current default theme option keys, value will be string type user input, with a place holder showing to the users how the value can be set up.

    label: 'Light', 
    background: '#F5F5F5',
    text: '#000000',
    gradient: 'linear-gradient(315deg, #74ebd5 0%, #ACB6E5 94%)',
    title: '#2979ff',
    textTypeBox: '#9E9E9E',
    stats: '#3D5AFE',

The above shows a theme keys we are using globally in global.js ( a js file that handles the global styles).
In the form design,
we should provide a mapping to the key with a human readable string.
For example, for the above set up, we should make the form as following:

    background: '#F5F5F5',
    input text color: '#000000',
    color gradient: angle, color#1, percentage#1, color#2, percentage#2
    title color: '#2979ff',
    text color: '#9E9E9E',
    stats color: '#3D5AFE',

after user created this subject, we should store this customized theme object in local Storage.

and at initialization of theme state, we will first get the "my theme" items.
we will perform a sanity check for the object keys aligned with the upstream default them object keys. If matched, the local theme is good to use, and we can grab this state.
If not matched, we should force the default theme and to flush the user's local stored my theme object.

Goals:

V0 goal:
the form will only require string input. That is user should grab the color code and paste into the form. And only support 1 local theme.
V1 goal:
the form shall have a color paletee, user will easily pick the color and the system will generate the color code.
V2 goal:
The form can provide a preview. upon each user select color event, a preview theme is applied to the page. If Exit the dialog, the theme will restore back to the unchanged theme.
V3 goal:
Support mutltiple local theme options. (with a maximum limits)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant