2 var ruleCache = new Set()
4 function createStyleNode() {
6 const node = document.createElement('style')
7 // Without it, IE will have a broken source order specificity if we
8 // insert rules after we insert the style tag.
9 // It seems to kick-off the source order specificity algorithm.
10 node.textContent = '\n'
11 document.head.appendChild(node);
16 var staticSheet = createStyleNode();
17 var sheet = createStyleNode().sheet;
21 function sync_static(newStyleString) {
22 staticSheet.textContent = newStyleString
25 function sync(newStyles) {
26 Object.keys(newStyles).forEach((key) => {
27 if (!ruleCache.has(key)) {
28 const newRule = newStyles[key]
29 sheet.insertRule(newRule)
35 class CssRulesNode extends HTMLElement {
40 sync(this.rulesPayload)
43 console.log("set rules")
45 if (self.rulesPayload) {
46 console.log(self.rulesPayload)
49 console.log(this._rules)
51 attributeChangedCallback(attrName, oldVal, newVal) {
52 console.log(attrName, oldVal, newVal)
55 customElements.define('elm-ui-rules', CssRulesNode);
59 class CssStaticRulesNode extends HTMLElement {
65 // console.log("static connected")
68 // sync_static(this._rules)
73 sync_static(this._rules)
74 // console.log("set static rules")
78 attributeChangedCallback(attrName, oldVal, newVal) {
79 console.log("attribute cng")
81 if (attrName == "rules") {
86 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