UNPKG

4.88 kBMarkdownView Raw
1# Stylus [![Build Status](https://travis-ci.org/LearnBoost/stylus.svg?branch=master)](https://travis-ci.org/LearnBoost/stylus)
2
3 Stylus is a revolutionary new language, providing an efficient, dynamic, and expressive way to generate CSS. Supporting both an indented syntax and regular CSS style.
4
5## Installation
6
7```bash
8$ npm install stylus -g
9```
10
11### Example
12
13```
14border-radius()
15 -webkit-border-radius: arguments
16 -moz-border-radius: arguments
17 border-radius: arguments
18
19body a
20 font: 12px/1.4 "Lucida Grande", Arial, sans-serif
21 background: black
22 color: #ccc
23
24form input
25 padding: 5px
26 border: 1px solid
27 border-radius: 5px
28```
29
30compiles to:
31
32```css
33body a {
34 font: 12px/1.4 "Lucida Grande", Arial, sans-serif;
35 background: #000;
36 color: #ccc;
37}
38form input {
39 padding: 5px;
40 border: 1px solid;
41 -webkit-border-radius: 5px;
42 -moz-border-radius: 5px;
43 border-radius: 5px;
44}
45```
46
47the following is equivalent to the indented version of Stylus source, using the CSS syntax instead:
48
49```
50border-radius() {
51 -webkit-border-radius: arguments
52 -moz-border-radius: arguments
53 border-radius: arguments
54}
55
56body a {
57 font: 12px/1.4 "Lucida Grande", Arial, sans-serif;
58 background: black;
59 color: #ccc;
60}
61
62form input {
63 padding: 5px;
64 border: 1px solid;
65 border-radius: 5px;
66}
67```
68
69### Features
70
71 Stylus has _many_ features. Detailed documentation links follow:
72
73 - [css syntax](docs/css-style.md) support
74 - [mixins](docs/mixins.md)
75 - [keyword arguments](docs/kwargs.md)
76 - [variables](docs/variables.md)
77 - [interpolation](docs/interpolation.md)
78 - arithmetic, logical, and equality [operators](docs/operators.md)
79 - [importing](docs/import.md) of other stylus sheets
80 - [introspection api](docs/introspection.md)
81 - type coercion
82 - [@extend](docs/extend.md)
83 - [conditionals](docs/conditionals.md)
84 - [iteration](docs/iteration.md)
85 - nested [selectors](docs/selectors.md)
86 - parent reference
87 - in-language [functions](docs/functions.md)
88 - [variable arguments](docs/vargs.md)
89 - built-in [functions](docs/bifs.md) (over 60)
90 - optional [image inlining](docs/functions.url.md)
91 - optional compression
92 - JavaScript [API](docs/js.md)
93 - extremely terse syntax
94 - stylus [executable](docs/executable.md)
95 - [error reporting](docs/error-reporting.md)
96 - single-line and multi-line [comments](docs/comments.md)
97 - css [literal](docs/literal.md)
98 - character [escaping](docs/escape.md)
99 - [@keyframes](docs/keyframes.md) support & expansion
100 - [@font-face](docs/font-face.md) support
101 - [@media](docs/media.md) support
102 - Connect [Middleware](docs/middleware.md)
103 - TextMate [bundle](docs/textmate.md)
104 - Coda/SubEtha Edit [Syntax mode](https://github.com/atljeremy/Stylus.mode)
105 - gedit [language-spec](docs/gedit.md)
106 - VIM [Syntax](https://github.com/wavded/vim-stylus)
107 - [Firebug extension](docs/firebug.md)
108 - heroku [web service](http://styl.heroku.com) for compiling stylus
109 - [style guide](https://github.com/lepture/ganam) parser and generator
110 - transparent vendor-specific function expansion
111
112### Community modules
113
114 - https://github.com/LearnBoost/stylus/wiki
115
116### Framework Support
117
118 - [Connect](docs/middleware.md)
119 - [Play! 2.0](https://github.com/patiencelabs/play-stylus)
120 - [Ruby On Rails](https://github.com/lucasmazza/ruby-stylus)
121 - [Meteor](http://docs.meteor.com/#stylus)
122
123### CMS Support
124
125 - [DocPad](https://github.com/bevry/docpad)
126 - [Punch](https://github.com/laktek/punch-stylus-compiler)
127
128### Screencasts
129
130 - [Stylus Intro](http://screenr.com/bNY)
131 - [CSS Syntax & Postfix Conditionals](http://screenr.com/A8v)
132
133### Authors
134
135 - [TJ Holowaychuk (visionmedia)](http://github.com/visionmedia)
136
137### More Information
138
139 - Language [comparisons](docs/compare.md)
140
141## License
142
143(The MIT License)
144
145Copyright (c) 2010 LearnBoost <dev@learnboost.com>
146
147Permission is hereby granted, free of charge, to any person obtaining
148a copy of this software and associated documentation files (the
149'Software'), to deal in the Software without restriction, including
150without limitation the rights to use, copy, modify, merge, publish,
151distribute, sublicense, and/or sell copies of the Software, and to
152permit persons to whom the Software is furnished to do so, subject to
153the following conditions:
154
155The above copyright notice and this permission notice shall be
156included in all copies or substantial portions of the Software.
157
158THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
159EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
160MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
161IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
162CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
163TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
164SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.