Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/angular-devtools-theme-option.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@tanstack/angular-query-experimental': patch
---

Add theme option support to Angular floating devtools.
6 changes: 6 additions & 0 deletions packages/angular-query-experimental/src/devtools/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type {
DevtoolsButtonPosition,
DevtoolsErrorType,
DevtoolsPosition,
Theme,
} from '@tanstack/query-devtools'
import type { DevtoolsFeature } from '../providers'

Expand Down Expand Up @@ -75,6 +76,11 @@ export interface DevtoolsOptions {
* Set this to true to hide disabled queries from the devtools panel.
*/
hideDisabledQueries?: boolean
/**
* Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.
* Defaults to 'system'.
*/
theme?: Theme

/**
* Whether the developer tools should load.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ export const withDevtools: WithDevtools = (
errorTypes,
buttonPosition,
initialIsOpen,
theme,
} = devtoolsOptions()

if (!shouldLoadTools) {
Expand All @@ -142,6 +143,7 @@ export const withDevtools: WithDevtools = (
buttonPosition && devtools.setButtonPosition(buttonPosition)
typeof initialIsOpen === 'boolean' &&
devtools.setInitialIsOpen(initialIsOpen)
if (theme) devtools.setTheme(theme)
return
}

Expand Down
Loading