Looking at the documentation, glamor seems to create style sheets in the DOM of the page using the package. So after all calls to glamor have finished, traversing document style sheets should pick up the results. A linked example of looking through style sheets is not exactly what is needed. Here is a example (modified from old style code) of getting CSS definitions as text that works in a browser:
function cssStyleRules(sheets) {
var sheet;
var list;
var rule;
var text="";
if(sheets) {
for(var i = 0; sheet = sheets[i++]; ) {
list = sheet.cssRules;
for( var j = 0; j < list.length; ++j) {
rule=list[ j];
if(rule.type == 1) { // styleRule
text += rule.cssText + '\n';
}
}
}
}
return text;
}
var css = cssStyleRules( document.styleSheets);
// write css to a file in a headless browser
Obviously the code needs to be run in a headless browser on the server which writes the CSS text to a file before being processed by Styleliner.
Update:
You've commented on not being able to get style sheets back from the headless browser as expected. This could be the browser's fault, but checking Glamor.md's implementation.md turned up
insert into stylesheet
We use our own abstraction over the browser's stylesheet to insert the rule into the dom. This abstraction also works on node, letting us do stuff like SSR, etc. It also uses different modes of inserting styles based on the environment, as detailed here
... but the link is a stub. I would suggest looking into implementaion details further and particularly what they mean by "this abstraction also works on node".