Skip to content

feat: System Theme Listener component#597

Merged
daviddecentage merged 16 commits intomainfrom
feat/system-theme-listener
Feb 26, 2025
Merged

feat: System Theme Listener component#597
daviddecentage merged 16 commits intomainfrom
feat/system-theme-listener

Conversation

@daviddecentage
Copy link
Copy Markdown
Contributor

Motivation

A component that listens to changes in the users system/OS theme, fully integrated with the existing theme system by default.

Changes

  • Added component
  • Added docs route and page
  • Added export to expose it

Screenshots

This component doesnt render anything.

@daviddecentage daviddecentage requested review from a team as code owners February 25, 2025 13:51
Copy link
Copy Markdown
Member

@peterpeterparker peterpeterparker left a comment

Choose a reason for hiding this comment

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

Can you also provide some tests?

@daviddecentage
Copy link
Copy Markdown
Contributor Author

daviddecentage commented Feb 25, 2025

Can you also provide some tests?

I have added 3 cases:

  • Trigger OS theme change to dark with no setting in localStorage ==> should apply dark
  • Trigger OS theme change to dark when light is selected ==> should stay light
  • Trigger OS theme change to dark when light is selected and custom event handler is passed ==> should stay light and custom event handler should be fired

daviddecentage and others added 4 commits February 26, 2025 11:10
… feat/system-theme-listener

# Conflicts:
#	src/tests/lib/components/SystemThemeListener.spec.ts
Copy link
Copy Markdown
Member

@peterpeterparker peterpeterparker left a comment

Choose a reason for hiding this comment

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

LGTM, thx

@daviddecentage daviddecentage merged commit 9859296 into main Feb 26, 2025
9 checks passed
@daviddecentage daviddecentage deleted the feat/system-theme-listener branch February 26, 2025 10:35
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.

2 participants