Proposal: codeExample
should compile Sass even when not showing the CSS output
#834
Labels
codeExample
should compile Sass even when not showing the CSS output
#834
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: