Skip to content

Conversation

@xKesvaL
Copy link

@xKesvaL xKesvaL commented Sep 7, 2025

This PR adds a { temporaryOnly?: boolean } to the setMode utility. Why ? I am building a website where I use a group (marketing) for my "marketing" part, that I want to be in light mode only. But, I'm going to have a (docs) group or something docs-like, where I want the users to be able to choose their mode.

This basically sets up a variable that tracks the session-set mode. This means, in my (marketing) layout, I could do :

setMode('light', { temporaryOnly: true })

To have my light mode.
Then, in my (docs) layout:

clearTemporaryMode()

So that it reverts back to the user's preference stored in localstorage.

Tests & docs

I have added tests as needed, as well as a new doc for the clearTemporaryMode utility, and updated the setMode with proper documentation as well as this exact example I've just given.

@changeset-bot
Copy link

changeset-bot bot commented Sep 7, 2025

⚠️ No Changeset found

Latest commit: b242e05

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Sep 7, 2025

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
mode-watcher ✅ Ready (View Log) Visit Preview b242e05

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant