Generate formatted CSS which would otherwise be tedious to code by hand.
Using variables and a bit of custom logic, you can generate repetitive code snippets with parameters/arguments that differ slightly from snippet-to-snippet.
Project utilizes the prettify.js library by Google and Vim Sunburst Theme by David Leibovic.
Clone the repo and replace the sample code in the <pre>
block with your own. Use the <span class="nocode">
blocks to play with your variables. You can inspect the existing logic tied to the id
attributes (postNumber
& thumbnail
) for an example on how this works.
When using the app in-browser, first click Generate Snippets
to generate your snippets with set parameters, then Print Snippets
to display. Buttons will disappear once results are displayed. Refresh the page to restart.
The default example sets the following parameters in generator.js:
id="postNumber"(index.html)
initialized asvar postNumber = 20;
id="thumbnail"(index.html)
initialized asvar thumbnail = 1;
const moduleCount = 3;
represents number of code snippets to display