This document discusses using CSS preprocessors like Less to organize complex CSS for modern web apps. It outlines problems with traditional CSS like repetition and lack of variables/nesting. CSS preprocessors allow features like variables, mixins, nested rules and operations to organize CSS into logical, reusable components. This improves maintainability by reducing repetition and separating structure from skin. The document gives examples of how preprocessor features can be combined to build a robust CSS architecture.
3. Snupps
We are a B2C, cross platform app on the web and
mobile that helps you organise your stuff.
We are an early stage startup.
We are getting ready to launch.
4. The problem
When you get to a certain point in life, you
1.
2.
3.
4.
Have too much stuff
Don¡¯t know what you have
Don¡¯t know where it is
Don¡¯t have quick access to the details
5. The solution
Snupps is the one place for you to store and keep
track of your stuff and have it at your fingertips at
all times.
10. Which begs the question...
How on Earth do we organise CSS?
11. The problem
Easy syntax
Cascading Style Sheets (CSS) is a simple mechanism
for adding style (e.g., fonts, colors, spacing) to Web
documents.¡±
ttp://www.w3.org/Style/CSS/Overview.en.html
Gentle learning curve
Conceptually minimalistic
12. The problem
Easy syntax
C¡±Cascading Style Sheets (CSS) is a simple
mechanism for adding style (e.g., fonts, colors,
spacing) to Web documents.¡±
http://www.w3.org/Style/CSS/Overview.en.html
Gentle learning curve
Conceptually minimalistic
Also minimal support for software engineering
14. CSS is simple enough for a simple document, but
today¡¯s average page on a web app is an
amalgamation of several heavily complex design
elements.
15. Every element may itself depend on an
amalgamation of different techniques, glued
together for the overall effect.
16. Each element on the page may be used more than
once. Maybe on different pages. Maybe variations
of its basic form.
17. Oh, did I just say Web App instead of Web
document?
18. Oh, did I just say Web App instead of Web
document?
Oops...
19. Compromises
Invariably, writing enough CSS for a website will
require that at least one of the following is
compromised
DRY (Don¡¯t Repeat Yourself)
CSS Modularization
Separation of Concerns (classitis)
25. A CSS preprocessor is an augmentation of the CSS
language that can be run through a script to
generate native CSS a browser can understand.
26. Why CSS preprocesing?
CSS preprocessing gives the developer tools to
organize their code and create reusable
components. It allows for the code to be grouped
in semantic, logical components that can be
defined elsewhere than where they are being
used.
38. There¡¯s much more...
Guarded mixins, client side usage, watch mode,
javascript functions, reading parameters from
other properties, debuggable in Web Inspector¡
The list goes on.
39. What about SASS?
Less is not the only CSS preprocessor. There
are different flavours of preprocessors with pros
and cons. What we covered here, can be used
on SASS as well, though the syntax may differ.
40. Architecture
This presentation is not meant to be an exhaustive
overview of less syntax but a display of how it can
be used to build a powerful CSS architecture for
modern day, complex web apps.
Less is almost as easy to learn as CSS. Go nuts!