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.tmbundle: add use info for image drop action to the readme #2

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
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@

You can install this bundle in TextMate by opening the preferences and going to the bundles tab. After installation it will be automatically updated for you.

# Image Drop Action
Dragging an image into a LESS file will result in base64 data getting inserted into variables. The original idea was inspired by [this article about "Including Data URI Base64 encoded images easily (in LESS)"](https://github.com/cloudhead/less.js/wiki/Include-Data-URI-Base64-encoded-images-easily)

For example;

Dragging and dropping "hamburger.png" onto a LESS file produces:

@gfx-hamburger: "data:image/png;base64,[data]=";
@gfx-hamburger-width: 79px;
@gfx-hamburger-height: 90px;

Which can be used thusly:

background-image:url(@gfx-hamburger);
background-size:@gfx-hamburger-width @gfx-hamburger-height;


# License (MIT)

Copyright (c) 2010 Scott Kyle and Rasmus Andersson
Expand Down