Giter Club home page Giter Club logo

Comments (7)

tfinardi avatar tfinardi commented on June 16, 2024 1

I want to know if it possible to set dark-theme as default theme for new users ? If yes, could please explain me how to do that.

Hi @Eliesemoule,
if you really want this, you can just set the body class to "dark-theme", editing the file baseof.html in "themes/LoveIt/layouts/_default".

<body class="dark-theme">

from loveit.

dillonzq avatar dillonzq commented on June 16, 2024 1

Hi, @Eliesemoule
I would consider adding a config option default_theme.

from loveit.

dillonzq avatar dillonzq commented on June 16, 2024 1

Hi, @Eliesemoule
defaultTheme has been added to config file in #58.

from loveit.

jbfreels avatar jbfreels commented on June 16, 2024

Not sure if this is the BEST way, but if you modify the logic in blog.js, you can swap it.

$('body').toggleClass('light-theme');
isLight = !isLight;
window.localStorage && window.localStorage.setItem('theme', isLight ? 'dark' : 'light');

from loveit.

Eliesemoule avatar Eliesemoule commented on June 16, 2024

Hello,

Thank you for your reply. I just tested. Unfortunately it does not work. I still have the theme-light and can no longer switch to the dark-theme. Do you have another idea?

from loveit.

jbfreels avatar jbfreels commented on June 16, 2024

I'm sorry, I just tried to reproduce but I couldn't. I gave up on the theme after having another issue.

from loveit.

dillonzq avatar dillonzq commented on June 16, 2024

Hi, everyone!
In #67, I have added "auto" config in defaultTheme, which detecting system dark mode to set site theme.

from loveit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.