sass 3.3.0 → 3.4.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.yardopts +3 -1
- data/CODE_OF_CONDUCT.md +10 -0
- data/CONTRIBUTING.md +148 -0
- data/MIT-LICENSE +1 -1
- data/README.md +76 -62
- data/Rakefile +104 -24
- data/VERSION +1 -1
- data/VERSION_DATE +1 -1
- data/VERSION_NAME +1 -1
- data/bin/sass +1 -1
- data/bin/scss +1 -1
- data/extra/sass-spec-ref.sh +32 -0
- data/extra/update_watch.rb +1 -1
- data/lib/sass/cache_stores/filesystem.rb +9 -5
- data/lib/sass/cache_stores/memory.rb +4 -5
- data/lib/sass/callbacks.rb +2 -2
- data/lib/sass/css.rb +12 -13
- data/lib/sass/deprecation.rb +55 -0
- data/lib/sass/engine.rb +106 -70
- data/lib/sass/environment.rb +39 -19
- data/lib/sass/error.rb +17 -20
- data/lib/sass/exec/base.rb +199 -0
- data/lib/sass/exec/sass_convert.rb +283 -0
- data/lib/sass/exec/sass_scss.rb +440 -0
- data/lib/sass/exec.rb +5 -771
- data/lib/sass/features.rb +9 -2
- data/lib/sass/importers/base.rb +8 -3
- data/lib/sass/importers/filesystem.rb +30 -38
- data/lib/sass/logger/base.rb +8 -2
- data/lib/sass/logger/delayed.rb +50 -0
- data/lib/sass/logger.rb +8 -3
- data/lib/sass/media.rb +1 -4
- data/lib/sass/plugin/compiler.rb +224 -90
- data/lib/sass/plugin/configuration.rb +38 -22
- data/lib/sass/plugin/merb.rb +2 -2
- data/lib/sass/plugin/rack.rb +3 -3
- data/lib/sass/plugin/rails.rb +1 -1
- data/lib/sass/plugin/staleness_checker.rb +4 -4
- data/lib/sass/plugin.rb +6 -5
- data/lib/sass/script/css_lexer.rb +1 -1
- data/lib/sass/script/css_parser.rb +2 -3
- data/lib/sass/script/css_variable_warning.rb +52 -0
- data/lib/sass/script/functions.rb +739 -318
- data/lib/sass/script/lexer.rb +134 -54
- data/lib/sass/script/parser.rb +252 -56
- data/lib/sass/script/tree/funcall.rb +13 -6
- data/lib/sass/script/tree/interpolation.rb +127 -4
- data/lib/sass/script/tree/list_literal.rb +31 -4
- data/lib/sass/script/tree/literal.rb +4 -0
- data/lib/sass/script/tree/node.rb +21 -3
- data/lib/sass/script/tree/operation.rb +54 -1
- data/lib/sass/script/tree/selector.rb +26 -0
- data/lib/sass/script/tree/string_interpolation.rb +59 -38
- data/lib/sass/script/tree/variable.rb +1 -1
- data/lib/sass/script/tree.rb +1 -0
- data/lib/sass/script/value/base.rb +17 -14
- data/lib/sass/script/value/bool.rb +0 -5
- data/lib/sass/script/value/color.rb +78 -42
- data/lib/sass/script/value/helpers.rb +119 -2
- data/lib/sass/script/value/list.rb +0 -15
- data/lib/sass/script/value/map.rb +1 -1
- data/lib/sass/script/value/null.rb +0 -5
- data/lib/sass/script/value/number.rb +112 -31
- data/lib/sass/script/value/string.rb +102 -13
- data/lib/sass/script/value.rb +0 -1
- data/lib/sass/script.rb +3 -3
- data/lib/sass/scss/css_parser.rb +24 -4
- data/lib/sass/scss/parser.rb +290 -383
- data/lib/sass/scss/rx.rb +17 -9
- data/lib/sass/scss/static_parser.rb +306 -4
- data/lib/sass/scss.rb +0 -2
- data/lib/sass/selector/abstract_sequence.rb +35 -18
- data/lib/sass/selector/comma_sequence.rb +114 -19
- data/lib/sass/selector/pseudo.rb +266 -0
- data/lib/sass/selector/sequence.rb +146 -40
- data/lib/sass/selector/simple.rb +22 -33
- data/lib/sass/selector/simple_sequence.rb +122 -39
- data/lib/sass/selector.rb +57 -197
- data/lib/sass/shared.rb +2 -2
- data/lib/sass/source/map.rb +31 -14
- data/lib/sass/source/position.rb +4 -4
- data/lib/sass/stack.rb +2 -8
- data/lib/sass/supports.rb +10 -13
- data/lib/sass/tree/at_root_node.rb +1 -0
- data/lib/sass/tree/charset_node.rb +1 -1
- data/lib/sass/tree/comment_node.rb +1 -1
- data/lib/sass/tree/css_import_node.rb +9 -1
- data/lib/sass/tree/directive_node.rb +8 -2
- data/lib/sass/tree/error_node.rb +18 -0
- data/lib/sass/tree/extend_node.rb +1 -1
- data/lib/sass/tree/function_node.rb +9 -0
- data/lib/sass/tree/import_node.rb +6 -5
- data/lib/sass/tree/keyframe_rule_node.rb +15 -0
- data/lib/sass/tree/node.rb +5 -3
- data/lib/sass/tree/prop_node.rb +6 -7
- data/lib/sass/tree/rule_node.rb +26 -11
- data/lib/sass/tree/visitors/check_nesting.rb +56 -32
- data/lib/sass/tree/visitors/convert.rb +59 -44
- data/lib/sass/tree/visitors/cssize.rb +34 -30
- data/lib/sass/tree/visitors/deep_copy.rb +6 -1
- data/lib/sass/tree/visitors/extend.rb +15 -13
- data/lib/sass/tree/visitors/perform.rb +87 -50
- data/lib/sass/tree/visitors/set_options.rb +15 -1
- data/lib/sass/tree/visitors/to_css.rb +72 -43
- data/lib/sass/util/multibyte_string_scanner.rb +0 -2
- data/lib/sass/util/normalized_map.rb +0 -1
- data/lib/sass/util/subset_map.rb +2 -3
- data/lib/sass/util.rb +334 -154
- data/lib/sass/version.rb +7 -7
- data/lib/sass.rb +10 -8
- data/test/sass/cache_test.rb +62 -20
- data/test/sass/callbacks_test.rb +1 -1
- data/test/sass/compiler_test.rb +24 -11
- data/test/sass/conversion_test.rb +241 -50
- data/test/sass/css2sass_test.rb +73 -5
- data/test/sass/css_variable_test.rb +132 -0
- data/test/sass/encoding_test.rb +219 -0
- data/test/sass/engine_test.rb +343 -260
- data/test/sass/exec_test.rb +12 -2
- data/test/sass/extend_test.rb +333 -44
- data/test/sass/functions_test.rb +353 -260
- data/test/sass/importer_test.rb +40 -21
- data/test/sass/logger_test.rb +1 -1
- data/test/sass/more_results/more_import.css +1 -1
- data/test/sass/more_templates/more1.sass +10 -10
- data/test/sass/more_templates/more_import.sass +2 -2
- data/test/sass/plugin_test.rb +24 -21
- data/test/sass/results/compact.css +1 -1
- data/test/sass/results/complex.css +4 -4
- data/test/sass/results/expanded.css +1 -1
- data/test/sass/results/import.css +1 -1
- data/test/sass/results/import_charset_ibm866.css +2 -2
- data/test/sass/results/mixins.css +17 -17
- data/test/sass/results/nested.css +1 -1
- data/test/sass/results/parent_ref.css +2 -2
- data/test/sass/results/script.css +5 -5
- data/test/sass/results/scss_import.css +1 -1
- data/test/sass/script_conversion_test.rb +71 -39
- data/test/sass/script_test.rb +714 -123
- data/test/sass/scss/css_test.rb +213 -30
- data/test/sass/scss/rx_test.rb +8 -4
- data/test/sass/scss/scss_test.rb +766 -22
- data/test/sass/source_map_test.rb +263 -95
- data/test/sass/superselector_test.rb +210 -0
- data/test/sass/templates/_partial.sass +1 -1
- data/test/sass/templates/basic.sass +10 -10
- data/test/sass/templates/bork1.sass +1 -1
- data/test/sass/templates/bork5.sass +1 -1
- data/test/sass/templates/compact.sass +10 -10
- data/test/sass/templates/complex.sass +187 -187
- data/test/sass/templates/compressed.sass +10 -10
- data/test/sass/templates/expanded.sass +10 -10
- data/test/sass/templates/import.sass +2 -2
- data/test/sass/templates/importee.sass +3 -3
- data/test/sass/templates/mixins.sass +22 -22
- data/test/sass/templates/multiline.sass +4 -4
- data/test/sass/templates/nested.sass +13 -13
- data/test/sass/templates/parent_ref.sass +12 -12
- data/test/sass/templates/script.sass +70 -70
- data/test/sass/templates/scss_import.scss +2 -1
- data/test/sass/templates/subdir/nested_subdir/_nested_partial.sass +1 -1
- data/test/sass/templates/subdir/nested_subdir/nested_subdir.sass +2 -2
- data/test/sass/templates/subdir/subdir.sass +3 -3
- data/test/sass/templates/units.sass +10 -10
- data/test/sass/test_helper.rb +1 -1
- data/test/sass/util/multibyte_string_scanner_test.rb +11 -3
- data/test/sass/util/normalized_map_test.rb +1 -1
- data/test/sass/util/subset_map_test.rb +2 -2
- data/test/sass/util_test.rb +46 -45
- data/test/sass/value_helpers_test.rb +5 -7
- data/test/sass-spec.yml +3 -0
- data/test/test_helper.rb +7 -6
- data/vendor/listen/CHANGELOG.md +1 -228
- data/vendor/listen/Gemfile +5 -15
- data/vendor/listen/README.md +111 -77
- data/vendor/listen/Rakefile +0 -42
- data/vendor/listen/lib/listen/adapter.rb +195 -82
- data/vendor/listen/lib/listen/adapters/bsd.rb +27 -64
- data/vendor/listen/lib/listen/adapters/darwin.rb +21 -58
- data/vendor/listen/lib/listen/adapters/linux.rb +23 -55
- data/vendor/listen/lib/listen/adapters/polling.rb +25 -34
- data/vendor/listen/lib/listen/adapters/windows.rb +50 -46
- data/vendor/listen/lib/listen/directory_record.rb +96 -61
- data/vendor/listen/lib/listen/listener.rb +135 -37
- data/vendor/listen/lib/listen/turnstile.rb +9 -5
- data/vendor/listen/lib/listen/version.rb +1 -1
- data/vendor/listen/lib/listen.rb +33 -19
- data/vendor/listen/listen.gemspec +6 -0
- data/vendor/listen/spec/listen/adapter_spec.rb +43 -77
- data/vendor/listen/spec/listen/adapters/polling_spec.rb +8 -8
- data/vendor/listen/spec/listen/directory_record_spec.rb +81 -56
- data/vendor/listen/spec/listen/listener_spec.rb +128 -39
- data/vendor/listen/spec/listen_spec.rb +15 -21
- data/vendor/listen/spec/spec_helper.rb +4 -0
- data/vendor/listen/spec/support/adapter_helper.rb +52 -15
- data/vendor/listen/spec/support/directory_record_helper.rb +7 -5
- data/vendor/listen/spec/support/listeners_helper.rb +30 -7
- metadata +310 -300
- data/CONTRIBUTING +0 -3
- data/ext/mkrf_conf.rb +0 -27
- data/lib/sass/script/value/deprecated_false.rb +0 -55
- data/lib/sass/scss/script_lexer.rb +0 -15
- data/lib/sass/scss/script_parser.rb +0 -25
- data/vendor/listen/lib/listen/dependency_manager.rb +0 -126
- data/vendor/listen/lib/listen/multi_listener.rb +0 -143
- data/vendor/listen/spec/listen/dependency_manager_spec.rb +0 -107
- data/vendor/listen/spec/listen/multi_listener_spec.rb +0 -174
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8b2d6c079c8e8aec59e0dd45294419919f88239
|
4
|
+
data.tar.gz: 5e31ebbe100aa0b066d414ee32e3f29d792907f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1782f895c1aaeef19491dfb41434ca10a60d28395f53a3ec19f8a65ec21c97625db3325732007fbc3155821c53adf9bcd00ced70e9fe3c1c935295b34f3dfdaf
|
7
|
+
data.tar.gz: 39578a844dd4d6e381cb10ced82d5c6782ddd042c79cc5c4c9cc6a69163badbf1ce368526987447b955d44a3d20470ea5e4eae481ea9359d63eea09cab94ca70
|
data/.yardopts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
--readme README.md
|
2
2
|
--markup markdown
|
3
|
-
--markup-provider
|
3
|
+
--markup-provider redcarpet
|
4
4
|
--default-return ""
|
5
5
|
--title "Sass Documentation"
|
6
6
|
--query 'object.type != :classvariable'
|
@@ -9,3 +9,5 @@
|
|
9
9
|
--protected
|
10
10
|
--no-private
|
11
11
|
--no-highlight
|
12
|
+
--tag comment
|
13
|
+
--hide-tag comment
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
Sass is more than a technology; Sass is driven by the community of individuals
|
2
|
+
that power its development and use every day. As a community, we want to embrace
|
3
|
+
the very differences that have made our collaboration so powerful, and work
|
4
|
+
together to provide the best environment for learning, growing, and sharing of
|
5
|
+
ideas. It is imperative that we keep Sass a fun, welcoming, challenging, and
|
6
|
+
fair place to play.
|
7
|
+
|
8
|
+
[The full community guidelines can be found on the Sass website.][link]
|
9
|
+
|
10
|
+
[link]: http://sass-lang.com/community-guidelines
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,148 @@
|
|
1
|
+
Contributions are welcomed. Please see the following site for guidelines:
|
2
|
+
|
3
|
+
[http://sass-lang.com/community#Contribute](http://sass-lang.com/community#Contribute)
|
4
|
+
|
5
|
+
* [Branches](#main-development-branches)
|
6
|
+
* [Feature Branches](#feature-branches)
|
7
|
+
* [Experimental Branches](#experimental-branches)
|
8
|
+
* [Old Stable Branches](#old-stable-branches)
|
9
|
+
* [Versioning](#versioning)
|
10
|
+
* [Making Breaking Changes](#making-breaking-changes)
|
11
|
+
* [Exceptional Breakages](#exceptional-breakages)
|
12
|
+
|
13
|
+
## Branches
|
14
|
+
|
15
|
+
The Sass repository has three primary development branches, each of which tracks
|
16
|
+
a different line of releases (see [versioning](#versioning) below). Each branch
|
17
|
+
is regularly merged into the one below: `stable` into `next`, `next` into
|
18
|
+
`master`.
|
19
|
+
|
20
|
+
* The `stable` branch is the default—it's what GitHub shows if you go to
|
21
|
+
[sass/sass](https://github.com/sass/sass), and it's the default place for pull
|
22
|
+
requests to go. This branch is where we work on the next patch release. Bug
|
23
|
+
fixes and documentation improvements belong here, but not new features.
|
24
|
+
|
25
|
+
* The `next` branch is where we work on the next minor release. It's where most
|
26
|
+
new features go, as long as they're not breaking changes. Very occasionally
|
27
|
+
breaking changes will go here as well—see
|
28
|
+
[exceptional breakages](#exceptional-breakages) below for details.
|
29
|
+
|
30
|
+
* The `master` branch is where we work on the next major release. It's where
|
31
|
+
breaking changes go. We also occasionally decide that a non-breaking feature
|
32
|
+
is big enough to warrant saving until the next major release, in which case it
|
33
|
+
will also be developed here.
|
34
|
+
|
35
|
+
Ideally, pull requests would be made against the appropriate
|
36
|
+
branch, but don't worry about it too much; if you make a request against the
|
37
|
+
wrong branch, the maintainer will take responsibility for rebasing it before
|
38
|
+
merging.
|
39
|
+
|
40
|
+
### Testing
|
41
|
+
|
42
|
+
Tests for changes to the Sass language go in
|
43
|
+
[sass-spec](https://github.com/sass/sass-spec) so that other
|
44
|
+
implementations (E.g. libSass) can be tested against the same test
|
45
|
+
suite. The sass-spec repo follows a "trunk development" model in that
|
46
|
+
the tests there test against different version of the Sass language (as
|
47
|
+
opposed to having branches that track different Sass versions). When
|
48
|
+
contributing changes to Sass, update the Gemfile to use sass-spec from a
|
49
|
+
branch or fork that has the new tests. When the feature lands in Sass,
|
50
|
+
the committer will also merge the corresponding sass-spec changes.
|
51
|
+
|
52
|
+
The [documentation of
|
53
|
+
sass-spec](https://github.com/sass/sass-spec/blob/master/README.md)
|
54
|
+
explains how to run sass-spec and contribute changes. In development,
|
55
|
+
Change the Gemfile(s) to use the `:path` option against the sass-spec gem
|
56
|
+
to link your local checkout of sass and sass-spec together in one or
|
57
|
+
both directions.
|
58
|
+
|
59
|
+
Changes to Sass internals or Ruby Sass specific features (E.g.
|
60
|
+
the `sass-convert` tool) should always have tests in the Sass `test`
|
61
|
+
directory following the conventions you see there.
|
62
|
+
|
63
|
+
### Feature Branches
|
64
|
+
|
65
|
+
Sometimes it won't be possible to merge a new feature into `next` or `master`
|
66
|
+
immediately. It may require longer-term work before it's complete, or we may not
|
67
|
+
want to release it as part of any alpha releases of the branch in question.
|
68
|
+
Branches like this are labeled `feature.#{name}` and stay on GitHub until
|
69
|
+
they're ready to be merged.
|
70
|
+
|
71
|
+
### Experimental Branches
|
72
|
+
|
73
|
+
Not all features pan out, and not all code is a good fit for merging into the
|
74
|
+
main codebase. Usually when this happens the code is just discarded, but every
|
75
|
+
so often it's interesting or promising enough that it's worth keeping around.
|
76
|
+
This is what experimental branches (labeled `experimental.#{name}`) are for.
|
77
|
+
While they're not currently in use, they contain code that might be useful in
|
78
|
+
the future.
|
79
|
+
|
80
|
+
### Old Stable Branches
|
81
|
+
|
82
|
+
Usually Sass doesn't have the development time to do long-term maintenance of
|
83
|
+
old release. But occasionally, very rarely, it becomes necessary. In cases like
|
84
|
+
that, a branch named `stable_#{version}` will be created, starting from the last
|
85
|
+
tag in that version series.
|
86
|
+
|
87
|
+
## Versioning
|
88
|
+
|
89
|
+
Starting with version 3.5.0, Sass uses [semantic versioning](http://semver.org/)
|
90
|
+
to indicate the evolution of its language semantics as much as possible. This
|
91
|
+
means that patch releases (such as 3.5.3) contain only bug fixes, minor releases
|
92
|
+
(such as 3.6.0) contain backwards-compatible features, and only major releases
|
93
|
+
(such as 4.0.0) are allowed to have backwards-incompatible behavior. There are
|
94
|
+
[exceptions](#exceptional-breakages), but we try to follow this rule as closely
|
95
|
+
as possible.
|
96
|
+
|
97
|
+
Note, however, that the semantic versioning applies only to the language's
|
98
|
+
semantics, not to the Ruby APIs. Although we try hard to keep widely-used APIs
|
99
|
+
like [`Sass::Engine`][Sass::Engine] stable, we don't have a strong distinction
|
100
|
+
between public and private APIs and we need to be able to freely refactor our
|
101
|
+
code.
|
102
|
+
|
103
|
+
[Sass::Engine]: http://sass-lang.com/documentation/Sass/Engine.html
|
104
|
+
|
105
|
+
### Making Breaking Changes
|
106
|
+
|
107
|
+
Sometimes the old way of doing something just isn't going to work anymore, and
|
108
|
+
the new way just can't be made backwards-compatible. In that case, a breaking
|
109
|
+
change is necessary. These changes are rarely pleasant, but they contribute to
|
110
|
+
making the language better in the long term.
|
111
|
+
|
112
|
+
Our breaking change process tries to make such changes as clear to users and as
|
113
|
+
easy to adapt to as possible. We want to ensure that there's a clear path
|
114
|
+
forward for users using functionality that will no longer exist, and that they
|
115
|
+
are able to understand what's changing and what they need to do. We've developed
|
116
|
+
the following process for this:
|
117
|
+
|
118
|
+
1. Deprecate the old behavior [in `stable`](#branches). At minimum, deprecating
|
119
|
+
some behavior involves printing a warning when that behavior is used
|
120
|
+
explaining that it's going to go away in the future. Ideally, this message
|
121
|
+
will also include code that will do the same thing in a non-deprecated way.
|
122
|
+
If there's a thorough prose explanation of the change available online, the
|
123
|
+
message should link to that as well.
|
124
|
+
|
125
|
+
2. If possible, make `sass-convert` (also in `stable`) convert the deprecated
|
126
|
+
behavior into a non-deprecated form. This allows users to run `sass-convert
|
127
|
+
-R -i` to automatically update their stylesheets.
|
128
|
+
|
129
|
+
3. Implement the new behavior in `master`. The sooner this happens, the better:
|
130
|
+
it may be unclear exactly what needs to be deprecated until the new
|
131
|
+
implementation exists.
|
132
|
+
|
133
|
+
4. Release an alpha version of `master` that includes the new behavior. This
|
134
|
+
allows users who are dissatisfied with the workaround to use the new
|
135
|
+
behavior early. Normally a maintainer will take care of this.
|
136
|
+
|
137
|
+
### Exceptional Breakages
|
138
|
+
|
139
|
+
Because Sass's syntax and semantics are closely tied to those of CSS, there are
|
140
|
+
occasionally times when CSS syntax is introduced that overlaps with
|
141
|
+
previously-valid Sass. In this case in particular, we may introduce a breaking
|
142
|
+
change in a minor version to get back to CSS compatibility as soon as possible.
|
143
|
+
|
144
|
+
Exceptional breakages still require the full deprecation process; the only
|
145
|
+
change is that the new behavior is implemented in `next` rather than `master`.
|
146
|
+
Because there are no minor releases between the deprecation and the removal of
|
147
|
+
the old behavior, the deprecation warning should be introduced soon as it
|
148
|
+
becomes clear that an exceptional breakage is necessary.
|
data/MIT-LICENSE
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Copyright (c) 2006-
|
1
|
+
Copyright (c) 2006-2016 Hampton Catlin, Natalie Weizenbaum, and Chris Eppstein
|
2
2
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining
|
4
4
|
a copy of this software and associated documentation files (the
|
data/README.md
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
# Sass [](http://badge.fury.io/rb/sass) [](http://inch-ci.org/github/sass/sass)
|
2
2
|
|
3
|
-
**Sass makes CSS fun again**. Sass is an extension of
|
3
|
+
**Sass makes CSS fun again**. Sass is an extension of CSS,
|
4
4
|
adding nested rules, variables, mixins, selector inheritance, and more.
|
5
5
|
It's translated to well-formatted, standard CSS
|
6
6
|
using the command line tool or a web-framework plugin.
|
7
7
|
|
8
8
|
Sass has two syntaxes. The new main syntax (as of Sass 3)
|
9
9
|
is known as "SCSS" (for "Sassy CSS"),
|
10
|
-
and is a superset of
|
11
|
-
This means that every valid
|
10
|
+
and is a superset of CSS's syntax.
|
11
|
+
This means that every valid CSS stylesheet is valid SCSS as well.
|
12
12
|
SCSS files use the extension `.scss`.
|
13
13
|
|
14
14
|
The second, older syntax is known as the indented syntax (or just "Sass").
|
@@ -49,8 +49,10 @@ see [the Sass reference](http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.ht
|
|
49
49
|
Sass can also be used with any Rack-enabled web framework.
|
50
50
|
To do so, just add
|
51
51
|
|
52
|
-
|
53
|
-
|
52
|
+
```ruby
|
53
|
+
require 'sass/plugin/rack'
|
54
|
+
use Sass::Plugin::Rack
|
55
|
+
```
|
54
56
|
|
55
57
|
to `config.ru`.
|
56
58
|
Then any Sass files in `public/stylesheets/sass`
|
@@ -93,18 +95,20 @@ put them in a file called `test.scss` and run `sass test.scss`.
|
|
93
95
|
Sass avoids repetition by nesting selectors within one another.
|
94
96
|
The same thing works for properties.
|
95
97
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
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
|
+
```
|
108
112
|
|
109
113
|
### Variables
|
110
114
|
|
@@ -112,19 +116,21 @@ Use the same color all over the place?
|
|
112
116
|
Need to do some math with height and width and text size?
|
113
117
|
Sass supports variables, math operations, and many useful functions.
|
114
118
|
|
115
|
-
|
116
|
-
|
119
|
+
```scss
|
120
|
+
$blue: #3bbfce;
|
121
|
+
$margin: 16px;
|
117
122
|
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
123
|
+
.content_navigation {
|
124
|
+
border-color: $blue;
|
125
|
+
color: darken($blue, 10%);
|
126
|
+
}
|
122
127
|
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
+
.border {
|
129
|
+
padding: $margin / 2;
|
130
|
+
margin: $margin / 2;
|
131
|
+
border-color: $blue;
|
132
|
+
}
|
133
|
+
```
|
128
134
|
|
129
135
|
### Mixins
|
130
136
|
|
@@ -133,23 +139,25 @@ mixins allow you to re-use whole chunks of CSS,
|
|
133
139
|
properties or selectors.
|
134
140
|
You can even give them arguments.
|
135
141
|
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
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
|
+
```
|
153
161
|
|
154
162
|
A comprehensive list of features is available
|
155
163
|
in the [Sass reference](http://sass-lang.com/documentation/file.SASS_REFERENCE.html).
|
@@ -176,7 +184,7 @@ See `sass-convert --help` for further information and options.
|
|
176
184
|
To run the Sass executables from a source checkout instead of from rubygems:
|
177
185
|
|
178
186
|
```
|
179
|
-
$ cd
|
187
|
+
$ cd sass
|
180
188
|
$ bundle
|
181
189
|
$ bundle exec sass ...
|
182
190
|
$ bundle exec scss ...
|
@@ -191,23 +199,29 @@ and now occasionally consults on the language issues. Hampton lives in San
|
|
191
199
|
Francisco, California and works as VP of Technology
|
192
200
|
at [Moovweb](http://www.moovweb.com/).
|
193
201
|
|
194
|
-
[
|
195
|
-
Sass.
|
196
|
-
posts, fixing bugs, refactoring, finding speed improvements,
|
197
|
-
documentation, implementing new features, and
|
198
|
-
|
199
|
-
|
202
|
+
[Natalie Weizenbaum](https://twitter.com/nex3) is the primary developer and
|
203
|
+
architect of Sass. Her hard work has kept the project alive by endlessly
|
204
|
+
answering forum posts, fixing bugs, refactoring, finding speed improvements,
|
205
|
+
writing documentation, implementing new features, and designing the language.
|
206
|
+
Natalie lives in Seattle, Washington and works on [Dart](http://dartlang.org)
|
207
|
+
application libraries at Google.
|
200
208
|
|
201
|
-
[Chris Eppstein](http://
|
202
|
-
Sass and the creator of Compass, the first Sass-based framework
|
209
|
+
[Chris Eppstein](http://twitter.com/chriseppstein) is a core contributor to
|
210
|
+
Sass and the creator of [Compass](http://compass-style.org/), the first Sass-based framework, and
|
211
|
+
[Eyeglass](http://github.com/sass-eyeglass/eyeglass), a node-sass plugin ecosystem for NPM. Chris focuses
|
203
212
|
on making Sass more powerful, easy to use, and on ways to speed its adoption
|
204
213
|
through the web development community. Chris lives in San Jose, California with
|
205
|
-
his wife and
|
206
|
-
[
|
207
|
-
|
214
|
+
his wife and two children. He is an Engineer for
|
215
|
+
[LinkedIn.com](http://linkedin.com), where his primary responsibility is to
|
216
|
+
maintain Sass and many other Sass-related open source projects.
|
217
|
+
|
218
|
+
If you use this software, we'd be truly honored if you'd make a
|
219
|
+
tax-deductible donation to a non-profit organization and then
|
220
|
+
[let us know on twitter](http://twitter.com/SassCSS), so that we can
|
221
|
+
thank you. Here's a few that we endorse:
|
208
222
|
|
209
|
-
|
210
|
-
|
223
|
+
* [Trans Justice Funding Project](http://www.transjusticefundingproject.org/)
|
224
|
+
* [United Mitochondrial Disease Foundation](http://umdf.org/compass)
|
225
|
+
* [Girl Develop It](https://www.girldevelopit.com/donate)
|
211
226
|
|
212
|
-
|
213
|
-
Okay, fine, I guess that means compliments aren't __required__.
|
227
|
+
Sass is licensed under the MIT License.
|
data/Rakefile
CHANGED
@@ -12,34 +12,118 @@ task :default => :test
|
|
12
12
|
|
13
13
|
require 'rake/testtask'
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
15
|
+
LINE_SIZE = 80
|
16
|
+
DECORATION_CHAR = '#'
|
17
|
+
|
18
|
+
def print_header(string)
|
19
|
+
length = string.length
|
20
|
+
puts DECORATION_CHAR * LINE_SIZE
|
21
|
+
puts string.center(length + 2, ' ').center(LINE_SIZE, DECORATION_CHAR)
|
22
|
+
puts DECORATION_CHAR * LINE_SIZE
|
23
|
+
end
|
24
|
+
|
25
|
+
desc "Run all tests"
|
26
|
+
task :test do
|
27
|
+
test_cases = [
|
28
|
+
{
|
29
|
+
'env' => {'MATHN' => 'true'},
|
30
|
+
'tasks' => ['test:ruby', 'test:spec', :rubocop]
|
31
|
+
},
|
32
|
+
{
|
33
|
+
'env' => {'MATHN' => 'false'},
|
34
|
+
'tasks' => ['test:ruby']
|
35
|
+
}
|
36
|
+
]
|
37
|
+
|
38
|
+
test_cases.each do |test_case|
|
39
|
+
env = test_case['env']
|
40
|
+
tasks = test_case['tasks']
|
41
|
+
|
42
|
+
env.each do |key, value|
|
43
|
+
ENV[key] = value
|
44
|
+
end
|
45
|
+
tasks.each do |task|
|
46
|
+
print_header("Running task: #{task}, env: #{env}")
|
47
|
+
Rake::Task[task].execute
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
namespace :test do
|
53
|
+
desc "Run the ruby tests (without sass-spec)"
|
54
|
+
Rake::TestTask.new("ruby") do |t|
|
55
|
+
t.libs << 'test'
|
56
|
+
test_files = FileList[scope('test/**/*_test.rb')]
|
57
|
+
test_files.exclude(scope('test/rails/*'))
|
58
|
+
test_files.exclude(scope('test/plugins/*'))
|
59
|
+
t.test_files = test_files
|
60
|
+
t.warning = true
|
61
|
+
t.verbose = true
|
62
|
+
end
|
63
|
+
|
64
|
+
desc "Run sass-spec tests against the local code."
|
65
|
+
task :spec do
|
66
|
+
require "yaml"
|
67
|
+
sass_spec_options = YAML.load_file(scope("test/sass-spec.yml"))
|
68
|
+
enabled = sass_spec_options.delete(:enabled)
|
69
|
+
unless enabled
|
70
|
+
puts "SassSpec tests are disabled."
|
71
|
+
next
|
72
|
+
end
|
73
|
+
if ruby_version_at_least?("1.9.2")
|
74
|
+
old_load_path = $:.dup
|
75
|
+
begin
|
76
|
+
$:.unshift(File.join(File.dirname(__FILE__), "lib"))
|
77
|
+
begin
|
78
|
+
require 'sass_spec'
|
79
|
+
rescue LoadError
|
80
|
+
puts "You probably forgot to run: bundle exec rake"
|
81
|
+
raise
|
82
|
+
end
|
83
|
+
default_options = {
|
84
|
+
:spec_directory => SassSpec::SPEC_DIR,
|
85
|
+
:engine_adapter => SassEngineAdapter.new,
|
86
|
+
:generate => false,
|
87
|
+
:tap => false,
|
88
|
+
:skip => false,
|
89
|
+
:verbose => false,
|
90
|
+
:filter => "",
|
91
|
+
:limit => -1,
|
92
|
+
:unexpected_pass => false,
|
93
|
+
:nuke => false,
|
94
|
+
}
|
95
|
+
SassSpec::Runner.new(default_options.merge(sass_spec_options)).run || exit(1)
|
96
|
+
ensure
|
97
|
+
$:.replace(old_load_path)
|
98
|
+
end
|
99
|
+
else
|
100
|
+
"Skipping sass-spec on ruby versions less than 1.9.2"
|
101
|
+
end
|
102
|
+
end
|
22
103
|
end
|
23
104
|
|
24
105
|
# ----- Code Style Enforcement -----
|
25
106
|
|
26
|
-
|
107
|
+
def ruby_version_at_least?(version_string)
|
108
|
+
ruby_version = Gem::Version.new(RUBY_VERSION.dup)
|
109
|
+
version = Gem::Version.new(version_string)
|
110
|
+
ruby_version >= version
|
111
|
+
end
|
112
|
+
|
113
|
+
begin
|
27
114
|
require 'rubocop/rake_task'
|
28
|
-
Rubocop
|
115
|
+
RuboCop = Rubocop unless defined?(RuboCop)
|
116
|
+
RuboCop::RakeTask.new do |t|
|
29
117
|
t.patterns = FileList["lib/**/*"]
|
30
118
|
end
|
31
|
-
|
119
|
+
rescue LoadError
|
32
120
|
task :rubocop do
|
33
|
-
puts "
|
34
|
-
|
35
|
-
|
36
|
-
puts "Use ruby 1.9 or greater and then run the style check with: rake rubocop"
|
37
|
-
end
|
121
|
+
puts "Rubocop is disabled."
|
122
|
+
puts "Passing this check is required in order for your patch to be accepted."
|
123
|
+
puts "Install Rubocop and then run the style check with: rake rubocop."
|
38
124
|
end
|
39
125
|
end
|
40
126
|
|
41
|
-
task :test => :rubocop
|
42
|
-
|
43
127
|
# ----- Packaging -----
|
44
128
|
|
45
129
|
# Don't use Rake::GemPackageTast because we want prerequisites to run
|
@@ -98,16 +182,13 @@ end
|
|
98
182
|
|
99
183
|
desc "Install Sass as a gem. Use SUDO=1 to install with sudo."
|
100
184
|
task :install => [:package] do
|
101
|
-
gem = RUBY_PLATFORM =~ /java/ ? 'jgem' : 'gem'
|
185
|
+
gem = RUBY_PLATFORM =~ /java/ ? 'jgem' : 'gem'
|
102
186
|
sh %{#{'sudo ' if ENV["SUDO"]}#{gem} install --no-ri pkg/sass-#{get_version}}
|
103
187
|
end
|
104
188
|
|
105
|
-
desc "Release a new Sass package to
|
189
|
+
desc "Release a new Sass package to RubyGems.org."
|
106
190
|
task :release => [:check_release, :package] do
|
107
|
-
name = File.read(scope("VERSION_NAME")).strip
|
108
191
|
version = File.read(scope("VERSION")).strip
|
109
|
-
sh %{rubyforge add_release sass sass "#{name} (v#{version})" pkg/sass-#{version}.gem}
|
110
|
-
sh %{rubyforge add_file sass sass "#{name} (v#{version})" pkg/sass-#{version}.tar.gz}
|
111
192
|
sh %{gem push pkg/sass-#{version}.gem}
|
112
193
|
end
|
113
194
|
|
@@ -166,7 +247,6 @@ task :release_edge do
|
|
166
247
|
next
|
167
248
|
end
|
168
249
|
|
169
|
-
sh %{rubyforge add_release sass sass "Bleeding Edge (v#{version})" pkg/sass-#{version}.gem}
|
170
250
|
sh %{gem push pkg/sass-#{version}.gem}
|
171
251
|
end
|
172
252
|
end
|
@@ -313,7 +393,7 @@ END
|
|
313
393
|
file = File.read(scope("test/sass/templates/#{file || 'complex'}.sass"))
|
314
394
|
result = RubyProf.profile { times.times { Sass::Engine.new(file).render } }
|
315
395
|
|
316
|
-
RubyProf.const_get("#{(ENV['OUTPUT'] || 'Flat').capitalize}Printer").new(result).print
|
396
|
+
RubyProf.const_get("#{(ENV['OUTPUT'] || 'Flat').capitalize}Printer").new(result).print
|
317
397
|
end
|
318
398
|
rescue LoadError; end
|
319
399
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.
|
1
|
+
3.4.25
|
data/VERSION_DATE
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
07 July 2017 22:00:34 UTC
|
data/VERSION_NAME
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
Selective Steve
|
data/bin/sass
CHANGED
data/bin/scss
CHANGED
@@ -0,0 +1,32 @@
|
|
1
|
+
#!/bin/bash -e
|
2
|
+
# Copyright 2016 Google Inc. Use of this source code is governed by an MIT-style
|
3
|
+
# license that can be found in the LICENSE file or at
|
4
|
+
# https://opensource.org/licenses/MIT.
|
5
|
+
|
6
|
+
# Echoes the sass-spec Git ref that should be checked out for the current Travis
|
7
|
+
# run. If we're running specs for a pull request which refers to a sass-spec
|
8
|
+
# pull request, we'll run against the latter rather than sass-spec master.
|
9
|
+
|
10
|
+
default=master
|
11
|
+
|
12
|
+
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
|
13
|
+
>&2 echo "TRAVIS_PULL_REQUEST: $TRAVIS_PULL_REQUEST."
|
14
|
+
>&2 echo "Ref: $default."
|
15
|
+
echo "$default"
|
16
|
+
exit 0
|
17
|
+
fi
|
18
|
+
|
19
|
+
>&2 echo "Fetching pull request $TRAVIS_PULL_REQUEST..."
|
20
|
+
|
21
|
+
JSON=$(curl -L -sS https://api.github.com/repos/sass/sass/pulls/$TRAVIS_PULL_REQUEST)
|
22
|
+
|
23
|
+
RE_SPEC_PR="sass\/sass-spec(#|\/pull\/)([0-9]+)"
|
24
|
+
|
25
|
+
if [[ $JSON =~ $RE_SPEC_PR ]]; then
|
26
|
+
ref="pull/${BASH_REMATCH[2]}/head"
|
27
|
+
>&2 echo "Ref: $ref."
|
28
|
+
echo "$ref"
|
29
|
+
else
|
30
|
+
>&2 echo "Ref: $default."
|
31
|
+
echo "$default"
|
32
|
+
fi
|
data/extra/update_watch.rb
CHANGED
@@ -7,7 +7,7 @@ enable :lock
|
|
7
7
|
Dir.chdir(File.dirname(__FILE__) + "/..")
|
8
8
|
|
9
9
|
post "/" do
|
10
|
-
puts "
|
10
|
+
puts "Received payload!"
|
11
11
|
puts "Rev: #{`git name-rev HEAD`.strip}"
|
12
12
|
system %{rake handle_update --trace REF=#{JSON.parse(params["payload"])["ref"].inspect}}
|
13
13
|
end
|
@@ -17,12 +17,16 @@ module Sass
|
|
17
17
|
# @see Base#\_retrieve
|
18
18
|
def _retrieve(key, version, sha)
|
19
19
|
return unless File.readable?(path_to(key))
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
begin
|
21
|
+
File.open(path_to(key), "rb") do |f|
|
22
|
+
if f.readline("\n").strip == version && f.readline("\n").strip == sha
|
23
|
+
return f.read
|
24
|
+
end
|
23
25
|
end
|
26
|
+
File.unlink path_to(key)
|
27
|
+
rescue Errno::ENOENT
|
28
|
+
# Already deleted. Race condition?
|
24
29
|
end
|
25
|
-
File.unlink path_to(key)
|
26
30
|
nil
|
27
31
|
rescue EOFError, TypeError, ArgumentError => e
|
28
32
|
Sass::Util.sass_warn "Warning. Error encountered while reading cache #{path_to(key)}: #{e}"
|
@@ -48,7 +52,7 @@ module Sass
|
|
48
52
|
# @param key [String]
|
49
53
|
# @return [String] The path to the cache file.
|
50
54
|
def path_to(key)
|
51
|
-
key = key.gsub(/[<>:\\|?*%]/) {|c| "%%%03d" % Sass::Util.ord(c)}
|
55
|
+
key = key.gsub(/[<>:\\|?*%]/) {|c| "%%%03d" % (Sass::Util.ord(c))}
|
52
56
|
File.join(cache_location, key)
|
53
57
|
end
|
54
58
|
end
|