@stylable/runtime
Advanced tools
Comparing version 4.5.1 to 4.6.0
@@ -12,12 +12,12 @@ "use strict"; | ||
var style = d.createElement('style'); | ||
style.setAttribute('st-depth', depth); | ||
style.setAttribute('st-id', namespace); | ||
style.setAttribute('st-runtime', runtimeId); | ||
style.setAttribute('st_id', namespace); | ||
style.setAttribute('st_depth', depth); | ||
style.setAttribute('st_runtime', runtimeId); | ||
style.textContent = css; | ||
var loadedStyleElements = head.querySelectorAll('style[st-runtime="' + runtimeId + '"]'); | ||
var loadedStyleElements = head.querySelectorAll('style[st_runtime="' + runtimeId + '"]'); | ||
var inserted = false; | ||
for (var i = 0; i < loadedStyleElements.length; i++) { | ||
var styleElement = loadedStyleElements[i]; | ||
var stId = styleElement.getAttribute('st-id'); | ||
var stDepth = Number(styleElement.getAttribute('st-depth')); | ||
var stId = styleElement.getAttribute('st_id'); | ||
var stDepth = Number(styleElement.getAttribute('st_depth')); | ||
if (stId === namespace) { | ||
@@ -24,0 +24,0 @@ if (stDepth === depth) { |
@@ -9,12 +9,12 @@ export function injectStyles(host) { | ||
var style = d.createElement('style'); | ||
style.setAttribute('st-depth', depth); | ||
style.setAttribute('st-id', namespace); | ||
style.setAttribute('st-runtime', runtimeId); | ||
style.setAttribute('st_id', namespace); | ||
style.setAttribute('st_depth', depth); | ||
style.setAttribute('st_runtime', runtimeId); | ||
style.textContent = css; | ||
var loadedStyleElements = head.querySelectorAll('style[st-runtime="' + runtimeId + '"]'); | ||
var loadedStyleElements = head.querySelectorAll('style[st_runtime="' + runtimeId + '"]'); | ||
var inserted = false; | ||
for (var i = 0; i < loadedStyleElements.length; i++) { | ||
var styleElement = loadedStyleElements[i]; | ||
var stId = styleElement.getAttribute('st-id'); | ||
var stDepth = Number(styleElement.getAttribute('st-depth')); | ||
var stId = styleElement.getAttribute('st_id'); | ||
var stDepth = Number(styleElement.getAttribute('st_depth')); | ||
if (stId === namespace) { | ||
@@ -21,0 +21,0 @@ if (stDepth === depth) { |
{ | ||
"name": "@stylable/runtime", | ||
"version": "4.5.1", | ||
"version": "4.6.0", | ||
"description": "Stylable runtime DOM integration", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -17,8 +17,8 @@ /* eslint-disable no-var */ | ||
var style = d.createElement('style'); | ||
style.setAttribute('st-depth', depth as unknown as string); | ||
style.setAttribute('st-id', namespace); | ||
style.setAttribute('st-runtime', runtimeId); | ||
style.setAttribute('st_id', namespace); | ||
style.setAttribute('st_depth', depth as unknown as string); | ||
style.setAttribute('st_runtime', runtimeId); | ||
style.textContent = css; | ||
var loadedStyleElements = head.querySelectorAll<HTMLStyleElement>( | ||
'style[st-runtime="' + runtimeId + '"]' | ||
'style[st_runtime="' + runtimeId + '"]' | ||
); | ||
@@ -28,4 +28,4 @@ var inserted = false; | ||
var styleElement = loadedStyleElements[i]; | ||
var stId = styleElement.getAttribute('st-id'); | ||
var stDepth = Number(styleElement.getAttribute('st-depth')); | ||
var stId = styleElement.getAttribute('st_id'); | ||
var stDepth = Number(styleElement.getAttribute('st_depth')); | ||
if (stId === namespace) { | ||
@@ -32,0 +32,0 @@ if (stDepth === depth) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet