davidefavia / jquery-mobile-theme-lesscss

jQuery Mobile base theme (5 swatches) integrated with LessCSS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jQuery Mobile theme with LessCSS

This project aims to integrate LessCSS with jQuery Mobile base theme as downloaded from theme roller. The project is actually based on jQuery Mobile version 1.3.1.

It compiles with both LessElements and LessHAT. Conditional browser vendor prefixes is an idea stolen from LessHAT.

Configuration

File global.less let you define which browser vendors prefixes you want to include and global variables for your jQuery Mobile application.

File app.less let you import all swatches you need (default: a,b,c,d,e), jQuery Mobile mixins and global variables. Just edit app.less to import more or less options (e.g. a second mixins file, other swatches of few swatches).

Every swatch file (e.g. swatch-a.less) includes two sections: swatch variables (colors, dimensions, fonts) and css rules. You can edit everything you need to fit your application look and feel.

How to manually create new swatch

If you don't know what a theme swatch means in jQuery Mobile, read here.

If you need to add a swatch (e.g. called f) simply:

  1. copy and paste swatch-a.less (inside themes directory) renaming it as swatch-f.less
  2. open swatch-f.less with your preferred editor and:
    • search for @a- and replace with @f-
    • search for .ui-bar-a and replace with .ui-bar-f
    • search for .ui-body-a and replace with .ui-body-f
    • search for .ui-overlay-a and replace with .ui-overlay-f
    • search for .ui-btn-up-a and replace with .ui-btn-up-f
    • search for .ui-btn-hover-a and replace with .ui-btn-hover-f
    • search for .ui-btn-down-a and replace with .ui-btn-down-f
  3. change what you need and save swatch-f.less
  4. add @import "swatch-f.less"; line to app.less
  5. compile theme.less to theme.css

Contacts

For any problem file an issue or ask me on Twitter.

License MIT

Copyright (c) 2013 davide favia davide.favia@gmail.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

jQuery Mobile base theme (5 swatches) integrated with LessCSS