defineCSS function
CSSStyleDeclaration
defineCSS(
- CSSStyleDeclaration? currentCSS,
- CSSStyleDeclaration? appendCSS, [
- dynamic defaultCSS
Defines a new CSSStyleDeclaration merging currentCSS
and appendCSS
.
defaultCSS
if currentCSS
and appendCSS
are null
.
Implementation
CSSStyleDeclaration defineCSS(
CSSStyleDeclaration? currentCSS, CSSStyleDeclaration? appendCSS,
[dynamic defaultCSS]) {
if (currentCSS == null) {
return appendCSS ?? asCssStyleDeclaration(defaultCSS);
} else if (appendCSS == null) {
return currentCSS;
} else {
var css = HTMLTemplateElement().style;
css.cssText = '${currentCSS.cssText} ; ${appendCSS.cssText}';
return css;
}
}