mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-04-21 08:11:36 +02:00
feat: another batch
This commit is contained in:
21
frontend/src/js/_tooltip.js
Normal file
21
frontend/src/js/_tooltip.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import tippy from 'tippy.js';
|
||||
import 'tippy.js/dist/tippy.css';
|
||||
import 'tippy.js/themes/light-border.css';
|
||||
|
||||
|
||||
function initiateTooltips() {
|
||||
const currentDataTheme = document.documentElement.getAttribute('data-theme') || '';
|
||||
let theme;
|
||||
|
||||
if (currentDataTheme.endsWith('_dark')) {
|
||||
theme = 'light-border';
|
||||
} else if (currentDataTheme.endsWith('_light')) {
|
||||
theme = 'dark';
|
||||
}
|
||||
|
||||
tippy('[data-tippy-content]', {
|
||||
theme: theme
|
||||
});
|
||||
}
|
||||
|
||||
window.initiateTooltips = initiateTooltips;
|
||||
Reference in New Issue
Block a user