esilverm / shl-index-ui

The frontend repository for a Sim Hockey League's statistical index built with Next.js and Typescript
https://index.simulationhockey.com/
11 stars 5 forks source link

Setup dark mode with improvements #587

Closed esilverm closed 2 months ago

esilverm commented 2 months ago

Instead of defining the colors within the global css file, we are defining the themes based on a shared file of css variables (with enhanced type checking!). We use these semantic variables alongside color primitives from before in our tailwind theme and pass through the colors as a utility in the form of a variables used with a light and dark class (not these exact names though).

To make sure the theme is persisted properly we are using next-theme which stores the value as a cookie and in localhost so on there is no flickering. When the theme class appears in the document root we show the proper styles thanks to our css variables from the tailwind plugin.

luketd commented 2 months ago

Changes that were not touched by code base

StandingsTable.tsx: line 60

luketd commented 2 months ago

Minor; scrollball when viewing players career could be greyer to match appearance of old index Capture

luketd commented 2 months ago

For players/[league]/schedule line 143 I believe. There should be a darker border around the box in the light mode

Capture

luketd commented 2 months ago

In light mode: for the options: position

the text needs to be black

Capture

In dark theme: the "Options" in Options: position, the "Options" text needs to be white

luketd commented 2 months ago

Optional: From the portal suggestion box there has been a couple submissions for the lines page getting scrunched on mobile. Was going to investigate on how to make it readable on mobile after the dark theme. Not sure if you have an easy way to do it. If not Ill try to do it after

esilverm commented 2 months ago

Optional: From the portal suggestion box there has been a couple submissions for the lines page getting scrunched on mobile. Was going to investigate on how to make it readable on mobile after the dark theme. Not sure if you have an easy way to do it. If not Ill try to do it after

This is something i've noticed but it is fairly inconsequential. For now let's defer it for later.