You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently codeExample accepts an autogenCSS boolean argument for whether to compile the Sass inputs and render the outputs. Many examples set this value to false because the examples want to focus on the Sass inputs without showing the CSS output. However, this is error prone because we can (and have) published broken examples such as list.separator(1, 2) because there was no compilation, and therefore no validation. codeExample should compile Sass regardless even when not showing the CSS output to avoid these problems.
On the other hand, it's important to have a lever that would actually disable compilation for cases where the example is intentionally broken code. Or.. better yet, if the example is intentionally broken, then show the error message instead of what would have been the CSS output.
Overall the proposal is so that instead of <% codeExample 'foo', false %> we could pass an options object:
<% codeExample 'foo', {showCssOutput: false} %>
Simpler Options object
The overall options interface can be something like this:
interfaceCodeExampleOptions{/** Whether to show the CSS output or the failure message. */showOutput?: boolean;// defaults true/** Assert whether the compilation should succeed or fail. */success?: boolean;// defaults true}Regardlessoftheoutcome,theinputwillalwaysbecompiled.
Extra:
Currently codeExample doesn't seem to be able to compile multiple files, this forces having to turn off compilation entirely. If we want to compile everything we should then expand this to be able to compile multiple files.
Otherwise, another interface property skipCompilation?: boolean // defaults false may be required.
The text was updated successfully, but these errors were encountered:
Currently
codeExample
accepts anautogenCSS
boolean argument for whether to compile the Sass inputs and render the outputs. Many examples set this value tofalse
because the examples want to focus on the Sass inputs without showing the CSS output. However, this is error prone because we can (and have) published broken examples such aslist.separator(1, 2)
because there was no compilation, and therefore no validation.codeExample
should compile Sass regardless even when not showing the CSS output to avoid these problems.On the other hand, it's important to have a lever that would actually disable compilation for cases where the example is intentionally broken code. Or.. better yet, if the example is intentionally broken, then show the error message instead of what would have been the CSS output.
Overall the proposal is so that instead of
<% codeExample 'foo', false %>
we could pass an options object:Simpler Options object
The overall options interface can be something like this:
Extra:
Currently
codeExample
doesn't seem to be able to compile multiple files, this forces having to turn off compilation entirely. If we want to compile everything we should then expand this to be able to compile multiple files.Otherwise, another interface property
skipCompilation?: boolean // defaults false
may be required.The text was updated successfully, but these errors were encountered: