registerStyleSheet function
Registers a stylesheet in the browser document head once by name.
Implementation
void registerStyleSheet(StyleSheet stylesheet) {
if (_registeredStyleSheets.contains(stylesheet.name)) return;
final head = web.document.querySelector('head');
if (head == null) return;
final element = web.document.createElement('style');
element.setAttribute('data-flint-stylesheet', stylesheet.name);
element.textContent = stylesheet.cssText;
head.appendChild(element);
_registeredStyleSheets.add(stylesheet.name);
}