Skip to content

Commit 51505a6

Browse files
authored
Merge pull request #1145 from mathuo/moconnor/theme-builder-css-variables
feat: migrate spaced themes to CSS variables and add interactive theme builder
2 parents 96e0759 + 884bd6f commit 51505a6

File tree

11 files changed

+1773
-114
lines changed

11 files changed

+1773
-114
lines changed

packages/dockview-core/src/dockview/theme.ts

Lines changed: 92 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ export interface DockviewTheme {
77
* The class name to apply to the theme containing the CSS variables settings.
88
*/
99
className: string;
10+
/**
11+
* Whether the theme is light or dark. Useful for adapting panel content colors.
12+
*/
13+
colorScheme?: 'light' | 'dark';
1014
/**
1115
* The gap between the groups
1216
*/
@@ -25,37 +29,37 @@ export interface DockviewTheme {
2529
export const themeDark: DockviewTheme = {
2630
name: 'dark',
2731
className: 'dockview-theme-dark',
32+
colorScheme: 'dark',
2833
};
2934

3035
export const themeLight: DockviewTheme = {
3136
name: 'light',
3237
className: 'dockview-theme-light',
38+
colorScheme: 'light',
3339
};
3440

3541
export const themeVisualStudio: DockviewTheme = {
3642
name: 'visualStudio',
3743
className: 'dockview-theme-vs',
44+
colorScheme: 'dark',
3845
};
3946

4047
export const themeAbyss: DockviewTheme = {
4148
name: 'abyss',
4249
className: 'dockview-theme-abyss',
50+
colorScheme: 'dark',
4351
};
4452

4553
export const themeDracula: DockviewTheme = {
4654
name: 'dracula',
4755
className: 'dockview-theme-dracula',
48-
};
49-
50-
export const themeReplit: DockviewTheme = {
51-
name: 'replit',
52-
className: 'dockview-theme-replit',
53-
gap: 10,
56+
colorScheme: 'dark',
5457
};
5558

5659
export const themeAbyssSpaced: DockviewTheme = {
5760
name: 'abyssSpaced',
5861
className: 'dockview-theme-abyss-spaced',
62+
colorScheme: 'dark',
5963
gap: 10,
6064
dndOverlayMounting: 'absolute',
6165
dndPanelOverlay: 'group',
@@ -64,6 +68,88 @@ export const themeAbyssSpaced: DockviewTheme = {
6468
export const themeLightSpaced: DockviewTheme = {
6569
name: 'lightSpaced',
6670
className: 'dockview-theme-light-spaced',
71+
colorScheme: 'light',
72+
gap: 10,
73+
dndOverlayMounting: 'absolute',
74+
dndPanelOverlay: 'group',
75+
};
76+
77+
export const themeNord: DockviewTheme = {
78+
name: 'nord',
79+
className: 'dockview-theme-nord',
80+
colorScheme: 'dark',
81+
};
82+
83+
export const themeNordSpaced: DockviewTheme = {
84+
name: 'nordSpaced',
85+
className: 'dockview-theme-nord-spaced',
86+
colorScheme: 'dark',
87+
gap: 10,
88+
dndOverlayMounting: 'absolute',
89+
dndPanelOverlay: 'group',
90+
};
91+
92+
export const themeCatppuccinMocha: DockviewTheme = {
93+
name: 'catppuccinMocha',
94+
className: 'dockview-theme-catppuccin-mocha',
95+
colorScheme: 'dark',
96+
};
97+
98+
export const themeCatppuccinMochaSpaced: DockviewTheme = {
99+
name: 'catppuccinMochaSpaced',
100+
className: 'dockview-theme-catppuccin-mocha-spaced',
101+
colorScheme: 'dark',
102+
gap: 10,
103+
dndOverlayMounting: 'absolute',
104+
dndPanelOverlay: 'group',
105+
};
106+
107+
export const themeMonokai: DockviewTheme = {
108+
name: 'monokai',
109+
className: 'dockview-theme-monokai',
110+
colorScheme: 'dark',
111+
};
112+
113+
export const themeSolarizedLight: DockviewTheme = {
114+
name: 'solarizedLight',
115+
className: 'dockview-theme-solarized-light',
116+
colorScheme: 'light',
117+
};
118+
119+
export const themeSolarizedLightSpaced: DockviewTheme = {
120+
name: 'solarizedLightSpaced',
121+
className: 'dockview-theme-solarized-light-spaced',
122+
colorScheme: 'light',
123+
gap: 10,
124+
dndOverlayMounting: 'absolute',
125+
dndPanelOverlay: 'group',
126+
};
127+
128+
export const themeGithubDark: DockviewTheme = {
129+
name: 'githubDark',
130+
className: 'dockview-theme-github-dark',
131+
colorScheme: 'dark',
132+
};
133+
134+
export const themeGithubDarkSpaced: DockviewTheme = {
135+
name: 'githubDarkSpaced',
136+
className: 'dockview-theme-github-dark-spaced',
137+
colorScheme: 'dark',
138+
gap: 10,
139+
dndOverlayMounting: 'absolute',
140+
dndPanelOverlay: 'group',
141+
};
142+
143+
export const themeGithubLight: DockviewTheme = {
144+
name: 'githubLight',
145+
className: 'dockview-theme-github-light',
146+
colorScheme: 'light',
147+
};
148+
149+
export const themeGithubLightSpaced: DockviewTheme = {
150+
name: 'githubLightSpaced',
151+
className: 'dockview-theme-github-light-spaced',
152+
colorScheme: 'light',
67153
gap: 10,
68154
dndOverlayMounting: 'absolute',
69155
dndPanelOverlay: 'group',

packages/dockview-core/src/overlay/overlay.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
position: absolute;
3232
z-index: calc(var(--dv-overlay-z-index) - 2);
3333

34-
border: 1px solid var(--dv-tab-divider-color);
34+
border: var(--dv-floating-border);
3535
box-shadow: var(--dv-floating-box-shadow);
3636

3737
/* GPU optimizations for floating group movement */
@@ -44,7 +44,7 @@
4444
}
4545

4646
&.dv-resize-container-dragging {
47-
opacity: 0.5;
47+
opacity: var(--dv-floating-group-dragging-opacity);
4848
/* Enhanced GPU acceleration during drag */
4949
will-change: transform, opacity;
5050
}

0 commit comments

Comments
 (0)