Book Image

Mastering Netbeans

5 (1)
Book Image

Mastering Netbeans

5 (1)

Overview of this book

Table of Contents (17 chapters)
Mastering NetBeans
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

CSS preprocessors


When developing web applications, we typically style applications using CSS. It gives us advantages when developing HTML in that the style of our applications is kept separate from the markup for a page, thus allowing us to easily change the styling of an application without modification to the page itself.

Unfortunately, CSS is a fairly simple rudimentary language and can, for example, lead us to the duplication of definitions. Consider the case where we wish to declare several classes with the same color font:

.main_text {
  color: #ff0000;
}

.sidebar_text {
  color: #ff0000;
}

In these two classes, we've had to duplicate the color value (#ff0000) twice. If we wanted to change this to, say, #0000ff, we'd need to change it in multiple places in the CSS file. An even bigger problem would be if we needed to change this color depending upon some other trigger. Using CSS, it would become terribly complex and error-prone to achieve these scenarios.

Fortunately, NetBeans allows...