LESS is a dynamic stylesheet language. It extends CSS with dynamic behavior such as variables, mixins, operations and functions. Imagine being able to define a color one time and then use it in multiple places. To be able to say, "Take that background color and have it darken by 20% when I hover over it." Imagine being able to use rounded corners without needing to remember and write the styles for all the different browsers, to be able to create gradients in CSS by just telling it the colors you want to use.
This session will introduce you to LESS, show you how to use it, and walk you through how to set up the software to use it. Since this is an extension of CSS, you should know some CSS. The examples will be taken from Bootstrap and Joomla JUI so having basic knowledge of that is helpful.
34. Debug Issues
Firebug gives CSS line
Search LESS files for
multiple selectors
Doesn't work when
nested
April 13, 2013 JDNE: LESS, The CSS Preprocessor 34
37. Joomla Bootstrap files
are already compiled
Some Bootstrap
template vendors don't
distribute LESS files
April 13, 2013 JDNE: LESS, The CSS Preprocessor 37
38. You don't need LESS in
Joomla
... but it's very helpful!
April 13, 2013 JDNE: LESS, The CSS Preprocessor 38
39. Joomla JUI files
media
jui
css
fonts
img
js
less
April 13, 2013 JDNE: LESS, The CSS Preprocessor 39
47. Bootstrap.less
contains @imports of
other less files.
Replace bootstrap.less
with template.less in
your template.
April 13, 2013 JDNE: LESS, The CSS Preprocessor 47
48. mytemplate
css
template.css
html
images
less
template.less
variables.less
index.php
April 13, 2013 JDNE: LESS, The CSS Preprocessor 48
49. variables.less
Sets up variables for
your template
Copy file from media/jui/
less and change it in your
template
April 13, 2013 JDNE: LESS, The CSS Preprocessor 49
51. template.less
@import less files from
media/jui/less
@import any less files in
your template
Add styles for your
template using less
April 13, 2013 JDNE: LESS, The CSS Preprocessor 51
52. Remember,
straight CSS
is valid LESS.
Add in LESS where it is
helpful. Ignore it where
it would be confusing.
April 13, 2013 JDNE: LESS, The CSS Preprocessor 52