Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F95026596
css.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Dec 12, 06:37
Size
825 B
Mime Type
text/x-java
Expires
Sat, Dec 14, 06:37 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22916282
Attached To
rOACCT Open Access Compliance Check Tool (OACCT)
css.js
View Options
import
getComputedStyle
from
'./getComputedStyle'
;
import
hyphenate
from
'./hyphenateStyle'
;
import
isTransform
from
'./isTransform'
;
function
style
(
node
,
property
)
{
var
css
=
''
;
var
transforms
=
''
;
if
(
typeof
property
===
'string'
)
{
return
node
.
style
.
getPropertyValue
(
hyphenate
(
property
))
||
getComputedStyle
(
node
).
getPropertyValue
(
hyphenate
(
property
));
}
Object
.
keys
(
property
).
forEach
(
function
(
key
)
{
var
value
=
property
[
key
];
if
(
!
value
&&
value
!==
0
)
{
node
.
style
.
removeProperty
(
hyphenate
(
key
));
}
else
if
(
isTransform
(
key
))
{
transforms
+=
key
+
"("
+
value
+
") "
;
}
else
{
css
+=
hyphenate
(
key
)
+
": "
+
value
+
";"
;
}
});
if
(
transforms
)
{
css
+=
"transform: "
+
transforms
+
";"
;
}
node
.
style
.
cssText
+=
";"
+
css
;
}
export
default
style
;
Event Timeline
Log In to Comment