presets ยท console.warn
themeFromMui(theme).apply(element) was given...
Printed by presets, prefixed [lattice], since 1.80.0.
Warnings reference › presets:themefrommui-apply-no-element
- Identifier
presets:themefrommui-apply-no-element- Raised by
- presets
- Since
- 1.80.0
What happened
apply(element) sets the resolved --lattice-* tokens as inline custom properties on element, which needs a real style.setProperty. The value passed had none - not a DOM element, or a plain object with no style - so nothing was themed.
The fix
Pass the element you want themed: themeFromMui(theme).apply(document.querySelector('.lattice')), or the grid's own root element.
The smallest fix
const { apply } = themeFromMui(theme);
apply(document.querySelector('.lattice'));
Reference
Covered in full at the API reference.