CSS (Cascading Style Sheets) is a style sheet language used for describing the presentation of a document written in a markup language like HTML.
CSS has evolved significantly since its inception, from a simple styling language to a powerful tool for web design.
CSS allows us to control various aspects of the appearance of your web pages, such as `color text`, `background color of layout`, `layout`, `colors`, `fonts`, and allow us to add spacing, making it an essential technology for web development.
Preprocessors like Sass, LESS, and Stylus further enhance CSS by introducing features that improve maintainability, reusability, and productivity.
Håkon Wium Lie first proposed CSS on October 10, 1994.
He worked with Tim Berners-Lee, the inventor of the World Wide Web, to incorporate the concept into the web.
In the early days of the web, styling was done using HTML attributes. This led to cluttered and difficult-to-maintain code.
Håkon Wium Lie introduced the concept of CSS in 1994, aiming to separate the structure of a document from its presentation. This would allow for more flexible and efficient styling of web pages.
The first CSS specification, CSS1, was released in 1996. It provided basic styling capabilities like font properties, colors, and margins.
CSS2 was published as a recommendation by the W3C in 1998, introducing more advanced features such as positioning, z-index, and media types.
CSS3 is not a single specification but a collection of modules, each adding new features to CSS. It began development around the mid-2000s and is still evolving today. CSS3 introduced features like transitions, animations, gradients, and flexible box layouts.
CSS preprocessors are scripting languages that extend the default capabilities of CSS.
They allow for more maintainable and scalable stylesheets by introducing features like variables, nesting, and functions. Some popular CSS preprocessors include:
Sass is one of the most popular CSS preprocessors.
It introduces features like variables, nesting, mixins, and inheritance, making CSS code more modular and easier to manage.
LESS is another popular CSS preprocessor that extends CSS with features like variables, mixins, nested rules, and functions.
It is often seen as more lightweight compared to Sass but offers similar functionality.