Less is a CSS pre-processor, meaning that it extends the CSS language, adding features that allow variables, mixins, functions and many other techniques that allow you to make CSS that is more maintainable, themable and extendable.
Less runs inside Node, in the browser and inside Rhino. There are also many 3rd party tools that allow you to compile your files and watch for changes.
ChadCollins.com uses Less to perform many theme optimizations and performance improvements. By using Less you unlock the themes true framework power. You can modify header and sidebar options, create new color schemes, or disable plugins and resources in the blink of an eye.
Class | Description |
---|---|
Website: | http://lesscss.org/# |
Documentation: | http://lesscss.org/features/ |
Git Branch: | https://github.com/less/less.js |
As previously mentioned Less is a css pre-processor, which means that the data needs to be compiled prior to use. There are many advanced ways to do this. However, for the purpose of this tutorial we are going to use the Windows based GUI compiler WinLESS. This will allow even those who have never used Less to get up and started quickly.
GUI Compiler | Website | Operating System |
---|---|---|
WinLess: | https://github.com/marklagendijk/WinLess | Windows |
LESS.app: | http://incident57.com/less | OSx |
Plessc: | https://github.com/Mte90/Plessc | Linux |
More Info: | http://lesscss.org/usage/#guis-for-less | Mixed |
.less
files are automatically detected and recompiled into theme.css
. If you do not see a confirmation message please check that the setting in "Step 3" has been turned on.ChadCollins.com uses a Child-Theme based file methodology to organize and structure its files. Many individuals with experience in Wordpress or Drupal may already be familiar with this system. This type of organization focuses on creating a "Parent" or "Base" theme which is responsible for creating nearly every element found in the framework. A "Child" theme is then created which inheritants these Parent base styles.
By using this system the user can make theme edits and changes without ever modifying the themes core, a task solely reserved for the themes author. This ensures theme stability and most importantly seperates the authors work from yours.
Author Updates - Theme Core/"Parent Theme"
User Updates - Child Theme(default-skin) or any other you create
The "default_skin" is a premade Child-Theme we have provided to get you started. It applies all of its own settings, colors, and options to the elements it pulls from the Parent Theme. Creating a new unique theme without ever directly modifying the themes core.
theme/assets/skins/default_skin/less/
- theme.less
- theme-base.less
- theme-settings.less
- theme-variables.less
Directory File | File Overview |
---|---|
theme.less | Themes Master Less file. Pulls in all options and resources required for the entire theme and outputs a single theme.css file. This is the only file which needs to be compiled. |
theme-base.less | Responsible for taking set variables and using them to create all of the themes UI elements. Including the grid, buttons, tabs, etc. It handles nearly everything except colors, plugins, and general theme settings. |
theme-settings.less | File is responsible for determining what skins are activiated, what plugins are used, and what external resources are pulled. Its primary role is to help quickly reduce the bloat added from unwanted features or skins. |
theme-variables.less | This file sets variables which determine the appearance of nearly all theme elements. While theme-base.less creates the elements, it's this file which determines what color, size, and shape they should be. |
Many websites will not need every feature, skin, or option that our framework includes. To help minimize bloat, reduce file size, and increase site performance we have included many built-in Less variables and settings. Nearly all of these performance options are found in your child themes theme-settings.less
file. Below you will find a listing of Less variables that will help you create a unique theme optimized specifically for your needs
ChadCollins.com contains a css animation library called Animate.css. ChadCollins.com has broken the library into several smaller peices as its file size is very large when all animations are included. You can help reduce the overall file size of theme.css
by setting animation styles you do not need to "false".
theme/assets/skins/default_skin/less/settings.less
As of patch 1.4 ChadCollins.com removed Glyphicons Pro from its core as it is very large in size. Glyphicons Halflings and Font Awesome are now the only two libraries activated by default. This greatly helps reduce the overall file size of theme.css
. However, if you need an additional font library simply uncomment any of the desired font libraries.
theme/assets/skins/default_skin/less/settings.less
As seen below all plugins have had their stylesheets listed/imported in the same area. This makes it incredibly easy to disable any plugin styles you do not need. This will slightly reduce the file size of theme.css
. When combined with other optimizations this can help squeeze out every last bit of performance from the theme.
theme/assets/skins/default_skin/less/settings.less
ChadCollins.com includes Eight seperate contextual styles which can be applied to nearly every element in the framework. However, many sites will only need to use 2-3 different colors(contextuals). You can greatly reduce the overall file size of theme.css
by setting colors you do not need to "false".
theme/assets/skins/default_skin/less/settings.less
Sometimes you may need a contextual/color but find you only need to use it on several elements. Here you can disable the color on a per-element basis. This will slightly reduce the file size of theme.css
. When combined with other optimizations this can help squeeze out every last bit of performance from the theme.
theme/assets/skins/default_skin/less/settings.less