decorateRootNodeWithPlatformClasses function
void
decorateRootNodeWithPlatformClasses({})
Appends CSS classes generated by getPlatformClasses to the specified rootNode
.
If you do not want defaultFeatureCssClassDecorators to be used,
set includeDefaults
to false
.
By default, rootNode
is document.documentElement
.
Implementation
void decorateRootNodeWithPlatformClasses(
{List<Feature>? features,
bool includeDefaults = true,
Element? rootNode,
void Function()? callback}) {
rootNode ??= document.documentElement;
if (rootNode != null && !nodeHasBeenDecorated(rootNode)) {
var existingClasses = domTokenListToListString(rootNode.classList);
rootNode.className = getPlatformClasses(
features: features,
includeDefaults: includeDefaults,
existingClasses: existingClasses);
if (callback != null) callback();
}
}