Last active
December 13, 2019 01:59
-
-
Save donquixote/f228ad928f00cb465230e47be30bd146 to your computer and use it in GitHub Desktop.
Revisions
-
donquixote revised this gist
Dec 13, 2019 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,4 @@ <!DOCTYPE html> <html> <head> <style> -
donquixote created this gist
Dec 13, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ <html> <head> <style> div { --varname: '5'; unknown_property: '5'; content: 'hello'; float: left; } </style> <script> var div = document.getElementsByTagName('div')[0]; var style = window.getComputedStyle(div); var keys = ['--varname', 'unknown_property', 'content', 'float']; var values = {}; for (var i in keys) { k = keys[i]; values[k] = style.getPropertyValue(k); } console.log(values); div.innerHTML = JSON.stringify(values); </script> </head> <body> <div>hello w</div> </body> </html>