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 - Persist theme option in localstorage or cookie #31

Open
brunoruas2 opened this issue Dec 4, 2023 · 1 comment
Open

FEATURE - Persist theme option in localstorage or cookie #31

brunoruas2 opened this issue Dec 4, 2023 · 1 comment
Assignees
Labels
feature question Further information is requested

Comments

@brunoruas2
Copy link
Contributor

I think it would be a cool feature to persist the theme selection in local browser data, to pass this information to all pages, not just the current selection, as a default feature of mkdocks-simple-blog.

Where do you think is the most appropriate place to persist this information? LocalStorage or some cookie usage?

@FernandoCelmer
Copy link
Owner

Interesting question @brunoruas2. So, analyzing it, I believe that localstorage should be the way to go, because it is the best way to persist this type of configuration compared to cookies.

For mkdocs-simple-blog there is already an option to configure the theme that will be rendered. This configuration is in the mkdocs.yml file, and you can change the theme type or colors separately.

Example:

theme:
  name: simple-blog
  favicon: assets/favicon.ico
  logo: assets/logo.png
  theme_style: light
  site_name_style: normal
  title_style: bold
  colors:
    text: black
    title: black
    primary: black
    background: white
  components:
    site_name: true
    title: true
    menu: true
    preview: true
    footer: true

2023-12-04_20-39

Links:

@FernandoCelmer FernandoCelmer added question Further information is requested feature labels Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants