Closed zhkuskov closed 5 years ago
What's your intended use case for this functionality? Do you plan on delivering the CSS file via PHP?
If you're using stuff like Webpack you could just include the CSS file directly with its path:
vendor/scrivo/highlight.php/styles/a11y-dark.css
Hi, sorry for the late reply. This will be convenient because, firstly, I do not need to know how and where the necessary style files are located. And maybe in the future you will change the path to the style files or the names of the files themselves.
What do you see the API for this functionality looking like? Would something like this work?
/** @var string */
$filePath = HighlightUtilities\getStyleSheet("a11y-dark");
// When $fileNames is true, it'll return just the filenames. When false, absolute paths.
/** @var string[] */
$cssPaths = HighlightUtilities\getAvailableStyleSheets($fileNames = true);
Yes, it will be cool :)
You can also add a method to get the text styles from the file:
/** @var string */ $rawCSS = HighlightUtilities\getRawCss("a11y-dark");
for example, it is convenient when you need to get styles for the AMP version of the site
Hello! Can you add a method for getting styles? For example, the path to the style file? Or would the method return a style sheet from a file?