Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 222 lines (170 sloc) 6.947 kB
a4b14f7 @rrrene Fix docs badge to README
rrrene authored
1 # Sass [![Gem Version](https://badge.fury.io/rb/sass.png)](http://badge.fury.io/rb/sass) [![Inline docs](http://inch-ci.org/github/sass/sass.svg)](http://inch-ci.org/github/sass/sass)
80c3b87 @nex3 Excise Haml from within files.
nex3 authored
2
3 **Sass makes CSS fun again**. Sass is an extension of CSS3,
4 adding nested rules, variables, mixins, selector inheritance, and more.
5 It's translated to well-formatted, standard CSS
6 using the command line tool or a web-framework plugin.
7
8 Sass has two syntaxes. The new main syntax (as of Sass 3)
9 is known as "SCSS" (for "Sassy CSS"),
10 and is a superset of CSS3's syntax.
11 This means that every valid CSS3 stylesheet is valid SCSS as well.
12 SCSS files use the extension `.scss`.
13
14 The second, older syntax is known as the indented syntax (or just "Sass").
15 Inspired by Haml's terseness, it's intended for people
16 who prefer conciseness over similarity to CSS.
17 Instead of brackets and semicolons,
18 it uses the indentation of lines to specify blocks.
19 Although no longer the primary syntax,
20 the indented syntax will continue to be supported.
21 Files in the indented syntax use the extension `.sass`.
d2e81e2 Made a few changes to the readme (using single quotes) and added an o…
hcatlin authored
22
dbd3c62 @nex3 Convert the README to markdown.
nex3 authored
23 ## Using
55e9de4 @nex3 Added basic Sass tutorial to README.
nex3 authored
24
80c3b87 @nex3 Excise Haml from within files.
nex3 authored
25 Sass can be used from the command line
26 or as part of a web framework.
3d490d2 @nex3 Clean up the Using section of the README.
nex3 authored
27 The first step is to install the gem:
c1b21a2 @nex3 Merb handler for Sass. This includes a pretty major restructuring of …
nex3 authored
28
80c3b87 @nex3 Excise Haml from within files.
nex3 authored
29 gem install sass
c1b21a2 @nex3 Merb handler for Sass. This includes a pretty major restructuring of …
nex3 authored
30
80c3b87 @nex3 Excise Haml from within files.
nex3 authored
31 After you convert some CSS to Sass, you can run
3d490d2 @nex3 Clean up the Using section of the README.
nex3 authored
32
7e46e35 @nex3 [Sass] Update the README.
nex3 authored
33 sass style.scss
3d490d2 @nex3 Clean up the Using section of the README.
nex3 authored
34
80c3b87 @nex3 Excise Haml from within files.
nex3 authored
35 to compile it back to CSS.
3d490d2 @nex3 Clean up the Using section of the README.
nex3 authored
36 For more information on these commands, check out
37
38 sass --help
39
80c3b87 @nex3 Excise Haml from within files.
nex3 authored
40 To install Sass in Rails 2,
41 just add `config.gem "sass"` to `config/environment.rb`.
42 In Rails 3, add `gem "sass"` to your Gemfile instead.
43 `.sass` or `.scss` files should be placed in `public/stylesheets/sass`,
55e9de4 @nex3 Added basic Sass tutorial to README.
nex3 authored
44 where they'll be automatically compiled
3d490d2 @nex3 Clean up the Using section of the README.
nex3 authored
45 to corresponding CSS files in `public/stylesheets` when needed
55e9de4 @nex3 Added basic Sass tutorial to README.
nex3 authored
46 (the Sass template directory is customizable...
66908c9 @nex3 Fix a bunch of broken links in the README.
nex3 authored
47 see [the Sass reference](http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#template_location-option) for details).
55e9de4 @nex3 Added basic Sass tutorial to README.
nex3 authored
48
e5e306a @nex3 [Sass] Update documentation to include Rack.
nex3 authored
49 Sass can also be used with any Rack-enabled web framework.
50 To do so, just add
51
670c7a7 @nschonni Add GHFM code fences to blocks
nschonni authored
52 ```ruby
53 require 'sass/plugin/rack'
54 use Sass::Plugin::Rack
55 ```
e5e306a @nex3 [Sass] Update documentation to include Rack.
nex3 authored
56
57 to `config.ru`.
58 Then any Sass files in `public/stylesheets/sass`
f5768d7 @brandondrew fixing grammar. (but the sentence seems to say that the sass files ge…
brandondrew authored
59 will be compiled into CSS files in `public/stylesheets` on every request.
e5e306a @nex3 [Sass] Update documentation to include Rack.
nex3 authored
60
ca0818e @curtisk Update README.md - small typo
curtisk authored
61 To use Sass programmatically,
aec3cc4 @nicolaisi Updated deadlinks
nicolaisi authored
62 check out the [YARD documentation](http://sass-lang.com/documentation/file.SASS_REFERENCE.html#using_sass).
c1b21a2 @nex3 Merb handler for Sass. This includes a pretty major restructuring of …
nex3 authored
63
dbd3c62 @nex3 Convert the README to markdown.
nex3 authored
64 ## Formatting
7db85d7 Updated the README and updated inline rdoc
packagethief authored
65
7e46e35 @nex3 [Sass] Update the README.
nex3 authored
66 Sass is an extension of CSS
67 that adds power and elegance to the basic language.
68 It allows you to use [variables][vars], [nested rules][nested],
69 [mixins][mixins], [inline imports][imports],
70 and more, all with a fully CSS-compatible syntax.
71 Sass helps keep large stylesheets well-organized,
72 and get small stylesheets up and running quickly,
73 particularly with the help of
74 [the Compass style library](http://compass-style.org).
75
aec3cc4 @nicolaisi Updated deadlinks
nicolaisi authored
76 [vars]: http://sass-lang.com/documentation/file.SASS_REFERENCE.html#variables_
77 [nested]: http://sass-lang.com/documentation/file.SASS_REFERENCE.html#nested_rules
78 [mixins]: http://sass-lang.com/documentation/file.SASS_REFERENCE.html#mixins
79 [imports]: http://sass-lang.com/documentation/file.SASS_REFERENCE.html#import
7e46e35 @nex3 [Sass] Update the README.
nex3 authored
80
81 Sass has two syntaxes.
82 The one presented here, known as "SCSS" (for "Sassy CSS"),
83 is fully CSS-compatible.
84 The other (older) syntax, known as the indented syntax or just "Sass",
85 is whitespace-sensitive and indentation-based.
86 For more information, see the [reference documentation][syntax].
87
aec3cc4 @nicolaisi Updated deadlinks
nicolaisi authored
88 [syntax]: http://sass-lang.com/documentation/file.SASS_REFERENCE.html#syntax
7e46e35 @nex3 [Sass] Update the README.
nex3 authored
89
90 To run the following examples and see the CSS they produce,
91 put them in a file called `test.scss` and run `sass test.scss`.
92
80c3b87 @nex3 Excise Haml from within files.
nex3 authored
93 ### Nesting
7e46e35 @nex3 [Sass] Update the README.
nex3 authored
94
95 Sass avoids repetition by nesting selectors within one another.
96 The same thing works for properties.
97
670c7a7 @nschonni Add GHFM code fences to blocks
nschonni authored
98 ```scss
99 table.hl {
100 margin: 2em 0;
101 td.ln { text-align: right; }
102 }
103
104 li {
105 font: {
106 family: serif;
107 weight: bold;
108 size: 1.2em;
109 }
110 }
111 ```
55e9de4 @nex3 Added basic Sass tutorial to README.
nex3 authored
112
80c3b87 @nex3 Excise Haml from within files.
nex3 authored
113 ### Variables
55e9de4 @nex3 Added basic Sass tutorial to README.
nex3 authored
114
7e46e35 @nex3 [Sass] Update the README.
nex3 authored
115 Use the same color all over the place?
116 Need to do some math with height and width and text size?
117 Sass supports variables, math operations, and many useful functions.
55e9de4 @nex3 Added basic Sass tutorial to README.
nex3 authored
118
670c7a7 @nschonni Add GHFM code fences to blocks
nschonni authored
119 ```scss
120 $blue: #3bbfce;
121 $margin: 16px;
917bd65 Mixin patch for Sass.
Garry Hill authored
122
670c7a7 @nschonni Add GHFM code fences to blocks
nschonni authored
123 .content_navigation {
124 border-color: $blue;
125 color: darken($blue, 10%);
126 }
917bd65 Mixin patch for Sass.
Garry Hill authored
127
670c7a7 @nschonni Add GHFM code fences to blocks
nschonni authored
128 .border {
129 padding: $margin / 2;
130 margin: $margin / 2;
131 border-color: $blue;
132 }
133 ```
917bd65 Mixin patch for Sass.
Garry Hill authored
134
80c3b87 @nex3 Excise Haml from within files.
nex3 authored
135 ### Mixins
917bd65 Mixin patch for Sass.
Garry Hill authored
136
7e46e35 @nex3 [Sass] Update the README.
nex3 authored
137 Even more powerful than variables,
138 mixins allow you to re-use whole chunks of CSS,
139 properties or selectors.
140 You can even give them arguments.
917bd65 Mixin patch for Sass.
Garry Hill authored
141
670c7a7 @nschonni Add GHFM code fences to blocks
nschonni authored
142 ```scss
143 @mixin table-scaffolding {
144 th {
145 text-align: center;
146 font-weight: bold;
147 }
148 td, th { padding: 2px; }
149 }
150
151 @mixin left($dist) {
152 float: left;
153 margin-left: $dist;
154 }
155
156 #data {
157 @include left(10px);
158 @include table-scaffolding;
159 }
160 ```
cc2551b @nex3 Add a bit about acceptable indentation to the README.
nex3 authored
161
7e46e35 @nex3 [Sass] Update the README.
nex3 authored
162 A comprehensive list of features is available
aec3cc4 @nicolaisi Updated deadlinks
nicolaisi authored
163 in the [Sass reference](http://sass-lang.com/documentation/file.SASS_REFERENCE.html).
cc2551b @nex3 Add a bit about acceptable indentation to the README.
nex3 authored
164
dbd3c62 @nex3 Convert the README to markdown.
nex3 authored
165 ## Executables
a905690 @nex3 Add documentation for the executables to the README.
nex3 authored
166
80c3b87 @nex3 Excise Haml from within files.
nex3 authored
167 The Sass gem includes several executables that are useful
168 for dealing with Sass from the command line.
a905690 @nex3 Add documentation for the executables to the README.
nex3 authored
169
dbd3c62 @nex3 Convert the README to markdown.
nex3 authored
170 ### `sass`
a905690 @nex3 Add documentation for the executables to the README.
nex3 authored
171
dbd3c62 @nex3 Convert the README to markdown.
nex3 authored
172 The `sass` executable transforms a source Sass file into CSS.
173 See `sass --help` for further information and options.
a905690 @nex3 Add documentation for the executables to the README.
nex3 authored
174
d68d73f @nex3 [Sass] Mention sass-convert in the README.
nex3 authored
175 ### `sass-convert`
a905690 @nex3 Add documentation for the executables to the README.
nex3 authored
176
d68d73f @nex3 [Sass] Mention sass-convert in the README.
nex3 authored
177 The `sass-convert` executable converts between CSS, Sass, and SCSS.
178 When converting from CSS to Sass or SCSS,
179 nesting is applied where appropriate.
6a5ca98 @nex3 [Sass] A few more css2sass => sass-convert.
nex3 authored
180 See `sass-convert --help` for further information and options.
a905690 @nex3 Add documentation for the executables to the README.
nex3 authored
181
829c3f4 @chriseppstein Top level Gemfile for running sass executables.
chriseppstein authored
182 ### Running locally
183
184 To run the Sass executables from a source checkout instead of from rubygems:
185
186 ```
187 $ cd <SASS_CHECKOUT_DIRECTORY>
188 $ bundle
189 $ bundle exec sass ...
190 $ bundle exec scss ...
191 $ bundle exec sass-convert ...
192 ```
193
dbd3c62 @nex3 Convert the README to markdown.
nex3 authored
194 ## Authors
82ff534 Created a README and set up rdoc
packagethief authored
195
7461652 @kaelig Bring Hampton's bio up to date.
kaelig authored
196 Sass was envisioned by [Hampton Catlin](http://www.hamptoncatlin.com)
197 (@hcatlin). However, Hampton doesn't even know his way around the code anymore
198 and now occasionally consults on the language issues. Hampton lives in San
199 Francisco, California and works as VP of Technology
200 at [Moovweb](http://www.moovweb.com/).
3eda43c @nex3 Update the Authors section of the README.
nex3 authored
201
f13e5e2 @imagentleman Update Natalie's website link on README
imagentleman authored
202 [Natalie Weizenbaum](https://twitter.com/nex3) is the primary developer and architect of
6f192ce @nex3 Use my new name everywhere.
nex3 authored
203 Sass. Her hard work has kept the project alive by endlessly answering forum
80c3b87 @nex3 Excise Haml from within files.
nex3 authored
204 posts, fixing bugs, refactoring, finding speed improvements, writing
205 documentation, implementing new features, and getting Hampton coffee (a fitting
6f192ce @nex3 Use my new name everywhere.
nex3 authored
206 task for a girl genius). Natalie lives in Seattle, Washington and works on
31cbca5 @nex3 Update Hampton's and my section in the README.
nex3 authored
207 [Dart](http://dartlang.org) application libraries at Google.
3eda43c @nex3 Update the Authors section of the README.
nex3 authored
208
209 [Chris Eppstein](http://acts-as-architect.blogspot.com) is a core contributor to
210 Sass and the creator of Compass, the first Sass-based framework. Chris focuses
211 on making Sass more powerful, easy to use, and on ways to speed its adoption
212 through the web development community. Chris lives in San Jose, California with
2045a31 @jina Update Chris's bio.
jina authored
213 his wife and daughter. He is an Engineer for
214 [LinkedIn.com](http://linkedin.com), where one of his responsibilities is to
215 maintain Sass & Compass.
fe3ce19 @chriseppstein Added a Bio for myself to the README.
chriseppstein authored
216
6f192ce @nex3 Use my new name everywhere.
nex3 authored
217 If you use this software, you must pay Hampton a compliment. And buy Natalie
218 some candy. Maybe pet a kitten. Yeah. Pet that kitty.
8143e16 an update to the authorship in the README that was a loooong time coming
hcatlin authored
219
64ee1f0 @nex3 Moving Haml reference stuff to the Haml module and out of README.
nex3 authored
220 Beyond that, the implementation is licensed under the MIT License.
dbd3c62 @nex3 Convert the README to markdown.
nex3 authored
221 Okay, fine, I guess that means compliments aren't __required__.
Something went wrong with that request. Please try again.