Building style guides with tdcss.js
In TDD, tests are written to test functional blocks of code and match the specification. After this, you write the code that makes test pass
.
When applying test-driven CSS, the style guide is your test. After making changes in your Sass code, all the user interface elements in your style guide should still look as required.
Jakob Løkke Madsen (@jakobloekke) promotes test-driven development for CSS code. Madsen wrote the tdcss.js framework, which is a super simple style guide tool. The tdcss.js
framework only depends on jQuery, and it is especially well-suited for adopting a test-driven approach to CSS styling. You can also use the tdcss.js framework to build a regular online style guide.
Getting ready
Download the tdcss.js
file at https://github.com/jakobloekke/tdcss.js/archive/master.zip. Unzip this file in your working directory, which will create a folder called tdcss.js-master
. Rename the tdcss.js-master
folder to match the directory structure used...