2 var ruleCache = new Set()
4 function createStyleNode() {
5 const node = document.createElement('style')
6 // Without it, IE will have a broken source order specificity if we
7 // insert rules after we insert the style tag.
8 // It seems to kick-off the source order specificity algorithm.
9 node.textContent = '\n'
10 document.head.appendChild(node);
14 var staticSheet = createStyleNode();
15 var sheet = createStyleNode().sheet;
17 function sync_static(newStyleString) {
18 staticSheet.textContent = newStyleString
21 function sync(newStyles) {
22 Object.keys(newStyles).forEach((key) => {
23 if (!ruleCache.has(key)) {
24 const newRule = newStyles[key]
25 for (var i = 0; i < newRule.length; i++) {
26 sheet.insertRule(newRule[i])
33 class CssRulesNode extends HTMLElement {
38 customElements.define('elm-ui-rules', CssRulesNode);
40 class CssStaticRulesNode extends HTMLElement {
45 customElements.define('elm-ui-static-rules', CssStaticRulesNode);
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list