Book Image

LESS WEB DEVELOPMENT COOKBOOK

Book Image

LESS WEB DEVELOPMENT COOKBOOK

Overview of this book

Table of Contents (19 chapters)
Less Web Development Cookbook
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Building style guides with tdcss.js


Jakob Løkke Madsen (https://twitter.com/jakobloekke) promotes test-driven CSS. Madsen wrote the tdcss.js framework, which is a simple style guide tool. The tdcss.js framework depends only on jQuery and is especially well-suited to adopt a test-driven approach to CSS styling. You can also use the tdcss.js framework to build a regular online style guide. In TDD, tests are written to test the functional blocks of code and match the specification. After this, you can write the code that should meet the test. In test-driven CSS, the style guide is your test. After making changes in your Less code, all the user interface elements in your style guide will look as required.

Getting ready

Download the tdcss.js files from https://github.com/jakobloekke/tdcss.js/archive/master.zip. Unzip this file in your working directory, which will create a folder named tdcss.js-master.

How to do it…

  1. Create the following folder and file structure:

  2. Edit your less/buttons.less file to...