Book Image

Learning less.js

Book Image

Learning less.js

Overview of this book

Table of Contents (22 chapters)
Learning Less.js
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Creating the initial framework


Once you've made the decision to convert in order to use Less, there are a few steps that we can take, which help with the initial conversion process, before we start writing Less code.

Let's take a look at how we can make this process easier. For the purpose of this example, I'll assume that you have just one style sheet, called styles.css, and that you're working in a development environment on a simple HTML-based site in order to get accustomed to the conversion process.

  1. Start by renaming the sitestyles.css file with a .less extension to sitestyles.less.

  2. In a new file in your text editor, add the following:

    @import "sitestyles.less";
  3. Save this as styles.less. In your HTML code, change the existing link to sitestyles.css in order to point to sitestyles.less, using the following link:

      <link rel="stylesheet/less" href="css/styles.less">
      <script src="js/less.min.js"></script>

Use Crunch! or Sublime Text (depending on what you have set up in Chapter...