23 lines
957 B
TypeScript
23 lines
957 B
TypeScript
|
export function getCurrentThemeColors(){
|
||
|
if (process.browser){
|
||
|
const style = getComputedStyle(document.body);
|
||
|
const theme = {
|
||
|
colors: {
|
||
|
primary: style.getPropertyValue('--primary'),
|
||
|
secondary: style.getPropertyValue('--secondary'),
|
||
|
success: style.getPropertyValue('--success'),
|
||
|
info: style.getPropertyValue('--info'),
|
||
|
warning: style.getPropertyValue('--warning'),
|
||
|
danger: style.getPropertyValue('--danger'),
|
||
|
light: style.getPropertyValue('--light'),
|
||
|
dark: style.getPropertyValue('--dark'),
|
||
|
},
|
||
|
font: {
|
||
|
size: Number(window.getComputedStyle(document.body).getPropertyValue('font-size').match(/\d+/)[0]),
|
||
|
type: window.getComputedStyle(document.body).getPropertyValue('font-family')
|
||
|
}
|
||
|
};
|
||
|
|
||
|
return theme;
|
||
|
}
|
||
|
}
|