sass 3.7.4 → 4.0.0.alpha.1
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 +13 -5
- data/.yardopts +1 -1
- data/CODE_OF_CONDUCT.md +1 -1
- data/CONTRIBUTING.md +1 -146
- data/MIT-LICENSE +1 -1
- data/README.md +25 -39
- data/Rakefile +274 -0
- data/VERSION +1 -1
- data/VERSION_DATE +1 -1
- data/lib/sass.rb +3 -3
- data/lib/sass/cache_stores/filesystem.rb +2 -2
- data/lib/sass/cache_stores/memory.rb +5 -4
- data/lib/sass/callbacks.rb +2 -2
- data/lib/sass/css.rb +12 -12
- data/lib/sass/engine.rb +44 -62
- data/lib/sass/environment.rb +7 -35
- data/lib/sass/error.rb +14 -14
- data/lib/sass/exec/base.rb +14 -3
- data/lib/sass/exec/sass_convert.rb +6 -20
- data/lib/sass/exec/sass_scss.rb +29 -5
- data/lib/sass/features.rb +2 -3
- data/lib/sass/importers/filesystem.rb +6 -11
- data/lib/sass/logger.rb +3 -8
- data/lib/sass/logger/base.rb +2 -19
- data/lib/sass/plugin.rb +2 -3
- data/lib/sass/plugin/compiler.rb +67 -48
- data/lib/sass/plugin/configuration.rb +3 -3
- data/lib/sass/plugin/merb.rb +1 -1
- data/lib/sass/plugin/rack.rb +3 -3
- data/lib/sass/plugin/staleness_checker.rb +3 -3
- data/lib/sass/railtie.rb +1 -1
- data/lib/sass/script.rb +3 -3
- data/lib/sass/script/css_parser.rb +15 -5
- data/lib/sass/script/functions.rb +121 -337
- data/lib/sass/script/lexer.rb +36 -102
- data/lib/sass/script/parser.rb +153 -529
- data/lib/sass/script/tree/funcall.rb +34 -42
- data/lib/sass/script/tree/interpolation.rb +26 -171
- data/lib/sass/script/tree/list_literal.rb +8 -23
- data/lib/sass/script/tree/map_literal.rb +2 -2
- data/lib/sass/script/tree/node.rb +3 -3
- data/lib/sass/script/tree/operation.rb +16 -43
- data/lib/sass/script/tree/string_interpolation.rb +43 -64
- data/lib/sass/script/tree/variable.rb +1 -1
- data/lib/sass/script/value.rb +0 -2
- data/lib/sass/script/value/arg_list.rb +1 -1
- data/lib/sass/script/value/base.rb +9 -27
- data/lib/sass/script/value/color.rb +18 -26
- data/lib/sass/script/value/helpers.rb +18 -44
- data/lib/sass/script/value/list.rb +14 -35
- data/lib/sass/script/value/map.rb +2 -2
- data/lib/sass/script/value/number.rb +16 -26
- data/lib/sass/script/value/string.rb +1 -30
- data/lib/sass/scss.rb +2 -0
- data/lib/sass/scss/css_parser.rb +3 -7
- data/lib/sass/scss/parser.rb +78 -196
- data/lib/sass/scss/rx.rb +14 -7
- data/lib/sass/scss/script_lexer.rb +15 -0
- data/lib/sass/scss/script_parser.rb +25 -0
- data/lib/sass/scss/static_parser.rb +55 -38
- data/lib/sass/selector.rb +10 -7
- data/lib/sass/selector/abstract_sequence.rb +12 -15
- data/lib/sass/selector/comma_sequence.rb +6 -24
- data/lib/sass/selector/pseudo.rb +6 -19
- data/lib/sass/selector/sequence.rb +16 -14
- data/lib/sass/selector/simple.rb +7 -9
- data/lib/sass/selector/simple_sequence.rb +12 -16
- data/lib/sass/shared.rb +1 -1
- data/lib/sass/source/map.rb +9 -7
- data/lib/sass/source/position.rb +4 -4
- data/lib/sass/stack.rb +3 -23
- data/lib/sass/tree/charset_node.rb +1 -1
- data/lib/sass/tree/comment_node.rb +1 -1
- data/lib/sass/tree/function_node.rb +3 -2
- data/lib/sass/tree/node.rb +3 -5
- data/lib/sass/tree/prop_node.rb +58 -49
- data/lib/sass/tree/rule_node.rb +8 -15
- data/lib/sass/tree/visitors/check_nesting.rb +23 -19
- data/lib/sass/tree/visitors/convert.rb +13 -15
- data/lib/sass/tree/visitors/cssize.rb +15 -4
- data/lib/sass/tree/visitors/deep_copy.rb +2 -2
- data/lib/sass/tree/visitors/extend.rb +14 -10
- data/lib/sass/tree/visitors/perform.rb +18 -29
- data/lib/sass/tree/visitors/set_options.rb +2 -2
- data/lib/sass/tree/visitors/to_css.rb +47 -77
- data/lib/sass/util.rb +311 -98
- data/lib/sass/util/cross_platform_random.rb +19 -0
- data/lib/sass/util/multibyte_string_scanner.rb +133 -127
- data/lib/sass/util/normalized_map.rb +8 -1
- data/lib/sass/util/ordered_hash.rb +192 -0
- data/lib/sass/version.rb +6 -2
- data/test/sass/cache_test.rb +131 -0
- data/test/sass/callbacks_test.rb +61 -0
- data/test/sass/compiler_test.rb +236 -0
- data/test/sass/conversion_test.rb +2171 -0
- data/test/sass/css2sass_test.rb +526 -0
- data/test/sass/data/hsl-rgb.txt +319 -0
- data/test/sass/encoding_test.rb +219 -0
- data/test/sass/engine_test.rb +3400 -0
- data/test/sass/exec_test.rb +86 -0
- data/test/sass/extend_test.rb +1719 -0
- data/test/sass/fixtures/test_staleness_check_across_importers.css +1 -0
- data/test/sass/fixtures/test_staleness_check_across_importers.scss +1 -0
- data/test/sass/functions_test.rb +1984 -0
- data/test/sass/importer_test.rb +421 -0
- data/test/sass/logger_test.rb +58 -0
- data/test/sass/mock_importer.rb +49 -0
- data/test/sass/more_results/more1.css +9 -0
- data/test/sass/more_results/more1_with_line_comments.css +26 -0
- data/test/sass/more_results/more_import.css +29 -0
- data/test/sass/more_templates/_more_partial.sass +2 -0
- data/test/sass/more_templates/more1.sass +23 -0
- data/test/sass/more_templates/more_import.sass +11 -0
- data/test/sass/plugin_test.rb +556 -0
- data/test/sass/results/alt.css +4 -0
- data/test/sass/results/basic.css +9 -0
- data/test/sass/results/cached_import_option.css +3 -0
- data/test/sass/results/compact.css +5 -0
- data/test/sass/results/complex.css +86 -0
- data/test/sass/results/compressed.css +1 -0
- data/test/sass/results/expanded.css +19 -0
- data/test/sass/results/filename_fn.css +3 -0
- data/test/sass/results/if.css +3 -0
- data/test/sass/results/import.css +31 -0
- data/test/sass/results/import_charset.css +5 -0
- data/test/sass/results/import_charset_1_8.css +5 -0
- data/test/sass/results/import_charset_ibm866.css +5 -0
- data/test/sass/results/import_content.css +1 -0
- data/test/sass/results/line_numbers.css +49 -0
- data/test/sass/results/mixins.css +95 -0
- data/test/sass/results/multiline.css +24 -0
- data/test/sass/results/nested.css +22 -0
- data/test/sass/results/options.css +1 -0
- data/test/sass/results/parent_ref.css +13 -0
- data/test/sass/results/script.css +16 -0
- data/test/sass/results/scss_import.css +31 -0
- data/test/sass/results/scss_importee.css +2 -0
- data/test/sass/results/subdir/nested_subdir/nested_subdir.css +1 -0
- data/test/sass/results/subdir/subdir.css +3 -0
- data/test/sass/results/units.css +11 -0
- data/test/sass/results/warn.css +0 -0
- data/test/sass/results/warn_imported.css +0 -0
- data/test/sass/script_conversion_test.rb +306 -0
- data/test/sass/script_test.rb +1206 -0
- data/test/sass/scss/css_test.rb +1281 -0
- data/test/sass/scss/rx_test.rb +160 -0
- data/test/sass/scss/scss_test.rb +4147 -0
- data/test/sass/scss/test_helper.rb +37 -0
- data/test/sass/source_map_test.rb +1055 -0
- data/test/sass/superselector_test.rb +210 -0
- data/test/sass/templates/_cached_import_option_partial.scss +1 -0
- data/test/sass/templates/_double_import_loop2.sass +1 -0
- data/test/sass/templates/_filename_fn_import.scss +11 -0
- data/test/sass/templates/_imported_charset_ibm866.sass +4 -0
- data/test/sass/templates/_imported_charset_utf8.sass +4 -0
- data/test/sass/templates/_imported_content.sass +3 -0
- data/test/sass/templates/_partial.sass +2 -0
- data/test/sass/templates/_same_name_different_partiality.scss +1 -0
- data/test/sass/templates/alt.sass +16 -0
- data/test/sass/templates/basic.sass +23 -0
- data/test/sass/templates/bork1.sass +2 -0
- data/test/sass/templates/bork2.sass +2 -0
- data/test/sass/templates/bork3.sass +2 -0
- data/test/sass/templates/bork4.sass +2 -0
- data/test/sass/templates/bork5.sass +3 -0
- data/test/sass/templates/cached_import_option.scss +3 -0
- data/test/sass/templates/compact.sass +17 -0
- data/test/sass/templates/complex.sass +305 -0
- data/test/sass/templates/compressed.sass +15 -0
- data/test/sass/templates/double_import_loop1.sass +1 -0
- data/test/sass/templates/expanded.sass +17 -0
- data/test/sass/templates/filename_fn.scss +18 -0
- data/test/sass/templates/if.sass +11 -0
- data/test/sass/templates/import.sass +12 -0
- data/test/sass/templates/import_charset.sass +9 -0
- data/test/sass/templates/import_charset_1_8.sass +6 -0
- data/test/sass/templates/import_charset_ibm866.sass +11 -0
- data/test/sass/templates/import_content.sass +4 -0
- data/test/sass/templates/importee.less +2 -0
- data/test/sass/templates/importee.sass +19 -0
- data/test/sass/templates/line_numbers.sass +13 -0
- data/test/sass/templates/mixin_bork.sass +5 -0
- data/test/sass/templates/mixins.sass +76 -0
- data/test/sass/templates/multiline.sass +20 -0
- data/test/sass/templates/nested.sass +25 -0
- data/test/sass/templates/nested_bork1.sass +2 -0
- data/test/sass/templates/nested_bork2.sass +2 -0
- data/test/sass/templates/nested_bork3.sass +2 -0
- data/test/sass/templates/nested_bork4.sass +2 -0
- data/test/sass/templates/nested_import.sass +2 -0
- data/test/sass/templates/nested_mixin_bork.sass +6 -0
- data/test/sass/templates/options.sass +2 -0
- data/test/sass/templates/parent_ref.sass +25 -0
- data/test/sass/templates/same_name_different_ext.sass +2 -0
- data/test/sass/templates/same_name_different_ext.scss +1 -0
- data/test/sass/templates/same_name_different_partiality.scss +1 -0
- data/test/sass/templates/script.sass +101 -0
- data/test/sass/templates/scss_import.scss +12 -0
- data/test/sass/templates/scss_importee.scss +1 -0
- data/test/sass/templates/single_import_loop.sass +1 -0
- data/test/sass/templates/subdir/import_up1.scss +1 -0
- data/test/sass/templates/subdir/import_up2.scss +1 -0
- data/test/sass/templates/subdir/nested_subdir/_nested_partial.sass +2 -0
- data/test/sass/templates/subdir/nested_subdir/nested_subdir.sass +3 -0
- data/test/sass/templates/subdir/subdir.sass +6 -0
- data/test/sass/templates/units.sass +11 -0
- data/test/sass/templates/warn.sass +3 -0
- data/test/sass/templates/warn_imported.sass +4 -0
- data/test/sass/test_helper.rb +8 -0
- data/test/sass/util/multibyte_string_scanner_test.rb +147 -0
- data/test/sass/util/normalized_map_test.rb +51 -0
- data/test/sass/util/subset_map_test.rb +91 -0
- data/test/sass/util_test.rb +438 -0
- data/test/sass/value_helpers_test.rb +179 -0
- data/test/test_helper.rb +110 -0
- data/vendor/listen/CHANGELOG.md +1 -0
- data/vendor/listen/CONTRIBUTING.md +38 -0
- data/vendor/listen/Gemfile +20 -0
- data/vendor/listen/Guardfile +8 -0
- data/vendor/listen/LICENSE +20 -0
- data/vendor/listen/README.md +349 -0
- data/vendor/listen/Rakefile +5 -0
- data/vendor/listen/Vagrantfile +96 -0
- data/vendor/listen/lib/listen.rb +54 -0
- data/vendor/listen/lib/listen/adapter.rb +327 -0
- data/vendor/listen/lib/listen/adapters/bsd.rb +75 -0
- data/vendor/listen/lib/listen/adapters/darwin.rb +48 -0
- data/vendor/listen/lib/listen/adapters/linux.rb +81 -0
- data/vendor/listen/lib/listen/adapters/polling.rb +58 -0
- data/vendor/listen/lib/listen/adapters/windows.rb +91 -0
- data/vendor/listen/lib/listen/directory_record.rb +406 -0
- data/vendor/listen/lib/listen/listener.rb +323 -0
- data/vendor/listen/lib/listen/turnstile.rb +32 -0
- data/vendor/listen/lib/listen/version.rb +3 -0
- data/vendor/listen/listen.gemspec +28 -0
- data/vendor/listen/spec/listen/adapter_spec.rb +149 -0
- data/vendor/listen/spec/listen/adapters/bsd_spec.rb +36 -0
- data/vendor/listen/spec/listen/adapters/darwin_spec.rb +37 -0
- data/vendor/listen/spec/listen/adapters/linux_spec.rb +47 -0
- data/vendor/listen/spec/listen/adapters/polling_spec.rb +68 -0
- data/vendor/listen/spec/listen/adapters/windows_spec.rb +30 -0
- data/vendor/listen/spec/listen/directory_record_spec.rb +1250 -0
- data/vendor/listen/spec/listen/listener_spec.rb +258 -0
- data/vendor/listen/spec/listen/turnstile_spec.rb +56 -0
- data/vendor/listen/spec/listen_spec.rb +67 -0
- data/vendor/listen/spec/spec_helper.rb +25 -0
- data/vendor/listen/spec/support/adapter_helper.rb +666 -0
- data/vendor/listen/spec/support/directory_record_helper.rb +57 -0
- data/vendor/listen/spec/support/fixtures_helper.rb +29 -0
- data/vendor/listen/spec/support/listeners_helper.rb +179 -0
- data/vendor/listen/spec/support/platform_helper.rb +15 -0
- metadata +217 -76
- data/extra/sass-spec-ref.sh +0 -40
- data/lib/sass/deprecation.rb +0 -55
- data/lib/sass/logger/delayed.rb +0 -50
- data/lib/sass/script/value/callable.rb +0 -25
- data/lib/sass/script/value/function.rb +0 -19
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
NzMwNWUzNzdjNWY1ODExMjYyZTM1NWQ5YTM1MWVmNjQ4MjljZWI2NA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
MGM5MWVlZDJjMzFlYjY2NTQxZjZiYTcwMzM2YThhODRkOTk0OGQyYg==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
M2U5ODMzYjQ4OTQxOTNmZDFhOGM2YmNhODRkZjhhMjAxOWQ1Yjg4ZjZiMzM2
|
10
|
+
YjcyZWNmMTNmMmJlZTY4NDBkYmI0NDUzZDM3NzI0ZGNhM2NlNTZkMDU2MWI5
|
11
|
+
ZGIyYWE0MGEyZmExYWU2YTQ1ZGRmZDFlZjRmNThlNDliNmI3Y2M=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
Yjk3MjlkNjU3YWM0ZmUxMDIxMTk1MWFjODZhM2QyOGMyODQzZjFiZDczZDRj
|
14
|
+
YjUzNDRlYTU4MjRkZmYwM2VhYTBiMjk0NTE4ODdhMzYzZTMzYjRmYTdmOTlm
|
15
|
+
N2I3NmQxYTE5YTdmNmNjMzRlY2Q4ZWMzYzA5NzRjZWMzNjcxYWY=
|
data/.yardopts
CHANGED
data/CODE_OF_CONDUCT.md
CHANGED
data/CONTRIBUTING.md
CHANGED
@@ -1,148 +1,3 @@
|
|
1
1
|
Contributions are welcomed. Please see the following site for guidelines:
|
2
2
|
|
3
|
-
[
|
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/ruby-sass](https://github.com/sass/ruby-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]: https://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.
|
3
|
+
[http://sass-lang.com/community#Contribute](http://sass-lang.com/community#Contribute)
|
data/MIT-LICENSE
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Copyright (c) 2006-
|
1
|
+
Copyright (c) 2006-2015 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,12 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
Ruby Sass should no longer be used, and will no longer be receiving any updates.
|
4
|
-
See [the Sass blog][], and consider switching to the [`sassc` gem].
|
5
|
-
|
6
|
-
[the Sass blog]: https://sass-lang.com/blog/posts/7828841
|
7
|
-
[`sassc` gem]: https://rubygems.org/gems/sassc
|
8
|
-
|
9
|
-
# Sass [](https://travis-ci.org/sass/ruby-sass) [](http://badge.fury.io/rb/sass) [](http://inch-ci.org/github/sass/sass)
|
1
|
+
# Sass [](http://badge.fury.io/rb/sass) [](http://inch-ci.org/github/sass/sass)
|
10
2
|
|
11
3
|
**Sass makes CSS fun again**. Sass is an extension of CSS,
|
12
4
|
adding nested rules, variables, mixins, selector inheritance, and more.
|
@@ -52,7 +44,7 @@ In Rails 3, add `gem "sass"` to your Gemfile instead.
|
|
52
44
|
where they'll be automatically compiled
|
53
45
|
to corresponding CSS files in `public/stylesheets` when needed
|
54
46
|
(the Sass template directory is customizable...
|
55
|
-
see [the Sass reference](
|
47
|
+
see [the Sass reference](http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#template_location-option) for details).
|
56
48
|
|
57
49
|
Sass can also be used with any Rack-enabled web framework.
|
58
50
|
To do so, just add
|
@@ -67,7 +59,7 @@ Then any Sass files in `public/stylesheets/sass`
|
|
67
59
|
will be compiled into CSS files in `public/stylesheets` on every request.
|
68
60
|
|
69
61
|
To use Sass programmatically,
|
70
|
-
check out the [YARD documentation](
|
62
|
+
check out the [YARD documentation](http://sass-lang.com/documentation/file.SASS_REFERENCE.html#using_sass).
|
71
63
|
|
72
64
|
## Formatting
|
73
65
|
|
@@ -81,10 +73,10 @@ and get small stylesheets up and running quickly,
|
|
81
73
|
particularly with the help of
|
82
74
|
[the Compass style library](http://compass-style.org).
|
83
75
|
|
84
|
-
[vars]:
|
85
|
-
[nested]:
|
86
|
-
[mixins]:
|
87
|
-
[imports]:
|
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
|
88
80
|
|
89
81
|
Sass has two syntaxes.
|
90
82
|
The one presented here, known as "SCSS" (for "Sassy CSS"),
|
@@ -93,7 +85,7 @@ The other (older) syntax, known as the indented syntax or just "Sass",
|
|
93
85
|
is whitespace-sensitive and indentation-based.
|
94
86
|
For more information, see the [reference documentation][syntax].
|
95
87
|
|
96
|
-
[syntax]:
|
88
|
+
[syntax]: http://sass-lang.com/documentation/file.SASS_REFERENCE.html#syntax
|
97
89
|
|
98
90
|
To run the following examples and see the CSS they produce,
|
99
91
|
put them in a file called `test.scss` and run `sass test.scss`.
|
@@ -168,7 +160,7 @@ You can even give them arguments.
|
|
168
160
|
```
|
169
161
|
|
170
162
|
A comprehensive list of features is available
|
171
|
-
in the [Sass reference](
|
163
|
+
in the [Sass reference](http://sass-lang.com/documentation/file.SASS_REFERENCE.html).
|
172
164
|
|
173
165
|
## Executables
|
174
166
|
|
@@ -192,7 +184,7 @@ See `sass-convert --help` for further information and options.
|
|
192
184
|
To run the Sass executables from a source checkout instead of from rubygems:
|
193
185
|
|
194
186
|
```
|
195
|
-
$ cd
|
187
|
+
$ cd <SASS_CHECKOUT_DIRECTORY>
|
196
188
|
$ bundle
|
197
189
|
$ bundle exec sass ...
|
198
190
|
$ bundle exec scss ...
|
@@ -207,29 +199,23 @@ and now occasionally consults on the language issues. Hampton lives in San
|
|
207
199
|
Francisco, California and works as VP of Technology
|
208
200
|
at [Moovweb](http://www.moovweb.com/).
|
209
201
|
|
210
|
-
[Natalie Weizenbaum](https://twitter.com/nex3) is the primary developer and
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
Natalie lives in Seattle, Washington and works on
|
215
|
-
application libraries at Google.
|
202
|
+
[Natalie Weizenbaum](https://twitter.com/nex3) is the primary developer and architect of
|
203
|
+
Sass. Her hard work has kept the project alive by endlessly answering forum
|
204
|
+
posts, fixing bugs, refactoring, finding speed improvements, writing
|
205
|
+
documentation, implementing new features, and getting Hampton coffee (a fitting
|
206
|
+
task for a girl genius). Natalie lives in Seattle, Washington and works on
|
207
|
+
[Dart](http://dartlang.org) application libraries at Google.
|
216
208
|
|
217
|
-
[Chris Eppstein](http://
|
218
|
-
Sass and the creator of
|
219
|
-
[Eyeglass](http://github.com/sass-eyeglass/eyeglass), a node-sass plugin ecosystem for NPM. Chris focuses
|
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
|
220
211
|
on making Sass more powerful, easy to use, and on ways to speed its adoption
|
221
212
|
through the web development community. Chris lives in San Jose, California with
|
222
|
-
his wife and
|
223
|
-
[LinkedIn.com](http://linkedin.com), where his
|
224
|
-
maintain Sass
|
225
|
-
|
226
|
-
If you use this software, we'd be truly honored if you'd make a
|
227
|
-
tax-deductible donation to a non-profit organization and then
|
228
|
-
[let us know on twitter](http://twitter.com/SassCSS), so that we can
|
229
|
-
thank you. Here's a few that we endorse:
|
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.
|
230
216
|
|
231
|
-
|
232
|
-
|
233
|
-
* [Girl Develop It](https://www.girldevelopit.com/donate)
|
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.
|
234
219
|
|
235
|
-
|
220
|
+
Beyond that, the implementation is licensed under the MIT License.
|
221
|
+
Okay, fine, I guess that means compliments aren't __required__.
|
data/Rakefile
ADDED
@@ -0,0 +1,274 @@
|
|
1
|
+
require 'rubygems/package'
|
2
|
+
|
3
|
+
# ----- Utility Functions -----
|
4
|
+
|
5
|
+
def scope(path)
|
6
|
+
File.join(File.dirname(__FILE__), path)
|
7
|
+
end
|
8
|
+
|
9
|
+
# ----- Default: Testing ------
|
10
|
+
|
11
|
+
task :default => :test
|
12
|
+
|
13
|
+
require 'rake/testtask'
|
14
|
+
|
15
|
+
Rake::TestTask.new do |t|
|
16
|
+
t.libs << 'test'
|
17
|
+
test_files = FileList[scope('test/**/*_test.rb')]
|
18
|
+
test_files.exclude(scope('test/rails/*'))
|
19
|
+
test_files.exclude(scope('test/plugins/*'))
|
20
|
+
t.test_files = test_files
|
21
|
+
t.verbose = true
|
22
|
+
end
|
23
|
+
|
24
|
+
# ----- Code Style Enforcement -----
|
25
|
+
|
26
|
+
version = RUBY_VERSION.split(".").map {|n| n.to_i}
|
27
|
+
|
28
|
+
# TODO: Run Rubocop on Ruby 2.2+ when it's supported. See
|
29
|
+
# https://github.com/sass/sass/pull/1805.
|
30
|
+
if (version[0] > 1 || (version[0] == 1 && version[1] > 8)) &&
|
31
|
+
(version[0] < 2 || (version[0] == 2 && version[1] < 2)) &&
|
32
|
+
(ENV.has_key?("RUBOCOP") && ENV["RUBOCOP"] == "true" ||
|
33
|
+
!(ENV.has_key?("RUBOCOP") || ENV.has_key?("TEST")))
|
34
|
+
require 'rubocop/rake_task'
|
35
|
+
Rubocop::RakeTask.new do |t|
|
36
|
+
t.patterns = FileList["lib/**/*"]
|
37
|
+
end
|
38
|
+
else
|
39
|
+
task :rubocop do
|
40
|
+
puts "Skipping rubocop style check."
|
41
|
+
if !ENV.has_key?("RUBOCOP")
|
42
|
+
puts "Passing this check is required in order for your patch to be accepted."
|
43
|
+
puts "Use ruby 1.9 or greater and then run the style check with: rake rubocop"
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
task :test => :rubocop
|
49
|
+
|
50
|
+
# ----- Packaging -----
|
51
|
+
|
52
|
+
# Don't use Rake::GemPackageTast because we want prerequisites to run
|
53
|
+
# before we load the gemspec.
|
54
|
+
desc "Build all the packages."
|
55
|
+
task :package => [:revision_file, :date_file, :submodules, :permissions] do
|
56
|
+
version = get_version
|
57
|
+
File.open(scope('VERSION'), 'w') {|f| f.puts(version)}
|
58
|
+
load scope('sass.gemspec')
|
59
|
+
Gem::Package.build(SASS_GEMSPEC)
|
60
|
+
sh %{git checkout VERSION}
|
61
|
+
|
62
|
+
pkg = "#{SASS_GEMSPEC.name}-#{SASS_GEMSPEC.version}"
|
63
|
+
mkdir_p "pkg"
|
64
|
+
verbose(true) {mv "#{pkg}.gem", "pkg/#{pkg}.gem"}
|
65
|
+
|
66
|
+
sh %{rm -f pkg/#{pkg}.tar.gz}
|
67
|
+
verbose(false) {SASS_GEMSPEC.files.each {|f| sh %{tar rf pkg/#{pkg}.tar #{f}}}}
|
68
|
+
sh %{gzip pkg/#{pkg}.tar}
|
69
|
+
end
|
70
|
+
|
71
|
+
task :permissions do
|
72
|
+
sh %{chmod -R a+rx bin}
|
73
|
+
sh %{chmod -R a+r .}
|
74
|
+
require 'shellwords'
|
75
|
+
Dir.glob('test/**/*_test.rb') do |file|
|
76
|
+
next if file =~ %r{^test/haml/spec/}
|
77
|
+
sh %{chmod a+rx #{file}}
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
task :revision_file do
|
82
|
+
require scope('lib/sass')
|
83
|
+
|
84
|
+
release = Rake.application.top_level_tasks.include?('release') || File.exist?(scope('EDGE_GEM_VERSION'))
|
85
|
+
if Sass.version[:rev] && !release
|
86
|
+
File.open(scope('REVISION'), 'w') { |f| f.puts Sass.version[:rev] }
|
87
|
+
elsif release
|
88
|
+
File.open(scope('REVISION'), 'w') { |f| f.puts "(release)" }
|
89
|
+
else
|
90
|
+
File.open(scope('REVISION'), 'w') { |f| f.puts "(unknown)" }
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
task :date_file do
|
95
|
+
File.open(scope('VERSION_DATE'), 'w') do |f|
|
96
|
+
f.puts Time.now.utc.strftime('%d %B %Y %T %Z')
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
# We also need to get rid of this file after packaging.
|
101
|
+
at_exit do
|
102
|
+
File.delete(scope('REVISION')) rescue nil
|
103
|
+
File.delete(scope('VERSION_DATE')) rescue nil
|
104
|
+
end
|
105
|
+
|
106
|
+
desc "Install Sass as a gem. Use SUDO=1 to install with sudo."
|
107
|
+
task :install => [:package] do
|
108
|
+
gem = RUBY_PLATFORM =~ /java/ ? 'jgem' : 'gem'
|
109
|
+
sh %{#{'sudo ' if ENV["SUDO"]}#{gem} install --no-ri pkg/sass-#{get_version}}
|
110
|
+
end
|
111
|
+
|
112
|
+
desc "Release a new Sass package to RubyGems.org."
|
113
|
+
task :release => [:check_release, :package] do
|
114
|
+
name = File.read(scope("VERSION_NAME")).strip
|
115
|
+
version = File.read(scope("VERSION")).strip
|
116
|
+
sh %{gem push pkg/sass-#{version}.gem}
|
117
|
+
end
|
118
|
+
|
119
|
+
# Ensures that the VERSION file has been updated for a new release.
|
120
|
+
task :check_release do
|
121
|
+
version = File.read(scope("VERSION")).strip
|
122
|
+
raise "There have been changes since current version (#{version})" if changed_since?(version)
|
123
|
+
raise "VERSION_NAME must not be 'Bleeding Edge'" if File.read(scope("VERSION_NAME")) == "Bleeding Edge"
|
124
|
+
end
|
125
|
+
|
126
|
+
# Reads a password from the command line.
|
127
|
+
#
|
128
|
+
# @param name [String] The prompt to use to read the password
|
129
|
+
def read_password(prompt)
|
130
|
+
require 'readline'
|
131
|
+
system "stty -echo"
|
132
|
+
Readline.readline("#{prompt}: ").strip
|
133
|
+
ensure
|
134
|
+
system "stty echo"
|
135
|
+
puts
|
136
|
+
end
|
137
|
+
|
138
|
+
# Returns whether or not the repository, or specific files,
|
139
|
+
# has/have changed since a given revision.
|
140
|
+
#
|
141
|
+
# @param rev [String] The revision to check against
|
142
|
+
# @param files [Array<String>] The files to check.
|
143
|
+
# If this is empty, checks the entire repository
|
144
|
+
def changed_since?(rev, *files)
|
145
|
+
IO.popen("git diff --exit-code #{rev} #{files.join(' ')}") {}
|
146
|
+
return !$?.success?
|
147
|
+
end
|
148
|
+
|
149
|
+
task :submodules do
|
150
|
+
if File.exist?(File.dirname(__FILE__) + "/.git")
|
151
|
+
sh %{git submodule sync}
|
152
|
+
sh %{git submodule update --init}
|
153
|
+
elsif !File.exist?(File.dirname(__FILE__) + "/vendor/listen/lib")
|
154
|
+
warn <<WARN
|
155
|
+
WARNING: vendor/listen doesn't exist, and this isn't a git repository so
|
156
|
+
I can't get it automatically!
|
157
|
+
WARN
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
|
+
# Get the version string. If this is being installed from Git,
|
162
|
+
# this includes the proper prerelease version.
|
163
|
+
def get_version
|
164
|
+
File.read(scope('VERSION').strip)
|
165
|
+
end
|
166
|
+
|
167
|
+
task :watch_for_update do
|
168
|
+
sh %{ruby extra/update_watch.rb}
|
169
|
+
end
|
170
|
+
|
171
|
+
# ----- Documentation -----
|
172
|
+
|
173
|
+
task :rdoc do
|
174
|
+
puts '=' * 100, <<END, '=' * 100
|
175
|
+
Sass uses the YARD documentation system (http://github.com/lsegal/yard).
|
176
|
+
Install the yard gem and then run "rake doc".
|
177
|
+
END
|
178
|
+
end
|
179
|
+
|
180
|
+
begin
|
181
|
+
require 'yard'
|
182
|
+
|
183
|
+
namespace :doc do
|
184
|
+
task :sass do
|
185
|
+
require scope('lib/sass')
|
186
|
+
Dir[scope("yard/default/**/*.sass")].each do |sass|
|
187
|
+
File.open(sass.gsub(/sass$/, 'css'), 'w') do |f|
|
188
|
+
f.write(Sass::Engine.new(File.read(sass)).render)
|
189
|
+
end
|
190
|
+
end
|
191
|
+
end
|
192
|
+
|
193
|
+
desc "List all undocumented methods and classes."
|
194
|
+
task :undocumented do
|
195
|
+
opts = ENV["YARD_OPTS"] || ""
|
196
|
+
ENV["YARD_OPTS"] = opts.dup + <<OPTS
|
197
|
+
--list --tag comment --hide-tag comment --query "
|
198
|
+
object.docstring.blank? &&
|
199
|
+
!(object.type == :method && object.is_alias?)"
|
200
|
+
OPTS
|
201
|
+
Rake::Task['yard'].execute
|
202
|
+
end
|
203
|
+
end
|
204
|
+
|
205
|
+
YARD::Rake::YardocTask.new do |t|
|
206
|
+
t.files = FileList.new(scope('lib/**/*.rb')) do |list|
|
207
|
+
list.exclude('lib/sass/plugin/merb.rb')
|
208
|
+
list.exclude('lib/sass/plugin/rails.rb')
|
209
|
+
end.to_a
|
210
|
+
t.options << '--incremental' if Rake.application.top_level_tasks.include?('redoc')
|
211
|
+
t.options += FileList.new(scope('yard/*.rb')).to_a.map {|f| ['-e', f]}.flatten
|
212
|
+
files = FileList.new(scope('doc-src/*')).to_a.sort_by {|s| s.size} + %w[MIT-LICENSE VERSION]
|
213
|
+
t.options << '--files' << files.join(',')
|
214
|
+
t.options << '--template-path' << scope('yard')
|
215
|
+
t.options << '--title' << ENV["YARD_TITLE"] if ENV["YARD_TITLE"]
|
216
|
+
|
217
|
+
t.before = lambda do
|
218
|
+
if ENV["YARD_OPTS"]
|
219
|
+
require 'shellwords'
|
220
|
+
t.options.concat(Shellwords.shellwords(ENV["YARD_OPTS"]))
|
221
|
+
end
|
222
|
+
end
|
223
|
+
end
|
224
|
+
Rake::Task['yard'].prerequisites.insert(0, 'doc:sass')
|
225
|
+
Rake::Task['yard'].instance_variable_set('@comment', nil)
|
226
|
+
|
227
|
+
desc "Generate Documentation"
|
228
|
+
task :doc => :yard
|
229
|
+
task :redoc => :yard
|
230
|
+
rescue LoadError
|
231
|
+
desc "Generate Documentation"
|
232
|
+
task :doc => :rdoc
|
233
|
+
task :yard => :rdoc
|
234
|
+
end
|
235
|
+
|
236
|
+
# ----- Coverage -----
|
237
|
+
|
238
|
+
begin
|
239
|
+
require 'rcov/rcovtask'
|
240
|
+
|
241
|
+
Rcov::RcovTask.new do |t|
|
242
|
+
t.test_files = FileList[scope('test/**/*_test.rb')]
|
243
|
+
t.rcov_opts << '-x' << '"^\/"'
|
244
|
+
if ENV['NON_NATIVE']
|
245
|
+
t.rcov_opts << "--no-rcovrt"
|
246
|
+
end
|
247
|
+
t.verbose = true
|
248
|
+
end
|
249
|
+
rescue LoadError; end
|
250
|
+
|
251
|
+
# ----- Profiling -----
|
252
|
+
|
253
|
+
begin
|
254
|
+
require 'ruby-prof'
|
255
|
+
|
256
|
+
desc <<END
|
257
|
+
Run a profile of sass.
|
258
|
+
TIMES=n sets the number of runs. Defaults to 1000.
|
259
|
+
FILE=str sets the file to profile. Defaults to 'complex'.
|
260
|
+
OUTPUT=str sets the ruby-prof output format.
|
261
|
+
Can be Flat, CallInfo, or Graph. Defaults to Flat. Defaults to Flat.
|
262
|
+
END
|
263
|
+
task :profile do
|
264
|
+
times = (ENV['TIMES'] || '1000').to_i
|
265
|
+
file = ENV['FILE']
|
266
|
+
|
267
|
+
require 'lib/sass'
|
268
|
+
|
269
|
+
file = File.read(scope("test/sass/templates/#{file || 'complex'}.sass"))
|
270
|
+
result = RubyProf.profile { times.times { Sass::Engine.new(file).render } }
|
271
|
+
|
272
|
+
RubyProf.const_get("#{(ENV['OUTPUT'] || 'Flat').capitalize}Printer").new(result).print
|
273
|
+
end
|
274
|
+
rescue LoadError; end
|