Closed normal-coder closed 3 months ago
The highlight code is generated on compile time, So it is difficult to automatically adapt to the system theme.
I prefer to provide an advanced option for users to customize the theme like this:
TurboConsole({
themes: {
highlight: {
icon: '🚀',
vue: {
padding: '2px 5px',
radius: '3px 0 0 3px',
color: '#fff',
background: '#335d92',
},
js: {
// ...
},
ts: {
// ...
}
},
launchEditor: {
icon: '🔦',
style: {
padding: '2px 5px',
radius: '3px 0 0 3px',
color: '#fff',
background: '#335d92',
}
}
}
})
WDYT?
The highlight code is generated on compile time, So it is difficult to automatically adapt to the system theme.
I prefer to provide an advanced option for users to customize the theme like this:
...
WDYT?
Providing various customization options is a good way. BTW, users also like the plug-and-play recommendation 😂
I tried it myself. Originally, I thought of using the Window object to determine if it is in dark mode, but obviously, this cannot be applied to all scenarios. Perhaps multiple methods can be considered for combination.
const isDarkTheme = window.matchMedia("(prefers-color-scheme: dark)");
This feature had release on v1.10.0.
You can refer documentation for the setup.
Clear and concise description of the problem
The high-light colors output by Turbo Console are the same between the light and dark mode. However, in reality, the colors in dark mode appear very glaring. Just like the content output by the
App.vue
color block. In dark mode, the colors are too bright, causing the white text to appear weak instead, visually creating uncomfortable stimulation.Suggested solution
Alternative
Refer to the solution above
Additional context
Validations