When creating documentation, it is highly desirable to show custom runnbable css or javascript. Sites like JSFiddle allow previewing runnable working code but two problems-
Snippets allow you to embed runnable JavaScript, CSS, and HTML code blocks right in the body of a post.
To create a snippet, click on the snippet button on the editor toolbar
For snippet code, add the javascript functions or css you want to add. If you want to run complex stuff, write it with proper html/body tags. Save the edit and whenever the page loads, the snippet is run and output displayed. For instance, here is an example of formatting a html select element using select2 javascript plugin-
Under the hood, we run snippets in a sandboxed iframe with code loaded from another sister website - https://dilifsnippets.com
But still snippets are not fully free from malicious code like infinite loops. Hence we have restricted snippets to documentation which is written by the project owner alone.