diagnostics
The warnings produced by the last render. Nothing in the language is a fatal error, so this is where problems show up.
Syntax
- doodle.diagnostics
An array of { message } objects. A warning from the code also carries its place in the source:
index, the character offset, or pos, the zero-based [column, line] from the parser.
Each one is also dispatched as a warn event on every render.
Warnings from @doodle() bodies, from @shaders, @pattern and @scene,
and WebGL context lost only arrive as events.
Reported situations include an unknown function called with arguments,
an unclosed parenthesis, a @keyframes without a name, and a @use variable that includes itself.
Examples
const doodle = document.querySelector('css-doodle');
doodle.update(`
@grid: 5 / 60vmin;
background: @colour(red, blue);
`);
console.log(doodle.diagnostics);
// [{ message: 'unknown function @colour()', index: … }]