Nathan Smith
  • Projects
  • About
  • Contact
usePrefersDarkTheme: a theming hook for React

July 24, 2020, 9:01 PM


Every site needs a dark theme, including this one. Having a dark theme is easy, but if an app or site's theme doesn't follow the system theme it can lead to blinding the user with a white background until they find the toggle. This hook (and some related code to ...

usePrismjs: A prismjs hook for CRA & React

May 20, 2020, 9:14 PM



What is it? Prismjs is a powerful little javascript to add syntax highlighting to <pre> and <code> blocks, but it hasn't kept up with a JavaScript framework-using, module-bundling world. There aren't many docs around how to use it with the npm package, and most want you to use a babel ...