-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpopup-init.js
More file actions
30 lines (26 loc) · 1.21 KB
/
Copy pathpopup-init.js
File metadata and controls
30 lines (26 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// popup-init.js
// Import specific components
import '@material/web/textfield/outlined-text-field.js';
import '@material/web/select/outlined-select.js';
import '@material/web/select/select-option.js';
import '@material/web/switch/switch.js';
import '@material/web/button/filled-button.js';
import '@material/web/typography/md-typescale-styles.js';
// Import styles
import { styles as typescaleStyles } from '@material/web/typography/md-typescale-styles.js';
import { styles as themeStyles } from './theme.js'; // Load custom theme
// Apply styles to the document's adoptedStyleSheets
// Ensure this runs after the DOM is ready or styles might not apply correctly initially,
// although adoptedStyleSheets usually work well early.
if (document.adoptedStyleSheets) {
document.adoptedStyleSheets = [
...document.adoptedStyleSheets,
typescaleStyles.styleSheet,
themeStyles.styleSheet
];
} else {
console.warn("adoptedStyleSheets not supported or available yet.");
// Fallback or alternative styling method might be needed for older environments
// or if timing issues occur. For modern extensions, this should generally work.
}
console.log("Material Web components and styles initialized.");