Name CSS Import

Hey, I'm doing dark/light mode switching for code blocks using HighlightJS and I want to name the imported stylesheet so that I can toggle it on / off depending on if it's dark mode.

import "highlight.js/styles/github-dark.css";
import "highlight.js/styles/github.css";


would become something like
import "highlight.js/styles/github-dark.css" as GitHubDark;
import "highlight.js/styles/github.css" as GitHub;

document.styleSheets.find(title == githubdark)


Something like that - anyone know if that's possible? Thanks
Was this page helpful?