Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 87 lines (50 sloc) 3.608 kb
8477cbbd »
2011-09-28 coffeescripted-sbt -> less-sbt
1 # less sbt
2
3 type [less](http://lesscss.org/) css in your sbt projects
4
cd4a12e2 »
2011-09-30 Edited README.md via GitHub
5 ![LESS](http://lesscss.org/images/logo.png) ![Scala](https://github.com/downloads/softprops/coffeescripted-sbt/scala_logo.png)
6
15aaac75 »
2012-02-06 update readme
7 a friendly css companion for [coffeescripted-sbt][coffeescript]
94d4c0de »
2011-09-29 updated readme
8
9 ## settings
10
11 less # compiles less source files
12 charset(for less) # character encoding used in file IO (defaults to utf-8)
13 mini(for less) # setting for compiled minification (false by default)
14 filter(for less) # filter for files included by the plugin
15 exclude-filter(for less) # filter for files ignored by the plugin
16 unmanaged-sources(for less) # lists resolved less sources
17 clean(for less) # deletes compiled css
18 config:source-directory(for less) # where less files will be resolved from
ae4fb399 »
2011-09-30 corrections
19 config:resource-managed(for less) # where compiled css will be copied to
94d4c0de »
2011-09-29 updated readme
20
21 ## install it
22
3903f4cb »
2012-02-22 close enough to release
23 In your plugin definition, add
94d4c0de »
2011-09-29 updated readme
24
bfe8cf83 »
2012-02-23 0.1.8 was botched\!. thanks to my BFF IVY
25 addSbtPlugin("me.lessis" % "less-sbt" % "0.1.9")
94d4c0de »
2011-09-29 updated readme
26
7c0f54ff »
2012-02-23 was i drinking earlier
27 If you have not already added the sbt community plugin resolver, add this here as well with
3903f4cb »
2012-02-22 close enough to release
28
29 resolvers += Resolver.url("sbt-plugin-releases",
30 new URL("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/"))(
31 Resolver.ivyStylePatterns)
32
33 Then in your build definition, add
94d4c0de »
2011-09-29 updated readme
34
35 seq(lessSettings:_*)
36
3903f4cb »
2012-02-22 close enough to release
37 This will append `less-sbt`'s settings for the `Compile` and `Test` configurations.
94d4c0de »
2011-09-29 updated readme
38
f1dcda4b »
2012-02-22 better grammar
39 To add them to other configurations, use the provided `lessSettingsIn(config)` method.
94d4c0de »
2011-09-29 updated readme
40
41 seq(lessSettingsIn(SomeOtherConfig):_*)
42
ae4fb399 »
2011-09-30 corrections
43 ## use it
44
3bed66b2 »
2012-02-22 apos
45 Author your `.less` files under your project's `src/main/less` directory. After compiling less sources, you can find the compiled css under `path/to/resource_managed/main/css`
ae4fb399 »
2011-09-30 corrections
46
94d4c0de »
2011-09-29 updated readme
47 ## customize it
48
34681fed »
2012-02-03 a little more readme content
49 ### using less's built-in css minification
50
86e6a9e3 »
2012-02-23 another typo
51 `lesscss` provides a built-in minifier which you can to to shink your compiled css. To override the default `mini` setting, add following to your build definition after including the less settings.
94d4c0de »
2011-09-29 updated readme
52
53 (LessKeys.mini in (Compile, LessKeys.less)) := true
42b46f25 »
2011-10-02 readme example for change location of compiled css files
54
34681fed »
2012-02-03 a little more readme content
55 ### changing target css destination
56
d5377d5c »
2012-02-03 wording
57 To change the default location of compiled css files, add the following to your build definition
42b46f25 »
2011-10-02 readme example for change location of compiled css files
58
59 (resourceManaged in (Compile, LessKeys.less)) <<= (crossTarget in Compile)(_ / "your_preference" / "css")
34681fed »
2012-02-03 a little more readme content
60
15aaac75 »
2012-02-06 update readme
61 ### working with [@import][importing]s
34681fed »
2012-02-03 a little more readme content
62
3903f4cb »
2012-02-22 close enough to release
63 Some lesscss projects, like [Twitter's Bootstrap][bootstrap] project contain one main `.less` file which imports multiple `.less` files using the [@import][importing] feature of lesscss. To achieve the same style of compilation with less-sbt, set the `filter` defined by less-sbt to the target of compilation.
34681fed »
2012-02-03 a little more readme content
64
1b461cb1 »
2012-02-03 pre
65 (LessKeys.filter in (Compile, LessKeys.less)) := "your_main.less"
34681fed »
2012-02-03 a little more readme content
66
71f03623 »
2012-02-03 no one would believe English is my first language
67 This will build a single `your_main.css` file which includes all of the @imported style definitions.
34681fed »
2012-02-03 a little more readme content
68
3903f4cb »
2012-02-22 close enough to release
69 To see an example of compiling [Bootstrap][bootstrap] itself, check out the [scripted bootstrap test](https://github.com/softprops/less-sbt/tree/master/src/sbt-test/less-sbt/bootstrap).
94d4c0de »
2011-09-29 updated readme
70
3903f4cb »
2012-02-22 close enough to release
71 You will find all custom `less-sbt` keys within the `LessKeys` module.
94d4c0de »
2011-09-29 updated readme
72
ae4fb399 »
2011-09-30 corrections
73 ## issues
74
15aaac75 »
2012-02-06 update readme
75 Have an issue? [Tell me about it][issues]
ae4fb399 »
2011-09-30 corrections
76
75710b4e »
2011-10-26 note on contributions
77 ## contributions
78
79 I'll take them where they make sense. Please use a feature branch in your fork, i.e. git checkout -b my-cool-feature, and if possible, write a [scripted test](http://eed3si9n.com/testing-sbt-plugins) for it.
80
3d1f0af5 »
2012-02-07 oh these years, how they do pass quickly
81 Doug Tangren (softprops) 2011-2012
34681fed »
2012-02-03 a little more readme content
82
15aaac75 »
2012-02-06 update readme
83 [issues]: https://github.com/softprops/less-sbt/issues
84 [importing]: http://lesscss.org/#-importing
34681fed »
2012-02-03 a little more readme content
85 [bootstrap]: http://twitter.github.com/bootstrap/
15aaac75 »
2012-02-06 update readme
86 [coffeescript]: https://github.com/softprops/coffeescripted-sbt#readme
Something went wrong with that request. Please try again.