Ask

dark mode flashes white for about 130ms on every hard reload, next.js app router

You cannot fix this in React, and moving the effect up the tree will never work, because every effect runs after hydration and hydration runs after paint. The class has to be on <html> before the browser paints anything, which means a synchronous script in <head>.

<script dangerouslySetInnerHTML={{__html: `
  try {
    var t = localStorage.theme;
    var d = t === 'dark' || (!t && matchMedia('(prefers-color-scheme: dark)').matches);
    document.documentElement.classList.toggle('dark', d);
    document.documentElement.style.colorScheme = d ? 'dark' : 'light';
  } catch (e) {}
`}} />

Two things people leave off. Set suppressHydrationWarning on <html>, because the server rendered it without the class and React will complain about a mismatch it cannot do anything about. And set color-scheme, otherwise form controls, the scrollbar and the default canvas stay light and you get a smaller version of the same flash.

Cost is about 2ms of parse. That is the entire fix.

108 · in/tailwind-at-scale ·

dark mode flashes white for about 130ms on every hard reload, next.js app router

localStorage does not exist on the server, so that specific plan cannot work. The version of it that does work is storing the preference in a cookie instead - then the server genuinely can read it and render the right class with no script.

The catch is that reading a cookie opts that route out of static rendering, so you trade a 2ms script for a dynamic render on every page. For most apps the script is the better trade. If you are already dynamic for auth, the cookie is strictly nicer.

13 · in/tailwind-at-scale ·

Quoted one day for 40 jewellery products on white, how long does that actually take once editing is in it

I have done this both ways and the difference is enormous. Tethered, with a locked camera, fixed lighting and a template crop, adds maybe an hour to the shoot and cuts editing to a batch job plus spot work. Shooting handheld and fixing alignment and exposure later feels faster on the day and then costs you three times as long at the desk. For a repeatable catalogue job the setup time is the cheapest hour you will spend.

186 · in/photo-craft ·

Two staff called out on the same Saturday and I lost the whole day's trade

Build a reduced-service plan and write it down before you need it, because you will never design one well at 7am with a queue forming.

Mine is a laminated sheet: on a solo day the menu drops to four items that can be made in under three minutes, the table service stops and everything becomes counter and collect, and a sign goes on the door saying limited menu today. Turnover on a solo day is about 60% of normal instead of 30%, and crucially nobody walks out angry because expectations were set at the door.

Second thing is a paid on-call arrangement. I pay one person 20 to be reachable on Saturday mornings whether or not I call. That has cost me maybe 400 a year and saved two days like yours.

187 · in/shop-owners ·

What is the mistake you made for years before somebody finally pointed it out

Backgrounds. I spent years composing entirely around the subject and letting whatever was behind them turn up uninvited, and a startling number of otherwise good frames have a pole, a bin or a bright window fighting the face. The fix was embarrassingly small: look at the edges and the background before the shutter, then move two steps left. Two steps left has saved more of my pictures than any lens I have bought.

259 · in/photo-craft ·

Cat refused the 8kg bag after two meals, has anyone actually got a refund on opened pet food

Go back with the receipt and the bag and ask, because plenty of chains run a satisfaction guarantee on food specifically for this and they do not advertise it loudly. I have had two refunds and one store credit over the years, all on opened bags. Policies vary by chain and sometimes by the manager standing in front of you, so be pleasant and be specific about what happened.

147 · in/pet-supplies ·

Pen burps ink into the cap on my commute but is perfect at my desk

Two thirds air and a warm train is the whole story. The air in the barrel expands when it warms, it has nowhere to go except through the feed, and the feed fins can only buffer so much before it comes out the front and pools in the cap.

Things that fixed it for me, in order of how much they helped: keep the pen above half full and top it up mid week rather than running it down to fumes, carry it nib up so gravity is at least not helping, and let it sit nib up for a minute before you uncap after coming in from the cold or into a warm building. A pen that is nearly full barely burps at all, which is the opposite of what most people expect.

176 · in/inks-and-nibs ·

January takings dropped 40 percent and I cannot tell if that is normal

Comparing January to December is the mistake. December is the anomaly, not January - it has parties, gifts, people in town shopping, and higher spend per head. Almost every food and retail business drops steeply in January, and 30-40% off December is squarely in the normal range for a cafe.

The comparison that tells you something is January against your own October and against the same month last year once you have one. You are 25% below October, which is a real seasonal dip but not an alarm on its own.

What I would actually look at: is the drop in customer count or in spend per head? Fewer people is weather and seasonality. Same people spending less is a menu and pricing question. Your till data can tell you that in ten minutes and it changes what you should do about it.

356 · in/shop-owners ·