Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LESS Hat 101 #138

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,70 @@ The structure of this repo is:
* **Bower** – is like NPM for frontend. NPM is like Gems for JavaScript. I could go on forever…
* **package.json** – contains meta data for NPM.

### Add LESS Hat to your project

// Manual download
@import "lesshat.less"

// OR via bower
@import "../bower-components/lesshat/build/lesshat.less

// Usage
div {
.border-radius(5px);
}

// Result
div {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}

In some cases, LESS Hat will be used with other front-end CSS frameworks such as
[Twitter Bootstrap](http://getbootstrap.com/). However, some of Bootstrap's
mixins collide with the LESS Hat mixins. For people using LESS Hat with
Bootstrap, we've provided a prefixed version of our library.

// bootstrap
@import "../bower-components/bootstrap/less/bootstrap.less";

// prefixed-lesshat
// mixins are prefixed with ".lh-"
@import "../bower-components/lesshat/build/lesshat-prefixed.less";

// Usage
div {
.lh-border-radius(5px);
}

// Result
div {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}

Alternatively, some users may wish to create their own namespace for the
LESS Hat.

// Create custom namespace for LESS Hat
#poly {
@import "../bower-components/lesshat/build/lesshat.less";
}

// Usage
div {
#poly.border-radius(5px);
}

// Result
div {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}

### Structure of LESS Hat mixins

1. **Typical LESS Hat mixin**:
Expand Down