Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

docs(ui-lib): Write a blurb about the <ThemeToggle> UI Component Library helper #1122

Merged
merged 2 commits into from
Jan 8, 2024

Conversation

ryan953
Copy link
Member

@ryan953 ryan953 commented Jan 8, 2024

Introduced with getsentry/sentry#62726

I think it's handy to

  1. Be explicit that theme is something this component cares about (and does well)
  2. Not force the reader to switch themes. ie: if they're reading at night, flashing the whole page into light mode is annoying
SCR-20240108-jtds

Copy link

vercel bot commented Jan 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
develop ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 8, 2024 7:11pm

- [`<ThemeToggle />`](https://github.com/getsentry/sentry/blob/master/static/app/components/stories/themeToggle.tsx)<br />
A wrapper component to isolate children from the current theme used on the page. Allows quickly toggling an example between <code>light</code>/<code>dark</code> without changing the whole screen (useful at night when you want most things in dark mode).<br/>
Use this to emphasize that a component/image has been tested and works well in <code>light</code> or <code>dark</code> mode.
```typescript
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small nit: I think tsx would highlight this better

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup! much better

typescript tsx
SCR-20240108-kdea SCR-20240108-kddj

@ryan953 ryan953 enabled auto-merge (squash) January 8, 2024 19:09
@ryan953 ryan953 merged commit acc93dc into master Jan 8, 2024
5 checks passed
@ryan953 ryan953 deleted the ryan953/ui-lib-themetoggle branch January 8, 2024 19:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants