Remove individual CSS component file references and streamline css-loader to only load css-variables.css. The web/css directory now contains the consolidated stylesheet, reducing complexity and improving maintainability.
41 lines
1.1 KiB
JavaScript
41 lines
1.1 KiB
JavaScript
/**
|
|
* CSS Loader
|
|
* Loads all CSS files for the resolution master components
|
|
*/
|
|
|
|
import { addStylesheet, getUrl } from "./ResourceManager.js";
|
|
import { createModuleLogger } from "../log_system/LoggerUtils.js";
|
|
|
|
const log = createModuleLogger('CSSLoader');
|
|
|
|
/**
|
|
* Loads all CSS files for the application
|
|
*/
|
|
export function loadAllStyles() {
|
|
try {
|
|
log.info('Loading CSS files...');
|
|
|
|
// Load all CSS files using getUrl for proper path resolution
|
|
const cssFiles = [
|
|
'./css/css-variables.css', // CSS Custom Properties - MUST BE FIRST!
|
|
];
|
|
|
|
cssFiles.forEach(file => {
|
|
addStylesheet(getUrl(file));
|
|
log.debug(`Loaded: ${file}`);
|
|
});
|
|
|
|
log.info('All CSS files loaded successfully');
|
|
} catch (error) {
|
|
log.error('Error loading CSS files:', error);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Call this function when the ResolutionMaster node is actually created/used
|
|
* to load styles only when needed, preventing global UI interference
|
|
*/
|
|
export function loadStylesWhenNeeded() {
|
|
loadAllStyles();
|
|
}
|