defineCSS function

CssStyleDeclaration defineCSS(
  1. CssStyleDeclaration? currentCSS,
  2. CssStyleDeclaration? appendCSS, [
  3. 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 {
    return CssStyleDeclaration()
      ..cssText = '${currentCSS.cssText!} ; ${appendCSS.cssText!}';
  }
}