gottheflag/nova ? reverse-engineered prompt

Reverse engineered prompt

Build me a small TypeScript library for managing app themes.

I want a controller that can set and keep track of a light, dark, or system theme on a document, save the choice in storage if I want it to, and update a data attribute on the page so my UI can react to it. It should be easy to initialize with sensible defaults, but let me customize the storage key, the attribute name, and the theme values.

I also want a simple way to plug in UI adapters, like a button that can toggle themes, and let me enable a smooth theme switch animation if needed. Please include events for when the theme changes and when it is actually applied, so my app can listen and react.

Make it clean, lightweight, and usable in a browser app, and include a small example so I can see how it works. If you need to check current docs for any browser behavior, feel free to look them up online.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab