Giter VIP home page Giter VIP logo

Comments (9)

shanky101 avatar shanky101 commented on May 18, 2024 1

I wanted to know if there is a way to disable the dark theme. The theme used is not jet black but a variant of off shade of black/dark grey which tbh messes with my eyes. Is there anyway to just switch modes. Between light and dark mode?

from builderbook.

ksbrooksjr avatar ksbrooksjr commented on May 18, 2024 1

As a quick and dirty solution I ended up just modifying the styles directly in the console. Here's what worked for me: https://gist.github.com/ksbrooksjr/0ad492d540d4fb9c968cb8cd52c520b3

from builderbook.

tima101 avatar tima101 commented on May 18, 2024 1

@ksbrooksjr Nice!

I will use your styles to create a light theme. Thanks!


Notes to myself:@ksbrooksjr Nice!

I will use your styles to create a light theme. Thanks!


Notes to myself:

Save boolean lightTheme to browser's localStorage.

Do something like this at ReadChapter page:

  public componentDidMount() {
    if ((typeof localStorage !== 'undefined' && localStorage.getItem(this.theme)) || null) {
      this.setState({ themeType: 'light' });
    }
  }

And:

  private changeThemeType = (themeType: string) => {
    this.setState({ themeType });

    if (typeof localStorage !== 'undefined' && this.theme) {
      localStorage.setItem(this.theme, themeType);
    }
  };

from builderbook.

tima101 avatar tima101 commented on May 18, 2024 1

@shanky101 @ksbrooksjr @klyburke @delgermurun Added prototype feature, see circle icon next to Table of Content on the left: https://builderbook.org/books/builder-book/introduction


Currently data is saved to localStorage.
To prevent flash of styles for SSR, we should save darkTheme to DB.
To me it looks tolerable to have a quick flash for SSR, most of consequent transitions (between chapters) are CSR transitions.


Note to self: research saving darkTheme to cookie/session

from builderbook.

klyburke avatar klyburke commented on May 18, 2024

@shanky101 Thanks for your feedback. We do not have an option at builderbook.org to switch to a different theme.

Do you have suggestions for specific colors to use? We are happy to consider them.

To test some other color schemes locally, look into pages/document.js and edit options within the style block.

from builderbook.

shanky101 avatar shanky101 commented on May 18, 2024

Link here
The above link gives very useful tips for having an inclusive color palette.
Simple ones like White on Black/Black on White would be the bare minimum color options.
@klyburke Since Builderbook is showcased as a site which belongs to blog/book category, having a toggle for basic color options would make it more appealing for a wider audience. It may not be essential, but a good to have feature.
The current implementation uses an off variant of black which in my opinion may not be the best choice for long form reading on computer screen. FWIW, I use dark theme in my code editors, xcode and even macOS theme and I love it but its good to have options.
PS : The link below exactly details the better ways of text representation on screens.
Link here

from builderbook.

tima101 avatar tima101 commented on May 18, 2024

@shanky101 Thanks for sharing the link. We are open to contribution to add a light theme in addition to a dark theme.

@klyburke Let's keep it open for now?

from builderbook.

klyburke avatar klyburke commented on May 18, 2024

@tima101 Sounds good.

@shanky101 If you'd like to contribute with a pull request, you are welcome. But no pressure.

from builderbook.

ksbrooksjr avatar ksbrooksjr commented on May 18, 2024

@tima101 Looks great!

from builderbook.

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.