Skip to content

Commit bf902df

Browse files
authored
feat(angular-query): add devtools theme option (#10609)
* feat(angular-query): add devtools theme option * chore: apply review feedback
1 parent 14926b7 commit bf902df

3 files changed

Lines changed: 13 additions & 0 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tanstack/angular-query-experimental': patch
3+
---
4+
5+
Add theme option support to Angular floating devtools.

packages/angular-query-experimental/src/devtools/types.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type {
33
DevtoolsButtonPosition,
44
DevtoolsErrorType,
55
DevtoolsPosition,
6+
Theme,
67
} from '@tanstack/query-devtools'
78
import type { DevtoolsFeature } from '../providers'
89

@@ -75,6 +76,11 @@ export interface DevtoolsOptions {
7576
* Set this to true to hide disabled queries from the devtools panel.
7677
*/
7778
hideDisabledQueries?: boolean
79+
/**
80+
* Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.
81+
* Defaults to 'system'.
82+
*/
83+
theme?: Theme
7884

7985
/**
8086
* Whether the developer tools should load.

packages/angular-query-experimental/src/devtools/with-devtools.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ export const withDevtools: WithDevtools = (
126126
errorTypes,
127127
buttonPosition,
128128
initialIsOpen,
129+
theme,
129130
} = devtoolsOptions()
130131

131132
if (!shouldLoadTools) {
@@ -142,6 +143,7 @@ export const withDevtools: WithDevtools = (
142143
buttonPosition && devtools.setButtonPosition(buttonPosition)
143144
typeof initialIsOpen === 'boolean' &&
144145
devtools.setInitialIsOpen(initialIsOpen)
146+
theme && devtools.setTheme(theme)
145147
return
146148
}
147149

0 commit comments

Comments
 (0)