radiantcms-couchrest_model 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +0 -16
- data/CONTRIBUTORS +0 -7
- data/README +84 -2
- data/app/controllers/admin/export_controller.rb +5 -0
- data/app/controllers/admin/pages_controller.rb +7 -11
- data/app/controllers/admin/preferences_controller.rb +1 -1
- data/app/controllers/admin/resource_controller.rb +1 -1
- data/app/helpers/admin/pages_helper.rb +3 -1
- data/app/helpers/admin/preferences_helper.rb +0 -1
- data/app/helpers/admin/references_helper.rb +2 -1
- data/app/helpers/application_helper.rb +2 -4
- data/app/models/env_dump_page.rb +17 -0
- data/app/models/file_not_found_page.rb +0 -4
- data/app/models/page.rb +20 -61
- data/app/models/radiant/config.rb +37 -225
- data/app/models/radiant/exporter.rb +11 -0
- data/app/models/standard_tags.rb +108 -116
- data/app/models/status.rb +1 -9
- data/app/models/text_filter.rb +1 -12
- data/app/views/admin/extensions/index.html.haml +2 -2
- data/app/views/admin/layouts/index.html.haml +9 -9
- data/app/views/admin/pages/_fields.html.haml +4 -11
- data/app/views/admin/pages/_meta_row.html.haml +1 -5
- data/app/views/admin/pages/_node.html.haml +8 -8
- data/app/views/admin/pages/_popups.html.haml +1 -14
- data/app/views/admin/pages/index.html.haml +4 -4
- data/app/views/admin/snippets/_form.html.haml +1 -1
- data/app/views/admin/snippets/index.html.haml +10 -10
- data/app/views/admin/users/_avatar.html.haml +1 -3
- data/app/views/admin/users/_form.html.haml +2 -2
- data/app/views/admin/users/_password_fields.html.haml +2 -2
- data/app/views/admin/users/index.html.haml +10 -10
- data/app/views/layouts/application.html.haml +1 -1
- data/config/environment.rb +3 -5
- data/config/locales/en.yml +11 -48
- data/config/locales/en_available_tags.yml +34 -122
- data/config/routes.rb +6 -3
- data/db/schema.rb +3 -9
- data/db/templates/empty.yml +2 -0
- data/db/templates/roasters.yml +1210 -0
- data/db/templates/simple-blog.yml +197 -0
- data/db/templates/styled-blog.yml +472 -0
- data/features/admin/pages_management.feature +9 -2
- data/features/admin/resource_pagination.feature +1 -1
- data/features/admin/snippets_management.feature +1 -2
- data/features/admin/user_permissions.feature +1 -0
- data/features/admin/user_preferences.feature +1 -1
- data/features/step_definitions/admin/content_negotiation_steps.rb +0 -4
- data/features/step_definitions/admin/pagination_steps.rb +4 -2
- data/features/support/paths.rb +0 -2
- data/files +7283 -0
- data/lib/generators/extension/extension_generator.rb +0 -6
- data/lib/generators/extension/templates/README +1 -4
- data/lib/generators/extension/templates/RSpecRakefile +19 -0
- data/lib/generators/extension/templates/Rakefile +17 -0
- data/lib/generators/extension/templates/extension.rb +3 -3
- data/lib/generators/instance/instance_generator.rb +2 -3
- data/lib/generators/instance/templates/instance_environment.rb +2 -3
- data/lib/radiant.rb +2 -2
- data/lib/radiant/admin_ui.rb +11 -27
- data/lib/radiant/extension.rb +2 -8
- data/lib/radiant/extension_loader.rb +0 -4
- data/lib/radiant/initializer.rb +2 -46
- data/lib/radiant/setup.rb +11 -21
- data/lib/task_support.rb +8 -14
- data/lib/tasks/framework.rake +10 -17
- data/lib/tasks/prototype.rake +3 -3
- data/lib/tasks/release.rake +0 -1
- data/public/javascripts/admin/application.js +1 -1
- data/public/javascripts/admin/popup.js +7 -7
- data/public/javascripts/admin/tabcontrol.js +0 -1
- data/public/javascripts/admin/utility.js +2 -3
- data/public/stylesheets/admin/main.css +1213 -1
- data/public/stylesheets/admin/overrides.css +1 -0
- data/public/stylesheets/sass/admin/main.sass +20 -24
- data/public/stylesheets/sass/admin/modules/_links.sass +3 -6
- data/public/stylesheets/sass/admin/modules/_opacity.sass +2 -2
- data/public/stylesheets/sass/admin/modules/_rounded.sass +3 -3
- data/public/stylesheets/sass/admin/modules/_shadow.sass +2 -5
- data/public/stylesheets/sass/admin/partials/_actions.sass +38 -53
- data/public/stylesheets/sass/admin/partials/_avatars.sass +2 -2
- data/public/stylesheets/sass/admin/partials/_base.sass +58 -6
- data/public/stylesheets/sass/admin/partials/_content.sass +182 -10
- data/public/stylesheets/sass/admin/partials/_dateinput.sass +5 -5
- data/public/stylesheets/sass/admin/partials/_deprecated.sass +1 -1
- data/public/stylesheets/sass/admin/partials/_forms.sass +25 -26
- data/public/stylesheets/sass/admin/partials/_header.sass +9 -9
- data/public/stylesheets/sass/admin/partials/_popup.sass +1 -1
- data/public/stylesheets/sass/admin/partials/_tabcontrol.sass +3 -4
- data/radiantcms-couchrest_model.gemspec +3673 -0
- data/rerun.txt +1 -0
- data/spec/controllers/admin/export_controller_spec.rb +16 -0
- data/spec/controllers/admin/pages_controller_spec.rb +6 -35
- data/spec/controllers/admin/preferences_controller_spec.rb +1 -1
- data/spec/datasets/config_dataset.rb +0 -1
- data/spec/datasets/home_page_dataset.rb +3 -1
- data/spec/datasets/pages_dataset.rb +1 -1
- data/spec/fixtures/radiant_config.yml +2 -2
- data/spec/generators/extension_generator_spec.rb +8 -28
- data/spec/generators/instance_generator_spec.rb +3 -10
- data/spec/helpers/admin/node_helper_spec.rb +0 -1
- data/spec/helpers/admin/references_helper_spec.rb +1 -10
- data/spec/helpers/application_helper_spec.rb +2 -7
- data/spec/lib/radiant/admin_ui_spec.rb +10 -11
- data/spec/lib/radiant/extension_spec.rb +3 -3
- data/spec/lib/task_support_spec.rb +0 -6
- data/spec/models/env_dump_page_spec.rb +18 -0
- data/spec/models/file_not_found_page_spec.rb +11 -15
- data/spec/models/page_spec.rb +166 -209
- data/spec/models/radiant/config_spec.rb +3 -38
- data/spec/models/radiant/exporter_spec.rb +25 -0
- data/spec/models/standard_tags_spec.rb +142 -132
- data/spec/models/status_spec.rb +0 -11
- data/spec/models/text_filter_spec.rb +2 -6
- data/test/fixtures/extensions/basic/basic_extension.rb +6 -1
- data/vendor/extensions/archive/README +29 -0
- data/vendor/extensions/archive/Rakefile +120 -0
- data/vendor/extensions/archive/app/models/archive_day_index_page.rb +28 -0
- data/vendor/extensions/archive/app/models/archive_finder.rb +60 -0
- data/vendor/extensions/archive/app/models/archive_month_index_page.rb +28 -0
- data/vendor/extensions/archive/app/models/archive_page.rb +36 -0
- data/vendor/extensions/archive/app/models/archive_year_index_page.rb +28 -0
- data/vendor/extensions/archive/archive_extension.rb +19 -0
- data/vendor/extensions/archive/lib/archive_index_tags_and_methods.rb +57 -0
- data/vendor/extensions/archive/lib/tasks/archive_extension_tasks.rake +28 -0
- data/vendor/extensions/archive/spec/datasets/archive_dataset.rb +51 -0
- data/vendor/extensions/archive/spec/models/archive_day_index_page_spec.rb +20 -0
- data/vendor/extensions/archive/spec/models/archive_month_index_page_spec.rb +20 -0
- data/vendor/extensions/archive/spec/models/archive_page_spec.rb +33 -0
- data/vendor/extensions/archive/spec/models/archive_year_index_page_spec.rb +20 -0
- data/vendor/extensions/archive/spec/spec.opts +6 -0
- data/vendor/extensions/archive/spec/spec_helper.rb +36 -0
- data/vendor/extensions/archive/test/fixtures/pages.yml +397 -0
- data/vendor/extensions/archive/test/functional/archive_extension_test.rb +16 -0
- data/vendor/extensions/archive/test/helpers/archive_index_test_helper.rb +37 -0
- data/vendor/extensions/archive/test/test_helper.rb +26 -0
- data/vendor/extensions/archive/test/unit/archive_day_index_page_test.rb +22 -0
- data/vendor/extensions/archive/test/unit/archive_month_index_page_test.rb +22 -0
- data/vendor/extensions/archive/test/unit/archive_page_test.rb +40 -0
- data/vendor/extensions/archive/test/unit/archive_year_index_page_test.rb +22 -0
- data/vendor/extensions/dutch_language_pack/README +3 -0
- data/vendor/extensions/dutch_language_pack/Rakefile +123 -0
- data/vendor/extensions/dutch_language_pack/config/locales/nl.yml +187 -0
- data/vendor/extensions/dutch_language_pack/config/locales/nl_available_tags.yml +553 -0
- data/vendor/extensions/dutch_language_pack/dutch_language_pack_extension.rb +9 -0
- data/vendor/extensions/dutch_language_pack/lib/tasks/i18n_nl_extension_tasks.rake +28 -0
- data/vendor/extensions/french_language_pack/README +3 -0
- data/vendor/extensions/french_language_pack/Rakefile +123 -0
- data/vendor/extensions/french_language_pack/config/locales/fr.yml +190 -0
- data/vendor/extensions/french_language_pack/config/locales/fr_available_tags.yml +553 -0
- data/vendor/extensions/french_language_pack/french_language_pack_extension.rb +9 -0
- data/vendor/extensions/french_language_pack/lib/tasks/i18n_fr_extension_tasks.rake +28 -0
- data/vendor/extensions/german_language_pack/README +4 -0
- data/vendor/extensions/german_language_pack/Rakefile +123 -0
- data/vendor/extensions/german_language_pack/config/locales/de.yml +186 -0
- data/vendor/extensions/german_language_pack/config/locales/de_available_tags.yml +624 -0
- data/vendor/extensions/german_language_pack/german_language_pack_extension.rb +9 -0
- data/vendor/extensions/german_language_pack/lib/tasks/i18n_de_extension_tasks.rake +28 -0
- data/vendor/extensions/italian_language_pack/README +3 -0
- data/vendor/extensions/italian_language_pack/Rakefile +123 -0
- data/vendor/extensions/italian_language_pack/config/locales/it.yml +184 -0
- data/vendor/extensions/italian_language_pack/config/locales/it_available_tags.yml +553 -0
- data/vendor/extensions/italian_language_pack/italian_language_pack_extension.rb +8 -0
- data/vendor/extensions/italian_language_pack/lib/tasks/i18n_it_extension_tasks.rake +28 -0
- data/vendor/extensions/japanese_language_pack/README +3 -0
- data/vendor/extensions/japanese_language_pack/Rakefile +123 -0
- data/vendor/extensions/japanese_language_pack/config/locales/ja.yml +184 -0
- data/vendor/extensions/japanese_language_pack/config/locales/ja_available_tags.yml +553 -0
- data/vendor/extensions/japanese_language_pack/japanese_language_pack_extension.rb +9 -0
- data/vendor/extensions/japanese_language_pack/lib/tasks/i18n_ja_extension_tasks.rake +28 -0
- data/vendor/extensions/markdown_filter/README +1 -0
- data/vendor/extensions/markdown_filter/Rakefile +120 -0
- data/vendor/extensions/markdown_filter/lib/markdown_filter.rb +14 -0
- data/vendor/extensions/markdown_filter/lib/markdown_tags.rb +18 -0
- data/vendor/extensions/markdown_filter/lib/tasks/markdown_filter_extension_tasks.rake +28 -0
- data/vendor/extensions/markdown_filter/markdown.html +123 -0
- data/vendor/extensions/markdown_filter/markdown_filter_extension.rb +18 -0
- data/vendor/extensions/markdown_filter/spec/models/markdown_filter_spec.rb +22 -0
- data/vendor/extensions/markdown_filter/spec/spec.opts +6 -0
- data/vendor/extensions/markdown_filter/spec/spec_helper.rb +36 -0
- data/vendor/extensions/markdown_filter/test/test_helper.rb +19 -0
- data/vendor/extensions/markdown_filter/test/unit/markdown_filter_test.rb +18 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/AUTHORS +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/CONTRIBUTERS +4 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/COPYING +24 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/ChangeLog +3956 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/GPL +674 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/README +30 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/Rakefile +342 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/VERSION +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/benchmark.rb +34 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/generate_data.rb +112 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/historic-jruby-1.4.0.dat +7 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/historic-ruby-1.8.6.dat +7 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/historic-ruby-1.8.7.dat +7 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/historic-ruby-1.9.1p243.dat +7 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/historic-ruby-1.9.2dev.dat +7 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/mdbasics.text +306 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/mdsyntax.text +888 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/static-jruby-1.4.0.dat +7 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/static-ruby-1.8.6.dat +7 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/static-ruby-1.8.7.dat +7 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/static-ruby-1.9.1p243.dat +7 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/static-ruby-1.9.2dev.dat +7 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/testing.sh +9 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/timing.sh +10 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/bin/kramdown +78 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/data/kramdown/document.html +9 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/data/kramdown/document.latex +43 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/doc/default.less.css +510 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/doc/default.template +71 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/doc/documentation.page +72 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/doc/index.page +63 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/doc/installation.page +90 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/doc/links.markdown +6 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/doc/news.feed +10 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/doc/news.page +28 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/doc/quickref.page +564 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/doc/syntax.page +1521 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/doc/tests.page +51 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/doc/virtual +2 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown.rb +23 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/compatibility.rb +34 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/converter.rb +41 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/converter/base.rb +111 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/converter/html.rb +397 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/converter/latex.rb +555 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/document.rb +164 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/error.rb +27 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/options.rb +282 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser.rb +39 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/base.rb +95 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/html.rb +387 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown.rb +301 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/abbreviation.rb +65 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/attribute_list.rb +103 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/autolink.rb +47 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/blank_line.rb +43 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/blockquote.rb +42 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/codeblock.rb +58 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/codespan.rb +57 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/emphasis.rb +70 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/eob.rb +39 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/escaped_chars.rb +38 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/extension.rb +101 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/footnote.rb +73 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/header.rb +66 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/horizontal_rule.rb +39 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/html.rb +173 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/html_entity.rb +38 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/line_break.rb +38 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/link.rb +153 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/list.rb +228 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/math.rb +53 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/paragraph.rb +44 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/smart_quotes.rb +214 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/table.rb +126 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/typographic_symbol.rb +52 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/version.rb +28 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/man/man1/kramdown.1 +222 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/setup.rb +1585 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/run_tests.rb +59 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/test_files.rb +100 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/01_blank_line/spaces.html +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/01_blank_line/spaces.text +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/01_blank_line/tabs.html +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/01_blank_line/tabs.text +6 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/02_eob/beginning.html +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/02_eob/beginning.text +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/02_eob/end.html +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/02_eob/end.text +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/02_eob/middle.html +2 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/02_eob/middle.text +5 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/03_paragraph/indented.html +18 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/03_paragraph/indented.text +19 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/03_paragraph/no_newline_at_end.html +5 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/03_paragraph/no_newline_at_end.text +5 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/03_paragraph/one_para.html +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/03_paragraph/one_para.text +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/03_paragraph/two_para.html +4 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/03_paragraph/two_para.text +4 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/04_header/atx_header.html +34 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/04_header/atx_header.text +32 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/04_header/atx_header_no_newline_at_end.html +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/04_header/atx_header_no_newline_at_end.text +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/04_header/setext_header.html +31 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/04_header/setext_header.text +36 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/04_header/setext_header_no_newline_at_end.html +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/04_header/setext_header_no_newline_at_end.text +2 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/04_header/with_auto_id_prefix.html +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/04_header/with_auto_id_prefix.options +2 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/04_header/with_auto_id_prefix.text +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/04_header/with_auto_ids.html +17 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/04_header/with_auto_ids.options +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/04_header/with_auto_ids.text +19 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/05_blockquote/indented.html +25 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/05_blockquote/indented.text +14 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/05_blockquote/nested.html +9 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/05_blockquote/nested.text +5 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/05_blockquote/no_newline_at_end.html +4 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/05_blockquote/no_newline_at_end.text +2 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/05_blockquote/only_first_quoted.html +8 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/05_blockquote/only_first_quoted.text +4 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/05_blockquote/with_code_blocks.html +15 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/05_blockquote/with_code_blocks.text +11 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/06_codeblock/error.html +4 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/06_codeblock/error.text +4 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/06_codeblock/no_newline_at_end.html +2 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/06_codeblock/no_newline_at_end.text +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/06_codeblock/normal.html +13 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/06_codeblock/normal.text +10 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/06_codeblock/tilde_syntax.html +7 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/06_codeblock/tilde_syntax.text +9 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/06_codeblock/whitespace.html +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/06_codeblock/whitespace.text +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/06_codeblock/with_blank_line.html +13 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/06_codeblock/with_blank_line.text +12 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/06_codeblock/with_eob_marker.html +6 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/06_codeblock/with_eob_marker.text +5 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/07_horizontal_rule/error.html +7 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/07_horizontal_rule/error.text +7 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/07_horizontal_rule/normal.html +19 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/07_horizontal_rule/normal.text +19 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/07_horizontal_rule/sepspaces.html +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/07_horizontal_rule/sepspaces.text +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/07_horizontal_rule/septabs.html +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/07_horizontal_rule/septabs.text +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/escaping.html +17 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/escaping.text +17 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/item_ial.html +9 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/item_ial.text +5 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/list_and_hr.html +9 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/list_and_hr.text +5 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/list_and_others.html +38 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/list_and_others.text +25 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/mixed.html +117 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/mixed.text +66 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/nested.html +17 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/nested.text +7 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/other_first_element.html +39 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/other_first_element.text +18 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/simple_ol.html +19 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/simple_ol.text +13 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/simple_ul.html +61 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/simple_ul.text +43 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/single_item.html +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/single_item.text +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/special_cases.html +78 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/special_cases.text +48 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/comment.html +18 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/comment.text +15 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/content_model/deflists.html +6 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/content_model/deflists.options +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/content_model/deflists.text +6 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/content_model/tables.html +14 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/content_model/tables.options +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/content_model/tables.text +14 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/filtered_html.html +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/filtered_html.options +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/filtered_html.text +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_and_codeblocks.html +15 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_and_codeblocks.options +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_and_codeblocks.text +13 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/code.html +10 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/code.text +9 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/comment.html +7 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/comment.text +8 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/emphasis.html +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/emphasis.text +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/entity.html +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/entity.text +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/header.html +6 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/header.options +2 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/header.text +6 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/list_dl.html +8 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/list_dl.text +8 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/list_ol.html +15 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/list_ol.text +17 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/list_ul.html +19 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/list_ul.text +22 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/options +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/paragraph.html +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/paragraph.text +4 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/table_normal.html +13 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/table_normal.text +12 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/table_simple.html +10 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/table_simple.text +14 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/typography.html +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/typography.text +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/invalid_html_1.html +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/invalid_html_1.text +5 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/invalid_html_2.html +5 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/invalid_html_2.text +5 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/markdown_attr.html +38 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/markdown_attr.text +38 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/not_parsed.html +24 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/not_parsed.text +24 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/parse_as_raw.html +30 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/parse_as_raw.options +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/parse_as_raw.text +29 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/parse_as_span.html +12 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/parse_as_span.options +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/parse_as_span.text +9 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/parse_block_html.html +21 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/parse_block_html.options +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/parse_block_html.text +17 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/processing_instruction.html +13 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/processing_instruction.text +12 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/simple.html +62 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/simple.options +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/simple.text +57 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/10_ald/simple.html +2 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/10_ald/simple.text +8 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/11_ial/auto_id_and_ial.html +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/11_ial/auto_id_and_ial.options +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/11_ial/auto_id_and_ial.text +2 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/11_ial/simple.html +25 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/11_ial/simple.text +34 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/12_extension/comment.html +5 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/12_extension/comment.text +11 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/12_extension/ignored.html +4 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/12_extension/ignored.text +8 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/12_extension/nomarkdown.html +6 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/12_extension/nomarkdown.text +11 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/12_extension/options.html +24 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/12_extension/options.text +27 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/12_extension/options2.html +10 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/12_extension/options2.text +5 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/12_extension/options3.html +7 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/12_extension/options3.text +7 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/13_definition_list/definition_at_beginning.html +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/13_definition_list/definition_at_beginning.text +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/13_definition_list/multiple_terms.html +13 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/13_definition_list/multiple_terms.text +10 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/13_definition_list/no_def_list.html +2 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/13_definition_list/no_def_list.text +2 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/13_definition_list/para_wrapping.html +10 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/13_definition_list/para_wrapping.text +6 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/13_definition_list/separated_by_eob.html +8 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/13_definition_list/separated_by_eob.text +5 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/13_definition_list/simple.html +8 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/13_definition_list/simple.text +7 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/13_definition_list/styled_terms.html +4 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/13_definition_list/styled_terms.text +2 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/13_definition_list/too_much_space.html +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/13_definition_list/too_much_space.text +4 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/13_definition_list/with_blocks.html +38 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/13_definition_list/with_blocks.text +24 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/14_table/errors.html +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/14_table/errors.text +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/14_table/footer.html +65 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/14_table/footer.text +25 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/14_table/header.html +103 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/14_table/header.text +32 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/14_table/no_table.html +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/14_table/no_table.text +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/14_table/simple.html +61 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/14_table/simple.text +16 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/15_math/normal.html +19 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/15_math/normal.text +18 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/encoding.html +46 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/encoding.text +28 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/01_link/empty.html +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/01_link/empty.text +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/01_link/image_in_a.html +5 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/01_link/image_in_a.text +5 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/01_link/imagelinks.html +12 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/01_link/imagelinks.text +14 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/01_link/inline.html +40 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/01_link/inline.text +42 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/01_link/link_defs.html +8 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/01_link/link_defs.text +22 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/01_link/links_with_angle_brackets.html +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/01_link/links_with_angle_brackets.text +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/01_link/reference.html +32 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/01_link/reference.text +42 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/02_emphasis/empty.html +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/02_emphasis/empty.text +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/02_emphasis/errors.html +9 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/02_emphasis/errors.text +9 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/02_emphasis/nesting.html +38 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/02_emphasis/nesting.text +33 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/02_emphasis/normal.html +46 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/02_emphasis/normal.text +46 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/03_codespan/empty.html +5 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/03_codespan/empty.text +5 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/03_codespan/errors.html +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/03_codespan/errors.text +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/03_codespan/normal.html +16 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/03_codespan/normal.text +16 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/04_footnote/definitions.html +14 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/04_footnote/definitions.latex +18 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/04_footnote/definitions.text +18 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/04_footnote/footnote_nr.html +12 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/04_footnote/footnote_nr.latex +6 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/04_footnote/footnote_nr.options +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/04_footnote/footnote_nr.text +4 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/04_footnote/markers.html +46 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/04_footnote/markers.latex +32 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/04_footnote/markers.text +26 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/05_html/across_lines.html +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/05_html/across_lines.text +2 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/05_html/invalid.html +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/05_html/invalid.text +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/05_html/link_with_mailto.html +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/05_html/link_with_mailto.text +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/05_html/markdown_attr.html +6 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/05_html/markdown_attr.text +6 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/05_html/normal.html +28 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/05_html/normal.text +28 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/abbreviations/abbrev.html +8 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/abbreviations/abbrev.text +15 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/abbreviations/abbrev_defs.html +2 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/abbreviations/abbrev_defs.text +5 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/autolinks/url_links.html +12 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/autolinks/url_links.text +12 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/escaped_chars/normal.html +41 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/escaped_chars/normal.text +41 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/extension/comment.html +6 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/extension/comment.text +6 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/extension/ignored.html +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/extension/ignored.text +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/extension/nomarkdown.html +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/extension/nomarkdown.text +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/extension/options.html +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/extension/options.text +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/ial/simple.html +6 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/ial/simple.text +6 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/line_breaks/normal.html +11 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/line_breaks/normal.text +11 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/math/normal.html +5 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/math/normal.text +5 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/text_substitutions/entities.html +4 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/text_substitutions/entities.text +4 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/text_substitutions/greaterthan.html +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/text_substitutions/greaterthan.text +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/text_substitutions/lowerthan.html +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/text_substitutions/lowerthan.text +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/text_substitutions/typography.html +18 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/text_substitutions/typography.text +18 -0
- data/vendor/extensions/russian_language_pack/README +3 -0
- data/vendor/extensions/russian_language_pack/Rakefile +123 -0
- data/vendor/extensions/russian_language_pack/config/locales/ru.yml +180 -0
- data/vendor/extensions/russian_language_pack/config/locales/ru_available_tags.yml +553 -0
- data/vendor/extensions/russian_language_pack/lib/tasks/i18n_ru_extension_tasks.rake +28 -0
- data/vendor/extensions/russian_language_pack/russian_language_pack_extension.rb +9 -0
- data/vendor/extensions/smarty_pants_filter/README +1 -0
- data/vendor/extensions/smarty_pants_filter/Rakefile +136 -0
- data/vendor/extensions/smarty_pants_filter/lib/smarty_pants_filter.rb +7 -0
- data/vendor/extensions/smarty_pants_filter/lib/smarty_pants_tags.rb +18 -0
- data/vendor/extensions/smarty_pants_filter/lib/tasks/smarty_pants_filter_extension_tasks.rake +28 -0
- data/vendor/extensions/smarty_pants_filter/smarty_pants_filter_extension.rb +18 -0
- data/vendor/extensions/smarty_pants_filter/smartypants.html +47 -0
- data/vendor/extensions/smarty_pants_filter/spec/models/smarty_pants_filter_spec.rb +19 -0
- data/vendor/extensions/smarty_pants_filter/spec/spec.opts +6 -0
- data/vendor/extensions/smarty_pants_filter/spec/spec_helper.rb +36 -0
- data/vendor/extensions/smarty_pants_filter/test/test_helper.rb +19 -0
- data/vendor/extensions/smarty_pants_filter/test/unit/smarty_pants_filter_test.rb +14 -0
- data/vendor/extensions/smarty_pants_filter/vendor/rubypants/README +114 -0
- data/vendor/extensions/smarty_pants_filter/vendor/rubypants/Rakefile +84 -0
- data/vendor/extensions/smarty_pants_filter/vendor/rubypants/install.rb +9 -0
- data/vendor/extensions/smarty_pants_filter/vendor/rubypants/rubypants.rb +490 -0
- data/vendor/extensions/smarty_pants_filter/vendor/rubypants/test_rubypants.rb +162 -0
- data/vendor/extensions/textile_filter/README +1 -0
- data/vendor/extensions/textile_filter/Rakefile +120 -0
- data/vendor/extensions/textile_filter/lib/tasks/textile_filter_extension_tasks.rake +0 -0
- data/vendor/extensions/textile_filter/lib/textile_filter.rb +6 -0
- data/vendor/extensions/textile_filter/lib/textile_tags.rb +24 -0
- data/vendor/extensions/textile_filter/spec/models/textile_filter_spec.rb +19 -0
- data/vendor/extensions/textile_filter/spec/spec.opts +6 -0
- data/vendor/extensions/textile_filter/spec/spec_helper.rb +36 -0
- data/vendor/extensions/textile_filter/test/test_helper.rb +19 -0
- data/vendor/extensions/textile_filter/test/unit/textile_filter_test.rb +13 -0
- data/vendor/extensions/textile_filter/textile.html +115 -0
- data/vendor/extensions/textile_filter/textile_filter_extension.rb +10 -0
- data/vendor/plugins/haml/README.md +154 -95
- data/vendor/plugins/haml/Rakefile +91 -104
- data/vendor/plugins/haml/TODO +20 -26
- data/vendor/plugins/haml/VERSION +1 -1
- data/vendor/plugins/haml/VERSION_NAME +1 -1
- data/vendor/plugins/haml/bin/css2sass +1 -7
- data/vendor/plugins/haml/doc-src/FAQ.md +4 -16
- data/vendor/plugins/haml/doc-src/HAML_CHANGELOG.md +1 -536
- data/vendor/plugins/haml/doc-src/HAML_REFERENCE.md +16 -176
- data/vendor/plugins/haml/doc-src/SASS_CHANGELOG.md +0 -1159
- data/vendor/plugins/haml/doc-src/SASS_REFERENCE.md +632 -1162
- data/vendor/plugins/haml/extra/haml-mode.el +34 -36
- data/vendor/plugins/haml/extra/sass-mode.el +9 -10
- data/vendor/plugins/haml/haml.gemspec +33 -8
- data/vendor/plugins/haml/lib/haml.rb +2 -5
- data/vendor/plugins/haml/lib/haml/buffer.rb +4 -22
- data/vendor/plugins/haml/lib/haml/engine.rb +4 -13
- data/vendor/plugins/haml/lib/haml/exec.rb +64 -456
- data/vendor/plugins/haml/lib/haml/filters.rb +1 -19
- data/vendor/plugins/haml/lib/haml/helpers.rb +19 -40
- data/vendor/plugins/haml/lib/haml/helpers/action_view_mods.rb +12 -38
- data/vendor/plugins/haml/lib/haml/helpers/xss_mods.rb +2 -13
- data/vendor/plugins/haml/lib/haml/html.rb +49 -209
- data/vendor/plugins/haml/lib/haml/precompiler.rb +89 -130
- data/vendor/plugins/haml/lib/haml/railtie.rb +13 -16
- data/vendor/plugins/haml/lib/haml/template.rb +12 -13
- data/vendor/plugins/haml/lib/haml/template/plugin.rb +6 -18
- data/vendor/plugins/haml/lib/haml/util.rb +44 -483
- data/vendor/plugins/haml/lib/haml/version.rb +2 -25
- data/vendor/plugins/haml/lib/sass.rb +2 -7
- data/vendor/plugins/haml/lib/sass/css.rb +196 -86
- data/vendor/plugins/haml/lib/sass/engine.rb +99 -304
- data/vendor/plugins/haml/lib/sass/environment.rb +3 -67
- data/vendor/plugins/haml/lib/sass/error.rb +25 -166
- data/vendor/plugins/haml/lib/sass/files.rb +38 -43
- data/vendor/plugins/haml/lib/sass/plugin.rb +150 -198
- data/vendor/plugins/haml/lib/sass/plugin/merb.rb +20 -8
- data/vendor/plugins/haml/lib/sass/plugin/rack.rb +20 -2
- data/vendor/plugins/haml/lib/sass/plugin/rails.rb +9 -16
- data/vendor/plugins/haml/lib/sass/repl.rb +1 -1
- data/vendor/plugins/haml/lib/sass/script.rb +31 -32
- data/vendor/plugins/haml/lib/sass/script/bool.rb +1 -2
- data/vendor/plugins/haml/lib/sass/script/color.rb +26 -295
- data/vendor/plugins/haml/lib/sass/script/funcall.rb +6 -33
- data/vendor/plugins/haml/lib/sass/script/functions.rb +33 -637
- data/vendor/plugins/haml/lib/sass/script/lexer.rb +57 -200
- data/vendor/plugins/haml/lib/sass/script/literal.rb +10 -69
- data/vendor/plugins/haml/lib/sass/script/node.rb +1 -99
- data/vendor/plugins/haml/lib/sass/script/number.rb +24 -64
- data/vendor/plugins/haml/lib/sass/script/operation.rb +3 -53
- data/vendor/plugins/haml/lib/sass/script/parser.rb +50 -229
- data/vendor/plugins/haml/lib/sass/script/string.rb +2 -57
- data/vendor/plugins/haml/lib/sass/script/unary_operation.rb +2 -25
- data/vendor/plugins/haml/lib/sass/script/variable.rb +5 -22
- data/vendor/plugins/haml/lib/sass/tree/comment_node.rb +27 -71
- data/vendor/plugins/haml/lib/sass/tree/debug_node.rb +2 -8
- data/vendor/plugins/haml/lib/sass/tree/directive_node.rb +37 -44
- data/vendor/plugins/haml/lib/sass/tree/for_node.rb +0 -19
- data/vendor/plugins/haml/lib/sass/tree/if_node.rb +0 -26
- data/vendor/plugins/haml/lib/sass/tree/import_node.rb +27 -64
- data/vendor/plugins/haml/lib/sass/tree/mixin_def_node.rb +0 -31
- data/vendor/plugins/haml/lib/sass/tree/mixin_node.rb +7 -82
- data/vendor/plugins/haml/lib/sass/tree/node.rb +77 -291
- data/vendor/plugins/haml/lib/sass/tree/prop_node.rb +58 -157
- data/vendor/plugins/haml/lib/sass/tree/rule_node.rb +137 -178
- data/vendor/plugins/haml/lib/sass/tree/variable_node.rb +5 -10
- data/vendor/plugins/haml/lib/sass/tree/while_node.rb +0 -17
- data/vendor/plugins/haml/test/benchmark.rb +5 -5
- data/vendor/plugins/haml/test/haml/engine_test.rb +19 -530
- data/vendor/plugins/haml/test/haml/helper_test.rb +7 -124
- data/vendor/plugins/haml/test/haml/html2haml_test.rb +66 -250
- data/vendor/plugins/haml/test/haml/results/filters.xhtml +1 -1
- data/vendor/plugins/haml/test/haml/results/helpers.xhtml +23 -0
- data/vendor/plugins/haml/test/haml/results/just_stuff.xhtml +0 -2
- data/vendor/plugins/haml/test/haml/rhtml/_av_partial_1.rhtml +12 -0
- data/vendor/plugins/haml/test/haml/rhtml/_av_partial_2.rhtml +8 -0
- data/vendor/plugins/haml/test/haml/rhtml/action_view.rhtml +62 -0
- data/vendor/plugins/haml/test/haml/rhtml/standard.rhtml +54 -0
- data/vendor/plugins/haml/test/haml/template_test.rb +3 -33
- data/vendor/plugins/haml/test/haml/templates/helpers.haml +66 -0
- data/vendor/plugins/haml/test/haml/templates/just_stuff.haml +0 -2
- data/vendor/plugins/haml/test/haml/util_test.rb +0 -161
- data/vendor/plugins/haml/test/linked_rails.rb +1 -22
- data/vendor/plugins/haml/test/sass/css2sass_test.rb +18 -130
- data/vendor/plugins/haml/test/sass/engine_test.rb +138 -1426
- data/vendor/plugins/haml/test/sass/functions_test.rb +47 -429
- data/vendor/plugins/haml/test/sass/more_results/more_import.css +1 -1
- data/vendor/plugins/haml/test/sass/more_templates/more_import.sass +3 -3
- data/vendor/plugins/haml/test/sass/plugin_test.rb +56 -246
- data/vendor/plugins/haml/test/sass/results/compact.css +1 -1
- data/vendor/plugins/haml/test/sass/results/complex.css +6 -5
- data/vendor/plugins/haml/test/sass/results/compressed.css +1 -1
- data/vendor/plugins/haml/test/sass/results/expanded.css +1 -1
- data/vendor/plugins/haml/test/sass/results/import.css +1 -3
- data/vendor/plugins/haml/test/sass/results/mixins.css +12 -12
- data/vendor/plugins/haml/test/sass/results/nested.css +1 -1
- data/vendor/plugins/haml/test/sass/results/parent_ref.css +4 -4
- data/vendor/plugins/haml/test/sass/results/script.css +4 -4
- data/vendor/plugins/haml/test/sass/script_test.rb +78 -281
- data/vendor/plugins/haml/test/sass/templates/alt.sass +2 -2
- data/vendor/plugins/haml/test/sass/templates/basic.sass +1 -1
- data/vendor/plugins/haml/test/sass/templates/bork.sass +2 -0
- data/vendor/plugins/haml/test/sass/templates/complex.sass +2 -0
- data/vendor/plugins/haml/test/sass/templates/import.sass +4 -5
- data/vendor/plugins/haml/test/sass/templates/importee.sass +3 -3
- data/vendor/plugins/haml/test/sass/templates/line_numbers.sass +1 -1
- data/vendor/plugins/haml/test/sass/templates/mixins.sass +2 -2
- data/vendor/plugins/haml/test/sass/templates/parent_ref.sass +2 -2
- data/vendor/plugins/haml/test/sass/templates/script.sass +69 -69
- data/vendor/plugins/haml/test/sass/templates/units.sass +10 -10
- data/vendor/plugins/haml/test/test_helper.rb +4 -52
- data/vendor/plugins/haml/yard/default/fulldoc/html/css/common.sass +1 -5
- metadata +2926 -2487
- data/vendor/rack-cache/CHANGES +0 -128
- data/vendor/rack-cache/COPYING +0 -18
- data/vendor/rack-cache/README +0 -110
- data/vendor/rack-cache/Rakefile +0 -137
- data/vendor/rack-cache/TODO +0 -31
- data/vendor/rack-cache/doc/configuration.markdown +0 -86
- data/vendor/rack-cache/doc/faq.markdown +0 -141
- data/vendor/rack-cache/doc/index.markdown +0 -118
- data/vendor/rack-cache/doc/layout.html.erb +0 -34
- data/vendor/rack-cache/doc/license.markdown +0 -24
- data/vendor/rack-cache/doc/rack-cache.css +0 -362
- data/vendor/rack-cache/doc/server.ru +0 -34
- data/vendor/rack-cache/doc/storage.markdown +0 -162
- data/vendor/rack-cache/example/sinatra/app.rb +0 -25
- data/vendor/rack-cache/example/sinatra/views/index.erb +0 -44
- data/vendor/rack-cache/lib/rack/cache.rb +0 -45
- data/vendor/rack-cache/lib/rack/cache/cachecontrol.rb +0 -193
- data/vendor/rack-cache/lib/rack/cache/context.rb +0 -233
- data/vendor/rack-cache/lib/rack/cache/entitystore.rb +0 -253
- data/vendor/rack-cache/lib/rack/cache/key.rb +0 -52
- data/vendor/rack-cache/lib/rack/cache/metastore.rb +0 -328
- data/vendor/rack-cache/lib/rack/cache/options.rb +0 -150
- data/vendor/rack-cache/lib/rack/cache/request.rb +0 -33
- data/vendor/rack-cache/lib/rack/cache/response.rb +0 -267
- data/vendor/rack-cache/lib/rack/cache/storage.rb +0 -49
- data/vendor/rack-cache/rack-cache.gemspec +0 -69
- data/vendor/rack-cache/test/cache_test.rb +0 -38
- data/vendor/rack-cache/test/cachecontrol_test.rb +0 -139
- data/vendor/rack-cache/test/context_test.rb +0 -727
- data/vendor/rack-cache/test/entitystore_test.rb +0 -189
- data/vendor/rack-cache/test/key_test.rb +0 -50
- data/vendor/rack-cache/test/metastore_test.rb +0 -263
- data/vendor/rack-cache/test/options_test.rb +0 -78
- data/vendor/rack-cache/test/pony.jpg +0 -0
- data/vendor/rack-cache/test/request_test.rb +0 -19
- data/vendor/rack-cache/test/response_test.rb +0 -178
- data/vendor/rack-cache/test/spec_setup.rb +0 -202
- data/vendor/rack-cache/test/storage_test.rb +0 -94
@@ -3,56 +3,20 @@
|
|
3
3
|
* Table of contents
|
4
4
|
{:toc}
|
5
5
|
|
6
|
-
Sass is
|
7
|
-
that
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
particularly with the help of
|
14
|
-
[the Compass style library](http://compass-style.org).
|
6
|
+
Sass is a meta-language on top of CSS
|
7
|
+
that's used to describe the style of a document
|
8
|
+
cleanly and structurally,
|
9
|
+
with more power than flat CSS allows.
|
10
|
+
Sass both provides a simpler, more elegant syntax for CSS
|
11
|
+
and implements various features that are useful
|
12
|
+
for creating manageable stylesheets.
|
15
13
|
|
16
14
|
## Features
|
17
15
|
|
18
|
-
*
|
19
|
-
*
|
20
|
-
*
|
21
|
-
*
|
22
|
-
* Well-formatted, customizable output
|
23
|
-
* [Firebug integration](https://addons.mozilla.org/en-US/firefox/addon/103988)
|
24
|
-
|
25
|
-
## Syntax
|
26
|
-
|
27
|
-
There are two syntaxes available for Sass.
|
28
|
-
The first, known as SCSS (Sassy CSS) and used throughout this reference,
|
29
|
-
is an extension of the syntax of CSS3.
|
30
|
-
This means that every valid CSS3 stylesheet
|
31
|
-
is a valid SCSS file with the same meaning.
|
32
|
-
In addition, SCSS understands most CSS hacks
|
33
|
-
and vendor-specific syntax, such as [IE's old `filter` syntax](http://msdn.microsoft.com/en-us/library/ms533754%28VS.85%29.aspx).
|
34
|
-
This syntax is enhanced with the Sass features described below.
|
35
|
-
Files using this syntax have the `.scss` extension.
|
36
|
-
|
37
|
-
The second and older syntax, known as the indented syntax (or sometimes just "Sass"),
|
38
|
-
provides a more concise way of writing CSS.
|
39
|
-
It uses indentation rather than brackets to indicate nesting of selectors,
|
40
|
-
and newlines rather than semicolons to separate properties.
|
41
|
-
Some people find this to be easier to read and quicker to write than SCSS.
|
42
|
-
The indented syntax has all the same features,
|
43
|
-
although some of them have slightly different syntax;
|
44
|
-
this is described in {file:INDENTED_SYNTAX.md the indented syntax reference}.
|
45
|
-
Files using this syntax have the `.sass` extension.
|
46
|
-
|
47
|
-
Either syntax can [import](#import) files written in the other.
|
48
|
-
Files can be automatically converted from one syntax to the other
|
49
|
-
using the `sass-convert` command line tool:
|
50
|
-
|
51
|
-
# Convert Sass to SCSS
|
52
|
-
$ sass-convert style.sass style.scss
|
53
|
-
|
54
|
-
# Convert SCSS to Sass
|
55
|
-
$ sass-convert style.scss style.sass
|
16
|
+
* Whitespace active
|
17
|
+
* Well-formatted output
|
18
|
+
* Elegant input
|
19
|
+
* Feature-rich
|
56
20
|
|
57
21
|
## Using Sass
|
58
22
|
|
@@ -68,49 +32,37 @@ The first step for all of these is to install the Haml gem:
|
|
68
32
|
|
69
33
|
gem install haml
|
70
34
|
|
71
|
-
If you're using Windows,
|
72
|
-
you may need to [install Ruby](http://rubyinstaller.org/download.html) first.
|
73
|
-
|
74
35
|
To run Sass from the command line, just use
|
75
36
|
|
76
|
-
sass input.
|
77
|
-
|
78
|
-
You can also tell Sass to watch the file and update the CSS
|
79
|
-
every time the Sass file changes:
|
80
|
-
|
81
|
-
sass --watch input.scss:output.css
|
82
|
-
|
83
|
-
If you have a directory with many Sass files,
|
84
|
-
you can also tell Sass to watch the entire directory:
|
85
|
-
|
86
|
-
sass --watch app/sass:public/stylesheets
|
37
|
+
sass input.sass output.css
|
87
38
|
|
88
39
|
Use `sass --help` for full documentation.
|
40
|
+
At the moment, the command-line tool doesn't support
|
41
|
+
updating everything in a directory
|
42
|
+
or automatically updating the CSS file when the Sass file changes.
|
43
|
+
To do that, check out the [Compass](http://compass-style.org/) Sass framework.
|
89
44
|
|
90
45
|
Using Sass in Ruby code is very simple.
|
91
46
|
After installing the Haml gem,
|
92
47
|
you can use it by running `require "sass"`
|
93
|
-
and using
|
48
|
+
and using Sass::Engine like so:
|
94
49
|
|
95
|
-
engine = Sass::Engine.new("#main
|
50
|
+
engine = Sass::Engine.new("#main\n background-color: #0000ff")
|
96
51
|
engine.render #=> "#main { background-color: #0000ff; }\n"
|
97
52
|
|
98
53
|
### Rack/Rails/Merb Plugin
|
99
54
|
|
100
|
-
To enable Sass
|
101
|
-
add the following line to `environment.rb`:
|
102
|
-
|
103
|
-
config.gem "haml"
|
55
|
+
To enable Sass as a Rails plugin, run
|
104
56
|
|
105
|
-
|
106
|
-
|
107
|
-
gem "haml"
|
57
|
+
haml --rails path/to/rails/app
|
108
58
|
|
109
59
|
To enable Sass in Merb,
|
110
|
-
add
|
60
|
+
add
|
111
61
|
|
112
62
|
dependency "merb-haml"
|
113
63
|
|
64
|
+
to `config/dependencies.rb`.
|
65
|
+
|
114
66
|
To enable Sass in a Rack application,
|
115
67
|
add
|
116
68
|
|
@@ -122,10 +74,10 @@ to `config.ru`.
|
|
122
74
|
Sass stylesheets don't work the same as views.
|
123
75
|
They don't contain dynamic content,
|
124
76
|
so the CSS only needs to be generated when the Sass file has been updated.
|
125
|
-
By default,
|
77
|
+
By default, ".sass" files are placed in public/stylesheets/sass
|
126
78
|
(this can be customized with the [`:template_location`](#template_location-option) option).
|
127
79
|
Then, whenever necessary, they're compiled into corresponding CSS files in public/stylesheets.
|
128
|
-
For instance, public/stylesheets/sass/main.
|
80
|
+
For instance, public/stylesheets/sass/main.sass would be compiled to public/stylesheets/main.css.
|
129
81
|
|
130
82
|
### Caching
|
131
83
|
|
@@ -152,44 +104,29 @@ in `environment.rb` in Rails or `config.ru` in Rack...
|
|
152
104
|
Merb::Plugin.config[:sass][:style] = :compact
|
153
105
|
|
154
106
|
...or by passing an options hash to {Sass::Engine#initialize}.
|
155
|
-
All relevant options are also available via flags
|
156
|
-
to the `sass` command-line executable.
|
157
107
|
Available options are:
|
158
108
|
|
159
109
|
{#style-option} `:style`
|
160
110
|
: Sets the style of the CSS output.
|
161
111
|
See [Output Style](#output_style).
|
162
112
|
|
163
|
-
{#syntax-option} `:syntax`
|
164
|
-
: The syntax of the input file, `:sass` for the indented syntax
|
165
|
-
and `:scss` for the CSS-extension syntax.
|
166
|
-
This is only useful when you're constructing {Sass::Engine} instances yourself;
|
167
|
-
it's automatically set properly when using {Sass::Plugin}.
|
168
|
-
Defaults to `:sass`.
|
169
|
-
|
170
113
|
{#property_syntax-option} `:property_syntax`
|
171
|
-
: Forces
|
114
|
+
: Forces the document to use one syntax for properties.
|
172
115
|
If the correct syntax isn't used, an error is thrown.
|
173
116
|
`:new` forces the use of a colon or equals sign
|
174
117
|
after the property name.
|
175
118
|
For example: `color: #0f3`
|
176
|
-
or `width
|
119
|
+
or `width = !main_width`.
|
177
120
|
`:old` forces the use of a colon
|
178
121
|
before the property name.
|
179
122
|
For example: `:color #0f3`
|
180
|
-
or `:width
|
123
|
+
or `:width = !main_width`.
|
181
124
|
By default, either syntax is valid.
|
182
|
-
This has no effect on SCSS documents.
|
183
125
|
|
184
126
|
{#cache-option} `:cache`
|
185
127
|
: Whether parsed Sass files should be cached,
|
186
128
|
allowing greater speed. Defaults to true.
|
187
129
|
|
188
|
-
{#read_cache-option} `:read_cache`
|
189
|
-
: If this is set and `:cache` is not,
|
190
|
-
only read the Sass cache if it exists,
|
191
|
-
don't write to it if it doesn't.
|
192
|
-
|
193
130
|
{#never_update-option} `:never_update`
|
194
131
|
: Whether the CSS files should never be updated,
|
195
132
|
even if the template file changes.
|
@@ -202,7 +139,7 @@ Available options are:
|
|
202
139
|
time a controller is accessed,
|
203
140
|
as opposed to only when the template has been modified.
|
204
141
|
Defaults to false.
|
205
|
-
Only has meaning within Rack, Ruby on Rails, or Merb.
|
142
|
+
Only has meaning within Rack, Ruby on Rails,x or Merb.
|
206
143
|
|
207
144
|
{#always_check-option} `:always_check`
|
208
145
|
: Whether a Sass template should be checked for updates every
|
@@ -235,11 +172,6 @@ Available options are:
|
|
235
172
|
Note that if multiple template locations are specified, all
|
236
173
|
of them are placed in the import path, allowing you to import
|
237
174
|
between them.
|
238
|
-
**Note that due to the many possible formats it can take,
|
239
|
-
this option should only be set directly, not accessed or modified.
|
240
|
-
Use the {Sass::Plugin#template_location_array},
|
241
|
-
{Sass::Plugin#add_template_location},
|
242
|
-
and {Sass::Plugin#remove_template_location} methods instead**.
|
243
175
|
|
244
176
|
{#css_location-option} `:css_location`
|
245
177
|
: The path where CSS output should be written to.
|
@@ -255,8 +187,7 @@ Available options are:
|
|
255
187
|
{#unix_newlines-option} `:unix_newlines`
|
256
188
|
: If true, use Unix-style newlines when writing files.
|
257
189
|
Only has meaning on Windows, and only when Sass is writing the files
|
258
|
-
(in Rack, Rails, or Merb, when using {Sass::Plugin} directly
|
259
|
-
or when using the command-line executable).
|
190
|
+
(in Rack, Rails, or Merb, or when using {Sass::Plugin} directly).
|
260
191
|
|
261
192
|
{#filename-option} `:filename`
|
262
193
|
: The filename of the file being rendered.
|
@@ -277,92 +208,96 @@ Available options are:
|
|
277
208
|
{#line_numbers-option} `:line_numbers`
|
278
209
|
: When set to true, causes the line number and file
|
279
210
|
where a selector is defined to be emitted into the compiled CSS
|
280
|
-
as a comment. Useful for debugging
|
211
|
+
as a comment. Useful for debugging especially when using imports
|
281
212
|
and mixins.
|
282
213
|
This option may also be called `:line_comments`.
|
283
|
-
Automatically disabled when using the `:compressed` output style
|
284
|
-
or the `:debug_info` option.
|
285
|
-
|
286
|
-
{#debug_info-option} `:debug_info`
|
287
|
-
: When set to true, causes the line number and file
|
288
|
-
where a selector is defined to be emitted into the compiled CSS
|
289
|
-
in a format that can be understood by the browser.
|
290
|
-
Useful in conjunction with [the FireSass Firebug extension](https://addons.mozilla.org/en-US/firefox/addon/103988)
|
291
|
-
for displaying the Sass filename and line number.
|
292
|
-
Automatically disabled when using the `:compressed` output style.
|
293
214
|
|
294
215
|
{#custom-option} `:custom`
|
295
216
|
: An option that's available for individual applications to set
|
296
217
|
to make data available to {Sass::Script::Functions custom Sass functions}.
|
297
218
|
|
298
|
-
|
299
|
-
: Parses the document using semantics closer to that of Sass v2.
|
300
|
-
Currently, this just means that strings in mixin arguments
|
301
|
-
are treated as though they were in [an `=` context](#sass-script-strings).
|
302
|
-
|
303
|
-
{#quiet-option} `:quiet`
|
304
|
-
: When set to true, causes warnings to be disabled.
|
305
|
-
|
306
|
-
### Encodings
|
307
|
-
|
308
|
-
When running on Ruby 1.9 and later, Sass is aware of the character encoding of documents
|
309
|
-
and will handle them the same way that CSS would.
|
310
|
-
By default, Sass assumes that all stylesheets are encoded
|
311
|
-
using whatever coding system your operating system defaults to.
|
312
|
-
For many users this will be `UTF-8`, the de facto standard for the web.
|
313
|
-
For some users, though, it may be a more local encoding.
|
314
|
-
|
315
|
-
If you want to use a different encoding for your stylesheet
|
316
|
-
than your operating system default,
|
317
|
-
you can use the `@charset` declaration just like in CSS.
|
318
|
-
Add `@charset "encoding-name";` at the beginning of the stylesheet
|
319
|
-
(before any whitespace or comments)
|
320
|
-
and Sass will interpret it as the given encoding.
|
321
|
-
Note that whatever encoding you use, it must be convertible to Unicode.
|
322
|
-
|
323
|
-
Sass will also respect any Unicode BOMs and non-ASCII-compatible Unicode encodings
|
324
|
-
[as specified by the CSS spec](http://www.w3.org/TR/CSS2/syndata.html#charset),
|
325
|
-
although this is *not* the recommended way
|
326
|
-
to specify the character set for a document.
|
327
|
-
Note that Sass does not support the obscure `UTF-32-2143`,
|
328
|
-
`UTF-32-3412`, `EBCDIC`, `IBM1026`, and `GSM 03.38` encodings,
|
329
|
-
since Ruby does not have support for them
|
330
|
-
and they're highly unlikely to ever be used in practice.
|
331
|
-
|
332
|
-
#### Output Encoding
|
333
|
-
|
334
|
-
In general, Sass will try to encode the output stylesheet
|
335
|
-
using the same encoding as the input stylesheet.
|
336
|
-
In order for it to do this, though, the input stylesheet must have a `@charset` declaration;
|
337
|
-
otherwise, Sass will default to encoding the output stylesheet as UTF-8.
|
338
|
-
In addition, it will add a `@charset` declaration to the output
|
339
|
-
if it's not plain ASCII.
|
340
|
-
|
341
|
-
When other stylesheets with `@charset` declarations are `@import`ed,
|
342
|
-
Sass will convert them to the same encoding as the main stylesheet.
|
343
|
-
|
344
|
-
Note that Ruby 1.8 does not have good support for character encodings,
|
345
|
-
and so Sass behaves somewhat differently when running under it than under Ruby 1.9 and later.
|
346
|
-
In Ruby 1.8, Sass simply uses the first `@charset` declaration in the stylesheet
|
347
|
-
or any of the other stylesheets it `@import`s.
|
348
|
-
|
349
|
-
## CSS Extensions
|
219
|
+
## CSS Rules
|
350
220
|
|
351
|
-
|
221
|
+
Rules in flat CSS have two elements:
|
222
|
+
the selector (e.g. `#main`, `div p`, `li a:hover`)
|
223
|
+
and the properties (e.g. `color: #00ff00;`, `width: 5em;`).
|
224
|
+
Sass has both of these,
|
225
|
+
as well as one additional element: nested rules.
|
352
226
|
|
353
|
-
|
354
|
-
|
227
|
+
### Rules and Selectors
|
228
|
+
|
229
|
+
However, some of the syntax is a little different.
|
230
|
+
The syntax for selectors is the same,
|
231
|
+
but instead of using brackets to delineate the properties that belong to a particular rule,
|
232
|
+
Sass uses indentation.
|
233
|
+
For example:
|
234
|
+
|
235
|
+
#main p
|
236
|
+
<property>
|
237
|
+
<property>
|
238
|
+
...
|
239
|
+
|
240
|
+
Like CSS, you can stretch selectors over multiple lines.
|
241
|
+
However, unlike CSS, you can only do this if each line but the last
|
242
|
+
ends with a comma.
|
243
|
+
For example:
|
244
|
+
|
245
|
+
.users #userTab,
|
246
|
+
.posts #postsTab
|
247
|
+
<property>
|
248
|
+
|
249
|
+
### Properties
|
250
|
+
|
251
|
+
There are two different ways to write CSS properties.
|
252
|
+
The first is very similar to the how you're used to writing them:
|
253
|
+
with a colon between the name and the value.
|
254
|
+
However, Sass properties don't have semicolons at the end;
|
255
|
+
each property is on its own line, so they aren't necessary.
|
355
256
|
For example:
|
356
257
|
|
258
|
+
#main p
|
259
|
+
color: #00ff00
|
260
|
+
width: 97%
|
261
|
+
|
262
|
+
is compiled to:
|
263
|
+
|
357
264
|
#main p {
|
358
265
|
color: #00ff00;
|
359
|
-
width: 97
|
266
|
+
width: 97% }
|
360
267
|
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
268
|
+
The second syntax for properties is slightly different.
|
269
|
+
The colon is at the beginning of the property,
|
270
|
+
rather than between the name and the value,
|
271
|
+
so it's easier to tell what elements are properties just by glancing at them.
|
272
|
+
For example:
|
273
|
+
|
274
|
+
#main p
|
275
|
+
:color #00ff00
|
276
|
+
:width 97%
|
277
|
+
|
278
|
+
is compiled to:
|
279
|
+
|
280
|
+
#main p {
|
281
|
+
color: #00ff00;
|
282
|
+
width: 97% }
|
283
|
+
|
284
|
+
By default, either property syntax may be used.
|
285
|
+
If you want to force one or the other,
|
286
|
+
see the [`:property_syntax`](#property_syntax-option) option.
|
287
|
+
|
288
|
+
### Nested Rules
|
289
|
+
|
290
|
+
Rules can also be nested within each other.
|
291
|
+
This signifies that the inner rule's selector is a child of the outer selector.
|
292
|
+
For example:
|
293
|
+
|
294
|
+
#main p
|
295
|
+
color: #00ff00
|
296
|
+
width: 97%
|
297
|
+
|
298
|
+
.redbox
|
299
|
+
background-color: #ff0000
|
300
|
+
color: #000000
|
366
301
|
|
367
302
|
is compiled to:
|
368
303
|
|
@@ -373,20 +308,18 @@ is compiled to:
|
|
373
308
|
background-color: #ff0000;
|
374
309
|
color: #000000; }
|
375
310
|
|
376
|
-
This
|
377
|
-
and makes complex CSS layouts with lots of nested selectors much simpler.
|
378
|
-
For example:
|
311
|
+
This makes insanely complicated CSS layouts with lots of nested selectors very simple:
|
379
312
|
|
380
|
-
#main
|
381
|
-
width: 97
|
313
|
+
#main
|
314
|
+
width: 97%
|
382
315
|
|
383
|
-
p, div
|
384
|
-
font-size: 2em
|
385
|
-
a
|
386
|
-
|
316
|
+
p, div
|
317
|
+
font-size: 2em
|
318
|
+
a
|
319
|
+
font-weight: bold
|
387
320
|
|
388
|
-
pre
|
389
|
-
|
321
|
+
pre
|
322
|
+
font-size: 3em
|
390
323
|
|
391
324
|
is compiled to:
|
392
325
|
|
@@ -401,74 +334,72 @@ is compiled to:
|
|
401
334
|
|
402
335
|
### Referencing Parent Selectors: `&`
|
403
336
|
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
In these cases, you can explicitly specify where the parent selector
|
410
|
-
should be inserted using the `&` character.
|
411
|
-
For example:
|
337
|
+
In addition to the default behavior of inserting the parent selector
|
338
|
+
as a CSS parent of the current selector
|
339
|
+
(e.g. above, `#main` is the parent of `p`),
|
340
|
+
you can have more fine-grained control over what's done with the parent selector
|
341
|
+
by using the ampersand character `&` in your selectors.
|
412
342
|
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
&:hover { text-decoration: underline; }
|
417
|
-
body.firefox & { font-weight: normal; }
|
418
|
-
}
|
343
|
+
The ampersand is automatically replaced by the parent selector,
|
344
|
+
instead of having it prepended.
|
345
|
+
This allows you to cleanly create pseudo-classes:
|
419
346
|
|
420
|
-
|
347
|
+
a
|
348
|
+
font-weight: bold
|
349
|
+
text-decoration: none
|
350
|
+
&:hover
|
351
|
+
text-decoration: underline
|
352
|
+
&:visited
|
353
|
+
font-weight: normal
|
354
|
+
|
355
|
+
Which would become:
|
421
356
|
|
422
357
|
a {
|
423
358
|
font-weight: bold;
|
424
359
|
text-decoration: none; }
|
425
360
|
a:hover {
|
426
361
|
text-decoration: underline; }
|
427
|
-
|
362
|
+
a:visited {
|
428
363
|
font-weight: normal; }
|
429
364
|
|
430
|
-
|
431
|
-
|
432
|
-
the parent selector will be fully resolved
|
433
|
-
before the `&` is replaced.
|
434
|
-
For example:
|
365
|
+
It also allows you to add selectors at the base of the hierarchy,
|
366
|
+
which can be useuful for targeting certain styles to certain browsers:
|
435
367
|
|
436
|
-
#main
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
368
|
+
#main
|
369
|
+
width: 90%
|
370
|
+
#sidebar
|
371
|
+
float: left
|
372
|
+
margin-left: 20%
|
373
|
+
.ie6 &
|
374
|
+
margin-left: 40%
|
443
375
|
|
444
|
-
|
376
|
+
Which would become:
|
445
377
|
|
446
378
|
#main {
|
447
|
-
|
448
|
-
#main
|
449
|
-
|
450
|
-
|
451
|
-
|
379
|
+
width: 90%; }
|
380
|
+
#main #sidebar {
|
381
|
+
float: left;
|
382
|
+
margin-left: 20%; }
|
383
|
+
.ie6 #main #sidebar {
|
384
|
+
margin-left: 40%; }
|
452
385
|
|
453
|
-
###
|
386
|
+
### Property Namespaces
|
454
387
|
|
455
388
|
CSS has quite a few properties that are in "namespaces;"
|
456
389
|
for instance, `font-family`, `font-size`, and `font-weight`
|
457
390
|
are all in the `font` namespace.
|
458
391
|
In CSS, if you want to set a bunch of properties in the same namespace,
|
459
392
|
you have to type it out each time.
|
460
|
-
Sass
|
393
|
+
Sass offers a shortcut for this:
|
461
394
|
just write the namespace one,
|
462
|
-
then
|
395
|
+
then indent each of the sub-properties within it.
|
463
396
|
For example:
|
464
397
|
|
465
|
-
.funky
|
466
|
-
font:
|
467
|
-
family: fantasy
|
468
|
-
size: 30em
|
469
|
-
weight: bold
|
470
|
-
}
|
471
|
-
}
|
398
|
+
.funky
|
399
|
+
font:
|
400
|
+
family: fantasy
|
401
|
+
size: 30em
|
402
|
+
weight: bold
|
472
403
|
|
473
404
|
is compiled to:
|
474
405
|
|
@@ -477,67 +408,258 @@ is compiled to:
|
|
477
408
|
font-size: 30em;
|
478
409
|
font-weight: bold; }
|
479
410
|
|
480
|
-
|
411
|
+
### Selector Escaping: `\`
|
412
|
+
|
413
|
+
In case, for whatever reason, you need to write a selector
|
414
|
+
that begins with a Sass-meaningful character,
|
415
|
+
you can escape it with a backslash (`\`).
|
481
416
|
For example:
|
482
417
|
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
size: 30em;
|
487
|
-
weight: bold;
|
488
|
-
}
|
489
|
-
}
|
418
|
+
#main
|
419
|
+
\+div
|
420
|
+
clear: both
|
490
421
|
|
491
422
|
is compiled to:
|
492
423
|
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
424
|
+
#main +div {
|
425
|
+
clear: both; }
|
426
|
+
|
427
|
+
## Directives
|
428
|
+
|
429
|
+
Directives allow the author to directly issue instructions to the Sass compiler.
|
430
|
+
They're prefixed with an at sign, `@`,
|
431
|
+
followed by the name of the directive,
|
432
|
+
a space, and any arguments to it -
|
433
|
+
just like CSS directives.
|
434
|
+
For example:
|
435
|
+
|
436
|
+
@import red.sass
|
437
|
+
|
438
|
+
Some directives can also control whether or how many times
|
439
|
+
a chunk of Sass is output.
|
440
|
+
Those are documented under Control Directives.
|
441
|
+
|
442
|
+
### `@import` {#import}
|
443
|
+
|
444
|
+
The `@import` directive works in a very similar way to the CSS import directive.
|
445
|
+
It can either compile to a literal CSS `@import` directive for a CSS file,
|
446
|
+
or it can import a Sass file.
|
447
|
+
If it imports a Sass file,
|
448
|
+
not only are the rules from that file included,
|
449
|
+
but all variables in that file are made available in the current file.
|
450
|
+
|
451
|
+
Sass looks for other Sass files in the working directory,
|
452
|
+
and the Sass file directory under Rack, Rails, or Merb.
|
453
|
+
Additional search directories may be specified
|
454
|
+
using the [`:load_paths`](#load_paths-option) option.
|
455
|
+
|
456
|
+
`@import` takes a filename with or without an extension.
|
457
|
+
If an extension isn't provided,
|
458
|
+
Sass will try to find a Sass file with the given basename in the load paths.
|
459
|
+
|
460
|
+
For example,
|
461
|
+
|
462
|
+
@import foo.sass
|
463
|
+
|
464
|
+
or
|
465
|
+
|
466
|
+
@import foo
|
467
|
+
|
468
|
+
would compile to
|
469
|
+
|
470
|
+
.foo {
|
471
|
+
color: #f00; }
|
472
|
+
|
473
|
+
whereas
|
474
|
+
|
475
|
+
@import foo.css
|
476
|
+
|
477
|
+
would compile to
|
478
|
+
|
479
|
+
@import "foo.css";
|
480
|
+
|
481
|
+
#### Partials {#partials}
|
482
|
+
|
483
|
+
If you have a Sass file that you want to import
|
484
|
+
but don't want to compile to a CSS file,
|
485
|
+
you can add an underscore to the beginning of the filename.
|
486
|
+
This will tell Sass not to compile it to a normal CSS file.
|
487
|
+
You can then refer to these files without using the underscore.
|
488
|
+
|
489
|
+
For example, you might have `_colors.sass`.
|
490
|
+
Then no `_colors.css` file would be created,
|
491
|
+
and you can do
|
492
|
+
|
493
|
+
@import colors.sass
|
494
|
+
|
495
|
+
### `@debug`
|
496
|
+
|
497
|
+
The `@debug` directive prints the value of a SassScript expression
|
498
|
+
to standard error.
|
499
|
+
It's useful for debugging Sass files
|
500
|
+
that have complicated SassScript going on.
|
501
|
+
For example:
|
502
|
+
|
503
|
+
@debug 10em + 12em
|
504
|
+
|
505
|
+
outputs:
|
498
506
|
|
499
|
-
|
507
|
+
Line 1 DEBUG: 22em
|
508
|
+
|
509
|
+
### `@font-face`, `@media`, etc.
|
500
510
|
|
501
|
-
Sass
|
502
|
-
as well as single-line comments with `//`.
|
503
|
-
The multiline comments are preserved in the CSS output where possible,
|
504
|
-
while the single-line comments are removed.
|
511
|
+
Sass behaves as you'd expect for normal CSS @-directives.
|
505
512
|
For example:
|
506
513
|
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
514
|
+
@font-face
|
515
|
+
font-family: "Bitstream Vera Sans"
|
516
|
+
src: url(http://foo.bar/bvs)
|
517
|
+
|
518
|
+
compiles to:
|
519
|
+
|
520
|
+
@font-face {
|
521
|
+
font-family: "Bitstream Vera Sans";
|
522
|
+
src: url(http://foo.bar/bvs); }
|
512
523
|
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
524
|
+
and
|
525
|
+
|
526
|
+
@media print
|
527
|
+
#sidebar
|
528
|
+
display: none
|
529
|
+
|
530
|
+
#main
|
531
|
+
background-color: white
|
532
|
+
|
533
|
+
compiles to:
|
534
|
+
|
535
|
+
@media print {
|
536
|
+
#sidebar {
|
537
|
+
display: none; }
|
538
|
+
|
539
|
+
#main {
|
540
|
+
background-color: white; } }
|
541
|
+
|
542
|
+
## Control Directives
|
543
|
+
|
544
|
+
SassScript supports basic control directives for looping and conditional evaluation.
|
545
|
+
|
546
|
+
### `@if`
|
547
|
+
|
548
|
+
The `@if` statement takes a SassScript expression
|
549
|
+
and prints the code nested beneath it if the expression returns
|
550
|
+
anything other than `false`:
|
551
|
+
|
552
|
+
p
|
553
|
+
@if 1 + 1 == 2
|
554
|
+
border: 1px solid
|
555
|
+
@if 5 < 3
|
556
|
+
border: 2px dotted
|
517
557
|
|
518
558
|
is compiled to:
|
519
559
|
|
520
|
-
|
521
|
-
|
522
|
-
* since it uses the CSS comment syntax,
|
523
|
-
* it will appear in the CSS output. */
|
524
|
-
body {
|
525
|
-
color: black; }
|
560
|
+
p {
|
561
|
+
border: 1px solid; }
|
526
562
|
|
527
|
-
|
563
|
+
The `@if` statement can be followed by several `@else if` statements
|
564
|
+
and one `@else` statement.
|
565
|
+
If the `@if` statement fails,
|
566
|
+
the `@else if` statements are tried in order
|
567
|
+
until one succeeds or the `@else` is reached.
|
568
|
+
For example:
|
569
|
+
|
570
|
+
!type = "monster"
|
571
|
+
p
|
572
|
+
@if !type == "ocean"
|
573
|
+
color: blue
|
574
|
+
@else if !type == "matador"
|
575
|
+
color: red
|
576
|
+
@else if !type == "monster"
|
577
|
+
color: green
|
578
|
+
@else
|
579
|
+
color: black
|
580
|
+
|
581
|
+
is compiled to:
|
582
|
+
|
583
|
+
p {
|
528
584
|
color: green; }
|
529
585
|
|
530
|
-
|
586
|
+
### `@for`
|
587
|
+
|
588
|
+
The `@for` statement has two forms:
|
589
|
+
`@for <var> from <start> to <end>` or
|
590
|
+
`@for <var> from <start> through <end>`.
|
591
|
+
`<var>` is a variable name, like `!i`,
|
592
|
+
and `<start>` and `<end>` are SassScript expressions
|
593
|
+
that should return integers.
|
594
|
+
|
595
|
+
The `@for` statement sets `<var>` to each number
|
596
|
+
from `<start>` to `<end>`,
|
597
|
+
including `<end>` if `through` is used.
|
598
|
+
For example:
|
599
|
+
|
600
|
+
@for !i from 1 through 3
|
601
|
+
.item-#{!i}
|
602
|
+
width = 2em * !i
|
603
|
+
|
604
|
+
is compiled to:
|
605
|
+
|
606
|
+
.item-1 {
|
607
|
+
width: 2em; }
|
608
|
+
.item-2 {
|
609
|
+
width: 4em; }
|
610
|
+
.item-3 {
|
611
|
+
width: 6em; }
|
612
|
+
|
613
|
+
### `@while`
|
614
|
+
|
615
|
+
The `@while` statement repeatedly loops over the nested
|
616
|
+
block until the statement evaluates to `false`. This can
|
617
|
+
be used to achieve more complex looping than the `@for`
|
618
|
+
statement is capable of.
|
619
|
+
For example:
|
620
|
+
|
621
|
+
!i = 6
|
622
|
+
@while !i > 0
|
623
|
+
.item-#{!i}
|
624
|
+
width = 2em * !i
|
625
|
+
!i = !i - 2
|
626
|
+
|
627
|
+
is compiled to:
|
628
|
+
|
629
|
+
.item-6 {
|
630
|
+
width: 12em; }
|
631
|
+
|
632
|
+
.item-4 {
|
633
|
+
width: 8em; }
|
634
|
+
|
635
|
+
.item-2 {
|
636
|
+
width: 4em; }
|
637
|
+
|
638
|
+
## SassScript
|
639
|
+
|
640
|
+
In addition to the declarative templating system,
|
641
|
+
Sass supports a simple language known as SassScript
|
642
|
+
for dynamically computing CSS values and controlling
|
643
|
+
the styles and selectors that get emitted.
|
644
|
+
|
645
|
+
SassScript can be used as the value for a property
|
646
|
+
by using `=` instead of `:`.
|
647
|
+
For example:
|
648
|
+
|
649
|
+
color = #123 + #234
|
650
|
+
|
651
|
+
is compiled to:
|
652
|
+
|
653
|
+
color: #357;
|
654
|
+
|
655
|
+
For old-style properties, the `=` is added but the `:` is retained.
|
656
|
+
For example:
|
657
|
+
|
658
|
+
:color = #123 + #234
|
531
659
|
|
532
|
-
|
533
|
-
Sass supports a small set of extensions called SassScript.
|
534
|
-
SassScript allows properties to use
|
535
|
-
variables, arithmetic, and extra functions.
|
536
|
-
SassScript can be used in any property value.
|
660
|
+
is compiled to:
|
537
661
|
|
538
|
-
|
539
|
-
which is useful when writing [mixins](#mixins).
|
540
|
-
This is done via [interpolation](#interpolation_).
|
662
|
+
color: #357;
|
541
663
|
|
542
664
|
### Interactive Shell
|
543
665
|
|
@@ -556,93 +678,58 @@ and the result printed out for you:
|
|
556
678
|
>> #777 + #888
|
557
679
|
white
|
558
680
|
|
559
|
-
### Variables:
|
681
|
+
### Variables: `!`
|
560
682
|
|
561
683
|
The most straightforward way to use SassScript
|
562
|
-
is to
|
563
|
-
Variables begin with
|
564
|
-
and are set like
|
565
|
-
|
566
|
-
$width: 5em;
|
684
|
+
is to set and reference variables.
|
685
|
+
Variables begin with exclamation marks,
|
686
|
+
and are set like so:
|
567
687
|
|
568
|
-
|
569
|
-
|
570
|
-
#main {
|
571
|
-
width: $width;
|
572
|
-
}
|
688
|
+
!width = 5em
|
573
689
|
|
574
|
-
|
575
|
-
|
576
|
-
If they're defined outside of any nested selectors,
|
577
|
-
they're available everywhere.
|
690
|
+
You can then refer to them by putting an equals sign
|
691
|
+
after your properties:
|
578
692
|
|
579
|
-
|
580
|
-
|
581
|
-
`$` is the recommended syntax.
|
693
|
+
#main
|
694
|
+
width = !width
|
582
695
|
|
583
|
-
Variables
|
584
|
-
|
585
|
-
`:` is the recommended syntax.
|
696
|
+
Variables that are first defined in a scoped context are only
|
697
|
+
available in that context.
|
586
698
|
|
587
699
|
### Data Types
|
588
700
|
|
589
|
-
SassScript supports four
|
590
|
-
|
701
|
+
SassScript supports four data types:
|
591
702
|
* numbers (e.g. `1.2`, `13`, `10px`)
|
592
|
-
* strings of text
|
593
|
-
* colors (e.g. `blue`, `#04a3f9
|
703
|
+
* strings of text (e.g. `"foo"`, `"bar"`)
|
704
|
+
* colors (e.g. `blue`, `#04a3f9`)
|
594
705
|
* booleans (e.g. `true`, `false`)
|
595
706
|
|
596
|
-
|
597
|
-
|
598
|
-
However, it has no special handling for these types.
|
599
|
-
They're treated just like unquoted strings.
|
600
|
-
|
601
|
-
#### Strings {#sass-script-strings}
|
602
|
-
|
603
|
-
CSS specifies two kinds of strings: those with quotes,
|
604
|
-
such as `"Lucida Grande"` or `'http://sass-lang.com'`,
|
605
|
-
and those without quotes, such as `sans-serif` or `bold`.
|
606
|
-
SassScript recognizes both kinds,
|
607
|
-
and in general if one kind of string is used in the Sass document,
|
608
|
-
that kind of string will be used in the resulting CSS.
|
707
|
+
Any text that doesn't fit into one of those types
|
708
|
+
in a SassScript context will cause an error:
|
609
709
|
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
body.firefox #{$selector}:before {
|
618
|
-
content: "Hi, Firefox users!"; } }
|
619
|
-
|
620
|
-
@include firefox-message(".header");
|
710
|
+
p
|
711
|
+
!width = 5em
|
712
|
+
// This will cause an error
|
713
|
+
border = !width solid blue
|
714
|
+
// Use one of the following forms instead:
|
715
|
+
border = "#{!width} solid blue"
|
716
|
+
border = !width "solid" "blue"
|
621
717
|
|
622
718
|
is compiled to:
|
623
719
|
|
624
|
-
|
625
|
-
|
720
|
+
p {
|
721
|
+
border: 5em solid blue;
|
722
|
+
border: 5em solid blue; }
|
626
723
|
|
627
|
-
It's also worth noting that when using the [deprecated `=` property syntax](#sassscript),
|
628
|
-
all strings are interpreted as unquoted,
|
629
|
-
regardless of whether or not they're written with quotes.
|
630
724
|
|
631
725
|
### Operations
|
632
726
|
|
633
|
-
All types support equality operations (`==` and `!=`).
|
634
|
-
In addition, each type has its own operations
|
635
|
-
that it has special support for.
|
636
|
-
|
637
|
-
#### Number Operations
|
638
|
-
|
639
727
|
SassScript supports the standard arithmetic operations on numbers
|
640
728
|
(`+`, `-`, `*`, `/`, `%`),
|
641
729
|
and will automatically convert between units if it can:
|
642
730
|
|
643
|
-
p
|
644
|
-
width
|
645
|
-
}
|
731
|
+
p
|
732
|
+
width = 1in + 8pt
|
646
733
|
|
647
734
|
is compiled to:
|
648
735
|
|
@@ -656,69 +743,14 @@ and equality operators
|
|
656
743
|
(`==`, `!=`)
|
657
744
|
are supported for all types.
|
658
745
|
|
659
|
-
##### Division and `/`
|
660
|
-
{#division-and-slash}
|
661
|
-
|
662
|
-
CSS allows `/` to appear in property values
|
663
|
-
as a way of separating numbers.
|
664
|
-
Since SassScript is an extension of the CSS property syntax,
|
665
|
-
it must support this, while also allowing `/` to be used for division.
|
666
|
-
This means that by default, if two numbers are separated by `/` in SassScript,
|
667
|
-
then they will appear that way in the resulting CSS.
|
668
|
-
|
669
|
-
However, there are three situations where the `/` will be interpreted as division.
|
670
|
-
These cover the vast majority of cases where division is actually used.
|
671
|
-
They are:
|
672
|
-
|
673
|
-
1. If the value, or any part of it, is stored in a variable.
|
674
|
-
2. If the value is surrounded by parentheses.
|
675
|
-
3. If the value is used as part of another arithmetic expression.
|
676
|
-
|
677
|
-
For example:
|
678
|
-
|
679
|
-
p {
|
680
|
-
font: 10px/8px; // Plain CSS, no division
|
681
|
-
$width: 1000px;
|
682
|
-
width: $width/2; // Uses a variable, does division
|
683
|
-
height: (500px/2); // Uses parentheses, does division
|
684
|
-
margin-left: 5px + 8px/2px; // Uses +, does division
|
685
|
-
}
|
686
|
-
|
687
|
-
is compiled to:
|
688
|
-
|
689
|
-
p {
|
690
|
-
font: 10px/8px;
|
691
|
-
width: 500px;
|
692
|
-
height: 250px;
|
693
|
-
margin-left: 9px; }
|
694
|
-
|
695
|
-
If you want to use variables along with a plain CSS `/`,
|
696
|
-
you can use `#{}` to insert them.
|
697
|
-
For example:
|
698
|
-
|
699
|
-
p {
|
700
|
-
$font-size: 12px;
|
701
|
-
$line-height: 30px;
|
702
|
-
font: #{$font-size}/#{$line-height};
|
703
|
-
}
|
704
|
-
|
705
|
-
is compiled to:
|
706
|
-
|
707
|
-
p {
|
708
|
-
font: 12px/30px;
|
709
|
-
}
|
710
|
-
|
711
|
-
#### Color Operations
|
712
|
-
|
713
746
|
All arithmetic operations are supported for color values,
|
714
747
|
where they work piecewise.
|
715
748
|
This means that the operation is performed
|
716
749
|
on the red, green, and blue components in turn.
|
717
750
|
For example:
|
718
751
|
|
719
|
-
p
|
720
|
-
color
|
721
|
-
}
|
752
|
+
p
|
753
|
+
color = #010203 + #040506
|
722
754
|
|
723
755
|
computes `01 + 04 = 05`, `02 + 05 = 07`, and `03 + 06 = 09`,
|
724
756
|
and is compiled to:
|
@@ -726,16 +758,12 @@ and is compiled to:
|
|
726
758
|
p {
|
727
759
|
color: #050709; }
|
728
760
|
|
729
|
-
|
730
|
-
than to try to use color arithmetic to achieve the same effect.
|
731
|
-
|
732
|
-
Arithmetic operations also work between numbers and colors,
|
761
|
+
Arithmetic operations even work between numbers and colors,
|
733
762
|
also piecewise.
|
734
763
|
For example:
|
735
764
|
|
736
|
-
p
|
737
|
-
color
|
738
|
-
}
|
765
|
+
p
|
766
|
+
color = #010203 * 2
|
739
767
|
|
740
768
|
computes `01 * 2 = 02`, `02 * 2 = 04`, and `03 * 2 = 06`,
|
741
769
|
and is compiled to:
|
@@ -743,873 +771,315 @@ and is compiled to:
|
|
743
771
|
p {
|
744
772
|
color: #020406; }
|
745
773
|
|
746
|
-
|
747
|
-
(those created with the {Sass::Script::Functions#rgba rgba}
|
748
|
-
or {Sass::Script::Functions#hsla hsla} functions)
|
749
|
-
must have the same alpha value in order for color arithmetic
|
750
|
-
to be done with them.
|
751
|
-
The arithmetic doesn't affect the alpha value.
|
752
|
-
For example:
|
774
|
+
The `+` operation can be used to concatenate strings:
|
753
775
|
|
754
|
-
p
|
755
|
-
|
756
|
-
}
|
776
|
+
p
|
777
|
+
cursor = "e" + "-resize"
|
757
778
|
|
758
779
|
is compiled to:
|
759
780
|
|
760
781
|
p {
|
761
|
-
|
782
|
+
cursor: e-resize; }
|
762
783
|
|
763
|
-
|
764
|
-
|
765
|
-
{Sass::Script::Functions#transparentize transparentize} functions.
|
766
|
-
For example:
|
784
|
+
By default, if two values are placed next to one another,
|
785
|
+
they are concatenated with a space:
|
767
786
|
|
768
|
-
|
769
|
-
|
770
|
-
color: opacify($translucent-red, 0.8);
|
771
|
-
background-color: transparentize($translucent-red, 50%);
|
772
|
-
}
|
787
|
+
p
|
788
|
+
margin = 3px + 4px "auto"
|
773
789
|
|
774
790
|
is compiled to:
|
775
791
|
|
776
792
|
p {
|
777
|
-
|
778
|
-
background-color: rgba(255, 0, 0, 0.25); }
|
779
|
-
|
780
|
-
#### String Operations
|
793
|
+
margin: 7px auto; }
|
781
794
|
|
782
|
-
|
795
|
+
Within a string of text, #{} style interpolation can be used to
|
796
|
+
place dynamic values within the string:
|
783
797
|
|
784
|
-
p
|
785
|
-
|
786
|
-
}
|
798
|
+
p
|
799
|
+
border = "#{5px + 10px} solid #ccc"
|
787
800
|
|
788
|
-
|
801
|
+
Finally, SassScript supports `and`, `or`, and `not` operators
|
802
|
+
for boolean values.
|
789
803
|
|
790
|
-
|
791
|
-
cursor: e-resize; }
|
804
|
+
### Parentheses
|
792
805
|
|
793
|
-
|
794
|
-
(that is, the quoted string is to the left of the `+`),
|
795
|
-
the result is a quoted string.
|
796
|
-
Likewise, if an unquoted string is added to a quoted string
|
797
|
-
(the unquoted string is to the left of the `+`),
|
798
|
-
the result is an unquoted string.
|
799
|
-
For example:
|
806
|
+
Parentheses can be used to affect the order of operations:
|
800
807
|
|
801
|
-
p
|
802
|
-
|
803
|
-
font-family: sans- + "serif"; }
|
808
|
+
p
|
809
|
+
width = 1em + (2em * 3)
|
804
810
|
|
805
811
|
is compiled to:
|
806
812
|
|
807
|
-
p
|
808
|
-
|
809
|
-
font-family: sans-serif; }
|
810
|
-
|
811
|
-
By default, if two values are placed next to one another,
|
812
|
-
they are concatenated with a space:
|
813
|
-
|
814
|
-
p {
|
815
|
-
margin: 3px + 4px auto;
|
816
|
-
}
|
817
|
-
|
818
|
-
is compiled to:
|
819
|
-
|
820
|
-
p {
|
821
|
-
margin: 7px auto; }
|
822
|
-
|
823
|
-
Within a string of text, #{} style interpolation can be used to
|
824
|
-
place dynamic values within the string:
|
825
|
-
|
826
|
-
p:before {
|
827
|
-
content: "I ate #{5 + 10} pies!"; }
|
828
|
-
|
829
|
-
is compiled to:
|
830
|
-
|
831
|
-
p:before {
|
832
|
-
content: "I ate 15 pies!"; }
|
833
|
-
|
834
|
-
#### Boolean Operations
|
835
|
-
|
836
|
-
SassScript supports `and`, `or`, and `not` operators
|
837
|
-
for boolean values.
|
838
|
-
|
839
|
-
### Parentheses
|
840
|
-
|
841
|
-
Parentheses can be used to affect the order of operations:
|
842
|
-
|
843
|
-
p {
|
844
|
-
width: 1em + (2em * 3);
|
845
|
-
}
|
846
|
-
|
847
|
-
is compiled to:
|
848
|
-
|
849
|
-
p {
|
850
|
-
width: 7em; }
|
813
|
+
p {
|
814
|
+
width: 7em; }
|
851
815
|
|
852
816
|
### Functions
|
853
817
|
|
854
818
|
SassScript defines some useful functions
|
855
819
|
that are called using the normal CSS function syntax:
|
856
820
|
|
857
|
-
p
|
858
|
-
color
|
859
|
-
}
|
821
|
+
p
|
822
|
+
color = hsl(0, 100%, 50%)
|
860
823
|
|
861
824
|
is compiled to:
|
862
825
|
|
863
|
-
|
826
|
+
#main {
|
864
827
|
color: #ff0000; }
|
865
828
|
|
866
|
-
|
867
|
-
|
829
|
+
The following functions are provided: `hsl`, `percentage`, `round`, `ceil`, `floor`, and `abs`.
|
830
|
+
You can define additional functions in ruby.
|
868
831
|
|
869
|
-
|
832
|
+
See {Sass::Script::Functions} for more information.
|
833
|
+
|
834
|
+
### Interpolation: `#{}`
|
870
835
|
|
871
836
|
You can also use SassScript variables in selectors
|
872
837
|
and property names using #{} interpolation syntax:
|
873
838
|
|
874
|
-
|
875
|
-
|
876
|
-
p.#{
|
839
|
+
!name = foo
|
840
|
+
!attr = border
|
841
|
+
p.#{!name}
|
842
|
+
#{!attr}-color: blue
|
877
843
|
|
878
844
|
is compiled to:
|
879
845
|
|
880
846
|
p.foo {
|
881
847
|
border-color: blue; }
|
882
848
|
|
883
|
-
|
884
|
-
In most cases this isn't any better than using a variable,
|
885
|
-
but using `#{}` does mean that any operations near it
|
886
|
-
will be treated as plain CSS.
|
887
|
-
For example:
|
888
|
-
|
889
|
-
p {
|
890
|
-
$font-size: 12px;
|
891
|
-
$line-height: 30px;
|
892
|
-
font: #{$font-size}/#{$line-height};
|
893
|
-
}
|
894
|
-
|
895
|
-
is compiled to:
|
896
|
-
|
897
|
-
p {
|
898
|
-
font: 12px/30px;
|
899
|
-
}
|
900
|
-
|
901
|
-
### Variable Defaults: `!default`
|
849
|
+
### Optional Assignment: `||=`
|
902
850
|
|
903
851
|
You can assign to variables if they aren't already assigned
|
904
|
-
|
905
|
-
|
906
|
-
it won't be re-assigned,
|
852
|
+
using the `||=` assignment operator. This means that if the
|
853
|
+
variable has already been assigned to, it won't be re-assigned,
|
907
854
|
but if it doesn't have a value yet, it will be given one.
|
908
855
|
|
909
856
|
For example:
|
910
857
|
|
911
|
-
|
912
|
-
|
913
|
-
|
858
|
+
!content = "First content"
|
859
|
+
!content ||= "Second content?"
|
860
|
+
!new_content ||= "First time reference"
|
914
861
|
|
915
|
-
#main
|
916
|
-
content
|
917
|
-
new-content
|
918
|
-
}
|
862
|
+
#main
|
863
|
+
content = !content
|
864
|
+
new-content = !new_content
|
919
865
|
|
920
866
|
is compiled to:
|
921
867
|
|
922
868
|
#main {
|
923
|
-
content:
|
924
|
-
new-content:
|
925
|
-
|
926
|
-
## `@`-Rules and Directives {#directives}
|
927
|
-
|
928
|
-
Sass supports all CSS3 `@`-rules,
|
929
|
-
as well as some additional Sass-specific ones
|
930
|
-
known as "directives."
|
931
|
-
These have various effects in Sass, detailed below.
|
932
|
-
See also [control directives](#control-directives)
|
933
|
-
and [mixin directives](#mixins).
|
934
|
-
|
935
|
-
### `@import` {#import}
|
936
|
-
|
937
|
-
Sass extends the CSS `@import` rule
|
938
|
-
to allow it to import SCSS and Sass files.
|
939
|
-
All imported SCSS and Sass files will be merged together
|
940
|
-
into a single CSS output file.
|
941
|
-
In addition, any variables or [mixins](#mixins)
|
942
|
-
defined in imported files can be used in the main file.
|
943
|
-
|
944
|
-
Sass looks for other Sass files in the current directory,
|
945
|
-
and the Sass file directory under Rack, Rails, or Merb.
|
946
|
-
Additional search directories may be specified
|
947
|
-
using the [`:load_paths`](#load_paths-option) option,
|
948
|
-
or the `--load-path` option on the command line.
|
949
|
-
|
950
|
-
`@import` takes a filename to import.
|
951
|
-
By default, it looks for a Sass file to import directly,
|
952
|
-
but there are a few circumstances under which it will compile to a CSS `@import` rule:
|
953
|
-
|
954
|
-
* If the file's extension is `.css`.
|
955
|
-
* If the filename begins with `http://`.
|
956
|
-
* If the filename is a `url()`.
|
957
|
-
* If the `@import` has any media queries.
|
958
|
-
|
959
|
-
If none of the above conditions are met
|
960
|
-
and the extension is `.scss` or `.sass`,
|
961
|
-
then the named Sass or SCSS file will be imported.
|
962
|
-
If there is no extension,
|
963
|
-
Sass will try to find a file with that name and the `.scss` or `.sass` extension
|
964
|
-
and import it.
|
965
|
-
|
966
|
-
For example,
|
967
|
-
|
968
|
-
@import "foo.scss";
|
969
|
-
|
970
|
-
or
|
971
|
-
|
972
|
-
@import "foo";
|
973
|
-
|
974
|
-
would both import the file `foo.scss`,
|
975
|
-
whereas
|
976
|
-
|
977
|
-
@import "foo.css";
|
978
|
-
@import "foo" screen;
|
979
|
-
@import "http://foo.com/bar";
|
980
|
-
@import url(foo);
|
981
|
-
|
982
|
-
would all compile to
|
983
|
-
|
984
|
-
@import "foo.css";
|
985
|
-
@import "foo" screen;
|
986
|
-
@import "http://foo.com/bar";
|
987
|
-
@import url(foo);
|
988
|
-
|
989
|
-
It's also possible to import multiple files in one `@import`. For example:
|
990
|
-
|
991
|
-
@import "rounded-corners", "text-shadow";
|
992
|
-
|
993
|
-
would import both the `rounded-corners` and the `text-shadow` files.
|
994
|
-
|
995
|
-
#### Partials {#partials}
|
996
|
-
|
997
|
-
If you have a SCSS or Sass file that you want to import
|
998
|
-
but don't want to compile to a CSS file,
|
999
|
-
you can add an underscore to the beginning of the filename.
|
1000
|
-
This will tell Sass not to compile it to a normal CSS file.
|
1001
|
-
You can then import these files without using the underscore.
|
1002
|
-
|
1003
|
-
For example, you might have `_colors.scss`.
|
1004
|
-
Then no `_colors.css` file would be created,
|
1005
|
-
and you can do
|
1006
|
-
|
1007
|
-
@import "colors";
|
1008
|
-
|
1009
|
-
and `_colors.scss` would be imported.
|
1010
|
-
|
1011
|
-
### `@extend` {#extend}
|
1012
|
-
|
1013
|
-
There are often cases when designing a page
|
1014
|
-
when one class should have all the styles of another class,
|
1015
|
-
as well as its own specific styles.
|
1016
|
-
The most common way of handling this is to use both the more general class
|
1017
|
-
and the more specific class in the HTML.
|
1018
|
-
For example, suppose we have a design for a normal error
|
1019
|
-
and also for a serious error. We might write our markup like so:
|
1020
|
-
|
1021
|
-
<div class="error seriousError">
|
1022
|
-
Oh no! You've been hacked!
|
1023
|
-
</div>
|
1024
|
-
|
1025
|
-
And our styles like so:
|
1026
|
-
|
1027
|
-
.error {
|
1028
|
-
border: 1px #f00;
|
1029
|
-
background-color: #fdd;
|
1030
|
-
}
|
1031
|
-
.seriousError {
|
1032
|
-
border-width: 3px;
|
1033
|
-
}
|
1034
|
-
|
1035
|
-
Unfortunately, this means that we have to always remember
|
1036
|
-
to use `.error` with `.seriousError`.
|
1037
|
-
This is a maintenance burden, leads to tricky bugs,
|
1038
|
-
and can bring non-semantic style concerns into the markup.
|
1039
|
-
|
1040
|
-
The `@extend` directive avoids these problems
|
1041
|
-
by telling Sass that one selector should inherit the styles of another selector.
|
1042
|
-
For example:
|
1043
|
-
|
1044
|
-
.error {
|
1045
|
-
border: 1px #f00;
|
1046
|
-
background-color: #fdd;
|
1047
|
-
}
|
1048
|
-
.seriousError {
|
1049
|
-
@extend .error;
|
1050
|
-
border-width: 3px;
|
1051
|
-
}
|
1052
|
-
|
1053
|
-
This means that all styles defined for `.error`
|
1054
|
-
are also applied to `.seriousError`,
|
1055
|
-
in addition to the styles specific to `.seriousError`.
|
1056
|
-
In effect, everything with class `.seriousError` also has class `.error`.
|
1057
|
-
|
1058
|
-
Other rules that use `.error` will work for `.seriousError` as well.
|
1059
|
-
For example, if we have special styles for errors caused by hackers:
|
1060
|
-
|
1061
|
-
.error.intrusion {
|
1062
|
-
background-image: url("/image/hacked.png");
|
1063
|
-
}
|
1064
|
-
|
1065
|
-
Then `<div class="seriousError intrusion">`
|
1066
|
-
will have the `hacked.png` background image as well.
|
1067
|
-
|
1068
|
-
#### How it Works
|
1069
|
-
|
1070
|
-
`@extend` works by inserting the extending selector (e.g. `.seriousError`)
|
1071
|
-
anywhere in the stylesheet that the extended selector (.e.g `.error`) appears.
|
1072
|
-
Thus the example above:
|
1073
|
-
|
1074
|
-
.error {
|
1075
|
-
border: 1px #f00;
|
1076
|
-
background-color: #fdd;
|
1077
|
-
}
|
1078
|
-
.error.intrusion {
|
1079
|
-
background-image: url("/image/hacked.png");
|
1080
|
-
}
|
1081
|
-
.seriousError {
|
1082
|
-
@extend .error;
|
1083
|
-
border-width: 3px;
|
1084
|
-
}
|
1085
|
-
|
1086
|
-
is compiled to:
|
1087
|
-
|
1088
|
-
.error, .seriousError {
|
1089
|
-
border: 1px #f00;
|
1090
|
-
background-color: #fdd; }
|
1091
|
-
|
1092
|
-
.error.intrusion, .seriousError.intrusion {
|
1093
|
-
background-image: url("/image/hacked.png"); }
|
1094
|
-
|
1095
|
-
.seriousError {
|
1096
|
-
border-width: 3px; }
|
1097
|
-
|
1098
|
-
When merging selectors, `@extend` is smart enough
|
1099
|
-
to avoid unnecessary duplication,
|
1100
|
-
so something like `.seriousError.seriousError` gets translated to `.seriousError`.
|
1101
|
-
In addition, it won't produce selectors that can't match anything, like `#main#footer`.
|
1102
|
-
|
1103
|
-
#### Extending Complex Selectors
|
1104
|
-
|
1105
|
-
Class selectors aren't the only things that can be extended.
|
1106
|
-
It's possible to extend any selector involving only a single element,
|
1107
|
-
such as `.special.cool`, `a:hover`, or `a.user[href^="http://"]`.
|
1108
|
-
For example:
|
1109
|
-
|
1110
|
-
.hoverlink {@extend a:hover}
|
1111
|
-
|
1112
|
-
Just like with classes, this means that all styles defined for `a:hover`
|
1113
|
-
are also applied to `.hoverlink`.
|
1114
|
-
For example:
|
1115
|
-
|
1116
|
-
.hoverlink {@extend a:hover}
|
1117
|
-
a:hover {text-decoration: underline}
|
1118
|
-
|
1119
|
-
is compiled to:
|
1120
|
-
|
1121
|
-
a:hover, .hoverlink {text-decoration: underline}
|
1122
|
-
|
1123
|
-
Just like with `.error.intrusion` above,
|
1124
|
-
any rule that uses `a:hover` will also work for `.hoverlink`,
|
1125
|
-
even if they have other selectors as well.
|
1126
|
-
For example:
|
1127
|
-
|
1128
|
-
.hoverlink {@extend a:hover}
|
1129
|
-
.comment a.user:hover {font-weight: bold}
|
1130
|
-
|
1131
|
-
is compiled to:
|
1132
|
-
|
1133
|
-
.comment a.user:hover, .comment .hoverlink.user {font-weight: bold}
|
1134
|
-
|
1135
|
-
#### Multiple Extends
|
1136
|
-
|
1137
|
-
A single selector can extend more than one selector.
|
1138
|
-
This means that it inherits the styles of all the extended selectors.
|
1139
|
-
For example:
|
1140
|
-
|
1141
|
-
.error {
|
1142
|
-
border: 1px #f00;
|
1143
|
-
background-color: #fdd;
|
1144
|
-
}
|
1145
|
-
.attention {
|
1146
|
-
font-size: 3em;
|
1147
|
-
background-color: #ff0;
|
1148
|
-
}
|
1149
|
-
.seriousError {
|
1150
|
-
@extend .error;
|
1151
|
-
@extend .attention;
|
1152
|
-
border-width: 3px;
|
1153
|
-
}
|
1154
|
-
|
1155
|
-
is compiled to:
|
1156
|
-
|
1157
|
-
.error, .seriousError {
|
1158
|
-
border: 1px #f00;
|
1159
|
-
background-color: #fdd; }
|
1160
|
-
|
1161
|
-
.attention, .seriousError {
|
1162
|
-
font-size: 3em;
|
1163
|
-
background-color: #ff0; }
|
1164
|
-
|
1165
|
-
.seriousError {
|
1166
|
-
border-width: 3px; }
|
1167
|
-
|
1168
|
-
In effect, everything with class `.seriousError`
|
1169
|
-
also has class `.error` *and* class `.attention`.
|
1170
|
-
Thus, the styles defined later in the document take precedence:
|
1171
|
-
`.seriousError` has background color `#ff0` rather than `#fdd`,
|
1172
|
-
since `.attention` is defined later than `.error`.
|
1173
|
-
|
1174
|
-
#### Chaining Extends
|
1175
|
-
|
1176
|
-
It's possible for one selector to extend another selector
|
1177
|
-
that in turn extends a third.
|
1178
|
-
For example:
|
869
|
+
content: First content;
|
870
|
+
new-content: First time reference; }
|
1179
871
|
|
1180
|
-
|
1181
|
-
border: 1px #f00;
|
1182
|
-
background-color: #fdd;
|
1183
|
-
}
|
1184
|
-
.seriousError {
|
1185
|
-
@extend .error;
|
1186
|
-
border-width: 3px;
|
1187
|
-
}
|
1188
|
-
.criticalError {
|
1189
|
-
@extend .seriousError;
|
1190
|
-
position: fixed;
|
1191
|
-
top: 10%;
|
1192
|
-
bottom: 10%;
|
1193
|
-
left: 10%;
|
1194
|
-
right: 10%;
|
1195
|
-
}
|
872
|
+
## Mixins
|
1196
873
|
|
1197
|
-
|
1198
|
-
|
1199
|
-
|
1200
|
-
|
874
|
+
Mixins enable you to define groups of CSS properties and
|
875
|
+
then include them inline in any number of selectors
|
876
|
+
throughout the document. This allows you to keep your
|
877
|
+
stylesheets DRY and also avoid placing presentation
|
878
|
+
classes in your markup.
|
1201
879
|
|
1202
|
-
|
1203
|
-
border: 1px #f00;
|
1204
|
-
background-color: #fdd; }
|
880
|
+
### Defining a Mixin: `=`
|
1205
881
|
|
1206
|
-
|
1207
|
-
|
882
|
+
To define a mixin you use a slightly modified form of selector syntax.
|
883
|
+
For example the `large-text` mixin is defined as follows:
|
1208
884
|
|
1209
|
-
|
1210
|
-
|
1211
|
-
|
1212
|
-
|
1213
|
-
|
1214
|
-
|
885
|
+
=large-text
|
886
|
+
font:
|
887
|
+
family: Arial
|
888
|
+
size: 20px
|
889
|
+
weight: bold
|
890
|
+
color: #ff0000
|
1215
891
|
|
1216
|
-
|
1217
|
-
|
1218
|
-
|
1219
|
-
|
892
|
+
The initial `=` marks this as a mixin rather than a standard selector.
|
893
|
+
The CSS rules that follow won't be included until the mixin is referenced later on.
|
894
|
+
Anything you can put into a standard selector,
|
895
|
+
you can put into a mixin definition.
|
1220
896
|
For example:
|
1221
897
|
|
1222
|
-
|
1223
|
-
|
1224
|
-
|
1225
|
-
|
1226
|
-
|
1227
|
-
|
1228
|
-
|
1229
|
-
|
1230
|
-
|
1231
|
-
|
1232
|
-
color: blue; }
|
1233
|
-
a:hover, #fake-links .link:hover {
|
1234
|
-
text-decoration: underline; }
|
1235
|
-
|
1236
|
-
##### Merging Selector Sequences
|
1237
|
-
|
1238
|
-
Sometimes a selector sequence extends another selector that appears in another sequence.
|
1239
|
-
In this case, the two sequences need to be merged.
|
1240
|
-
For example:
|
1241
|
-
|
1242
|
-
#admin .tabbar a {font-weight: bold}
|
1243
|
-
#demo .overview .fakelink {@extend a}
|
1244
|
-
|
1245
|
-
While it would technically be possible
|
1246
|
-
to generate all selectors that could possibly match either sequence,
|
1247
|
-
this would make the stylesheet far too large.
|
1248
|
-
The simple example above, for instance, would require ten selectors.
|
1249
|
-
Instead, Sass generates only selectors that are likely to be useful.
|
1250
|
-
|
1251
|
-
When the two sequences being merged have no selectors in common,
|
1252
|
-
then two new selectors are generated:
|
1253
|
-
one with the first sequence before the second,
|
1254
|
-
and one with the second sequence before the first.
|
1255
|
-
For example:
|
1256
|
-
|
1257
|
-
#admin .tabbar a {font-weight: bold}
|
1258
|
-
#demo .overview .fakelink {@extend a}
|
1259
|
-
|
1260
|
-
is compiled to:
|
898
|
+
=clearfix
|
899
|
+
display: inline-block
|
900
|
+
&:after
|
901
|
+
content: "."
|
902
|
+
display: block
|
903
|
+
height: 0
|
904
|
+
clear: both
|
905
|
+
visibility: hidden
|
906
|
+
* html &
|
907
|
+
height: 1px
|
1261
908
|
|
1262
|
-
|
1263
|
-
#admin .tabbar #demo .overview .fakelink,
|
1264
|
-
#demo .overview #admin .tabbar .fakelink {
|
1265
|
-
font-weight: bold; }
|
909
|
+
### Mixing It In: `+`
|
1266
910
|
|
1267
|
-
|
1268
|
-
|
1269
|
-
|
1270
|
-
|
1271
|
-
so the resulting selectors will merge those two ids:
|
911
|
+
Inlining a defined mixin is simple,
|
912
|
+
just prepend a `+` symbol to the name of a mixin defined earlier in the document.
|
913
|
+
So to inline the `large-text` defined earlier,
|
914
|
+
we include the statment `+large-text` in our selector definition thus:
|
1272
915
|
|
1273
|
-
|
1274
|
-
|
916
|
+
.page-title
|
917
|
+
+large-text
|
918
|
+
padding: 4px
|
919
|
+
margin:
|
920
|
+
top: 10px
|
1275
921
|
|
1276
|
-
This
|
922
|
+
This will produce the following CSS output:
|
1277
923
|
|
1278
|
-
|
1279
|
-
|
1280
|
-
|
1281
|
-
font-weight: bold;
|
924
|
+
.page-title {
|
925
|
+
font-family: Arial;
|
926
|
+
font-size: 20px;
|
927
|
+
font-weight: bold;
|
928
|
+
color: #ff0000;
|
929
|
+
padding: 4px;
|
930
|
+
margin-top: 10px; }
|
1282
931
|
|
1283
|
-
|
932
|
+
Any number of mixins may be defined and there is no limit on
|
933
|
+
the number that can be included in a particular selector.
|
1284
934
|
|
1285
|
-
|
1286
|
-
to the standard error output stream.
|
1287
|
-
It's useful for debugging Sass files
|
1288
|
-
that have complicated SassScript going on.
|
935
|
+
Mixin definitions can also include references to other mixins.
|
1289
936
|
For example:
|
1290
937
|
|
1291
|
-
|
938
|
+
=compound
|
939
|
+
+highlighted-background
|
940
|
+
+header-text
|
1292
941
|
|
1293
|
-
|
1294
|
-
|
1295
|
-
|
1296
|
-
|
1297
|
-
|
1298
|
-
|
1299
|
-
The `@warn` directive prints the value of a SassScript expression
|
1300
|
-
to the standard error output stream.
|
1301
|
-
It's useful for libraries that need to warn users of deprecations
|
1302
|
-
or recovering from minor mixin usage mistakes.
|
1303
|
-
There are two major distinctions between `@warn` and `@debug`:
|
1304
|
-
|
1305
|
-
1. You can turn warnings off with the `--quiet` command-line option
|
1306
|
-
or the `:quiet` Sass option.
|
1307
|
-
2. A stylesheet trace will be printed out along with the message
|
1308
|
-
so that the user being warned can see where their styles caused the warning.
|
1309
|
-
|
1310
|
-
Usage Example:
|
1311
|
-
|
1312
|
-
@mixin adjust-location($x, $y) {
|
1313
|
-
@if unitless($x) {
|
1314
|
-
@warn "Assuming #{$x} to be in pixels";
|
1315
|
-
$x: 1px * $x;
|
1316
|
-
}
|
1317
|
-
@if unitless($y) {
|
1318
|
-
@warn "Assuming #{$y} to be in pixels";
|
1319
|
-
$y: 1px * $y;
|
1320
|
-
}
|
1321
|
-
position: relative; left: $x; top: $y;
|
1322
|
-
}
|
942
|
+
=highlighted-background
|
943
|
+
background:
|
944
|
+
color: #fc0
|
945
|
+
=header-text
|
946
|
+
font:
|
947
|
+
size: 20px
|
1323
948
|
|
1324
|
-
|
1325
|
-
|
1326
|
-
SassScript supports basic control directives
|
1327
|
-
for including styles only under some conditions
|
1328
|
-
or including the same style several times with variations.
|
1329
|
-
|
1330
|
-
**Note that control directives are an advanced feature,
|
1331
|
-
and are not recommended in the course of day-to-day styling**.
|
1332
|
-
They exist mainly for use in [mixins](#mixins),
|
1333
|
-
particularly those that are part of libraries like [Compass](http://compass-style.org),
|
1334
|
-
and so require substantial flexibility.
|
949
|
+
Mixins that only define descendent selectors, can be safely mixed
|
950
|
+
into the top most level of a document.
|
1335
951
|
|
1336
|
-
###
|
952
|
+
### Arguments
|
1337
953
|
|
1338
|
-
|
1339
|
-
and uses the styles nested beneath it if the expression returns
|
1340
|
-
anything other than `false`:
|
954
|
+
Mixins can take arguments which can be used with SassScript:
|
1341
955
|
|
1342
|
-
|
1343
|
-
|
1344
|
-
|
1345
|
-
|
956
|
+
=sexy-border(!color)
|
957
|
+
border:
|
958
|
+
color = !color
|
959
|
+
width: 1in
|
960
|
+
style: dashed
|
961
|
+
p
|
962
|
+
+sexy-border("blue")
|
1346
963
|
|
1347
964
|
is compiled to:
|
1348
965
|
|
1349
966
|
p {
|
1350
|
-
border:
|
967
|
+
border-color: #0000ff;
|
968
|
+
border-width: 1in;
|
969
|
+
border-style: dashed; }
|
1351
970
|
|
1352
|
-
|
1353
|
-
and one `@else` statement.
|
1354
|
-
If the `@if` statement fails,
|
1355
|
-
the `@else if` statements are tried in order
|
1356
|
-
until one succeeds or the `@else` is reached.
|
1357
|
-
For example:
|
971
|
+
Mixins can also specify default values for their arguments:
|
1358
972
|
|
1359
|
-
|
1360
|
-
|
1361
|
-
|
1362
|
-
|
1363
|
-
|
1364
|
-
|
1365
|
-
|
1366
|
-
color: green;
|
1367
|
-
} @else {
|
1368
|
-
color: black;
|
1369
|
-
}
|
1370
|
-
}
|
973
|
+
=sexy-border(!color, !width = 1in)
|
974
|
+
border:
|
975
|
+
color = !color
|
976
|
+
width = !width
|
977
|
+
style: dashed
|
978
|
+
p
|
979
|
+
+sexy-border("blue")
|
1371
980
|
|
1372
981
|
is compiled to:
|
1373
982
|
|
1374
983
|
p {
|
1375
|
-
color:
|
1376
|
-
|
1377
|
-
|
1378
|
-
|
1379
|
-
The `@for` directive has two forms:
|
1380
|
-
`@for $var from <start> to <end>` or
|
1381
|
-
`@for $var from <start> through <end>`.
|
1382
|
-
`$var` can be any variable name, like `$i`,
|
1383
|
-
and `<start>` and `<end>` are SassScript expressions
|
1384
|
-
that should return integers.
|
1385
|
-
|
1386
|
-
The `@for` statement sets `$var` to each number
|
1387
|
-
from `<start>` to `<end>`,
|
1388
|
-
including `<end>` if `through` is used.
|
1389
|
-
Then it outputs the nested styles
|
1390
|
-
using that value of `$var`.
|
1391
|
-
For example:
|
1392
|
-
|
1393
|
-
@for $i from 1 through 3 {
|
1394
|
-
.item-#{$i} { width: 2em * $i; }
|
1395
|
-
}
|
1396
|
-
|
1397
|
-
is compiled to:
|
1398
|
-
|
1399
|
-
.item-1 {
|
1400
|
-
width: 2em; }
|
1401
|
-
.item-2 {
|
1402
|
-
width: 4em; }
|
1403
|
-
.item-3 {
|
1404
|
-
width: 6em; }
|
1405
|
-
|
1406
|
-
### `@while`
|
1407
|
-
|
1408
|
-
The `@while` directive takes a SassScript expression
|
1409
|
-
and repeatedly outputs the nested styles
|
1410
|
-
until the statement evaluates to `false`.
|
1411
|
-
This can be used to achieve more complex looping
|
1412
|
-
than the `@for` statement is capable of,
|
1413
|
-
although this is rarely necessary.
|
1414
|
-
For example:
|
1415
|
-
|
1416
|
-
$i: 6;
|
1417
|
-
@while $i > 0 {
|
1418
|
-
.item-#{$i} { width: 2em * $i; }
|
1419
|
-
$i: $i - 2;
|
1420
|
-
}
|
1421
|
-
|
1422
|
-
is compiled to:
|
1423
|
-
|
1424
|
-
.item-6 {
|
1425
|
-
width: 12em; }
|
1426
|
-
|
1427
|
-
.item-4 {
|
1428
|
-
width: 8em; }
|
1429
|
-
|
1430
|
-
.item-2 {
|
1431
|
-
width: 4em; }
|
1432
|
-
|
1433
|
-
## Mixin Directives {#mixins}
|
1434
|
-
|
1435
|
-
Mixins allow you to define styles
|
1436
|
-
that can be re-used throughout the stylesheet
|
1437
|
-
without needing to resort to non-semantic classes like `.float-left`.
|
1438
|
-
Mixins can also contain full CSS rules,
|
1439
|
-
and anything else allowed elsewhere in a Sass document.
|
1440
|
-
They can even take [arguments](#mixin-arguments)
|
1441
|
-
which allows you to produce a wide variety of styles
|
1442
|
-
with very few mixins.
|
1443
|
-
|
1444
|
-
### Defining a Mixin: `@mixin` {#defining_a_mixin}
|
1445
|
-
|
1446
|
-
Mixins are defined with the `@mixin` directive.
|
1447
|
-
It's followed by the name of the mixin
|
1448
|
-
and optionally the [arguments](#mixin-arguments),
|
1449
|
-
and a block containing the contents of the mixin.
|
1450
|
-
For example, the `large-text` mixin is defined as follows:
|
1451
|
-
|
1452
|
-
@mixin large-text {
|
1453
|
-
font: {
|
1454
|
-
family: Arial;
|
1455
|
-
size: 20px;
|
1456
|
-
weight: bold;
|
1457
|
-
}
|
1458
|
-
color: #ff0000;
|
1459
|
-
}
|
1460
|
-
|
1461
|
-
Mixins may also contain selectors,
|
1462
|
-
possibly mixed with properties.
|
1463
|
-
The selectors can even contain [parent references](#referencing_parent_selectors_).
|
1464
|
-
For example:
|
1465
|
-
|
1466
|
-
@mixin clearfix {
|
1467
|
-
display: inline-block;
|
1468
|
-
&:after {
|
1469
|
-
content: ".";
|
1470
|
-
display: block;
|
1471
|
-
height: 0;
|
1472
|
-
clear: both;
|
1473
|
-
visibility: hidden;
|
1474
|
-
}
|
1475
|
-
* html & { height: 1px }
|
1476
|
-
}
|
1477
|
-
|
1478
|
-
### Including a Mixin: `@include` {#including_a_mixin}
|
1479
|
-
|
1480
|
-
Mixins are included in the document
|
1481
|
-
with the `@include` directive.
|
1482
|
-
This takes the name of a mixin
|
1483
|
-
and optionally [arguments to pass to it](#mixin-arguments),
|
1484
|
-
and includes the styles defined by that mixin
|
1485
|
-
into the current rule.
|
1486
|
-
For example:
|
1487
|
-
|
1488
|
-
.page-title {
|
1489
|
-
@include large-text;
|
1490
|
-
padding: 4px;
|
1491
|
-
margin-top: 10px;
|
1492
|
-
}
|
1493
|
-
|
1494
|
-
is compiled to:
|
1495
|
-
|
1496
|
-
.page-title {
|
1497
|
-
font-family: Arial;
|
1498
|
-
font-size: 20px;
|
1499
|
-
font-weight: bold;
|
1500
|
-
color: #ff0000;
|
1501
|
-
padding: 4px;
|
1502
|
-
margin-top: 10px; }
|
1503
|
-
|
1504
|
-
Mixins may also be included outside of any rule
|
1505
|
-
(that is, at the root of the document)
|
1506
|
-
as long as they don't directly define any properties
|
1507
|
-
or use any parent references.
|
1508
|
-
For example:
|
984
|
+
border-color: #0000ff;
|
985
|
+
border-width: 1in;
|
986
|
+
border-style: dashed; }
|
1509
987
|
|
1510
|
-
|
1511
|
-
a {
|
1512
|
-
color: blue;
|
1513
|
-
background-color: red;
|
1514
|
-
}
|
1515
|
-
}
|
988
|
+
## Comments
|
1516
989
|
|
1517
|
-
|
990
|
+
Sass supports two sorts of comments:
|
991
|
+
those that show up in the CSS output
|
992
|
+
and those that don't.
|
1518
993
|
|
1519
|
-
|
994
|
+
### CSS Comments: `/*`
|
1520
995
|
|
1521
|
-
|
1522
|
-
|
1523
|
-
|
1524
|
-
|
1525
|
-
Mixin definitions can also include other mixins.
|
996
|
+
"Loud" comments are just as easy as silent ones.
|
997
|
+
These comments output to the document as CSS comments,
|
998
|
+
and thus use the same opening sequence: `/*`.
|
1526
999
|
For example:
|
1527
1000
|
|
1528
|
-
|
1529
|
-
|
1530
|
-
|
1531
|
-
|
1532
|
-
|
1533
|
-
|
1534
|
-
|
1535
|
-
|
1536
|
-
|
1537
|
-
|
1538
|
-
|
1539
|
-
|
1540
|
-
|
1541
|
-
|
1542
|
-
|
1543
|
-
|
1544
|
-
|
1545
|
-
|
1546
|
-
|
1547
|
-
|
1548
|
-
|
1549
|
-
|
1001
|
+
/* A very awesome rule.
|
1002
|
+
#awesome.rule
|
1003
|
+
/* An equally awesome property.
|
1004
|
+
awesomeness: very
|
1005
|
+
|
1006
|
+
becomes
|
1007
|
+
|
1008
|
+
/* A very awesome rule. */
|
1009
|
+
#awesome.rule {
|
1010
|
+
/* An equally awesome property. */
|
1011
|
+
awesomeness: very; }
|
1012
|
+
|
1013
|
+
You can also nest content beneath loud comments. For example:
|
1014
|
+
|
1015
|
+
#pbj
|
1016
|
+
/* This rule describes
|
1017
|
+
the styling of the element
|
1018
|
+
that represents
|
1019
|
+
a peanut butter and jelly sandwich.
|
1020
|
+
background-image: url(/images/pbj.png)
|
1021
|
+
color: red
|
1022
|
+
|
1023
|
+
becomes
|
1024
|
+
|
1025
|
+
#pbj {
|
1026
|
+
/* This rule describes
|
1027
|
+
* the styling of the element
|
1028
|
+
* that represents
|
1029
|
+
* a peanut butter and jelly sandwich. */
|
1030
|
+
background-image: url(/images/pbj.png);
|
1031
|
+
color: red; }
|
1032
|
+
|
1033
|
+
### Sass Comments: `//`
|
1034
|
+
|
1035
|
+
It's simple to add "silent" comments,
|
1036
|
+
which don't output anything to the CSS document,
|
1037
|
+
to a Sass document.
|
1038
|
+
Simply use the familiar C-style notation for a one-line comment, `//`,
|
1039
|
+
at the normal indentation level and all text following it won't be output.
|
1550
1040
|
For example:
|
1551
1041
|
|
1552
|
-
|
1553
|
-
|
1554
|
-
|
1555
|
-
|
1556
|
-
style: dashed;
|
1557
|
-
}
|
1558
|
-
}
|
1559
|
-
|
1560
|
-
p { @include sexy-border(blue, 1in); }
|
1042
|
+
// A very awesome rule.
|
1043
|
+
#awesome.rule
|
1044
|
+
// An equally awesome property.
|
1045
|
+
awesomeness: very
|
1561
1046
|
|
1562
|
-
|
1047
|
+
becomes
|
1563
1048
|
|
1564
|
-
|
1565
|
-
|
1566
|
-
border-width: 1in;
|
1567
|
-
border-style: dashed; }
|
1049
|
+
#awesome.rule {
|
1050
|
+
awesomeness: very; }
|
1568
1051
|
|
1569
|
-
|
1570
|
-
using the normal variable-setting syntax.
|
1571
|
-
Then when the mixin is included,
|
1572
|
-
if it doesn't pass in that argument,
|
1573
|
-
the default value will be used instead.
|
1052
|
+
You can also nest text beneath a comment to comment out a whole block.
|
1574
1053
|
For example:
|
1575
1054
|
|
1576
|
-
|
1577
|
-
|
1578
|
-
|
1579
|
-
|
1580
|
-
|
1581
|
-
|
1582
|
-
}
|
1583
|
-
p { @include sexy-border(blue); }
|
1584
|
-
h1 { @include sexy-border(blue, 2in); }
|
1055
|
+
// A very awesome rule
|
1056
|
+
#awesome.rule
|
1057
|
+
// Don't use these properties
|
1058
|
+
color: green
|
1059
|
+
font-size: 10em
|
1060
|
+
color: red
|
1585
1061
|
|
1586
|
-
|
1062
|
+
becomes
|
1587
1063
|
|
1588
|
-
|
1589
|
-
|
1590
|
-
border-width: 1in;
|
1591
|
-
border-style: dashed; }
|
1592
|
-
|
1593
|
-
h1 {
|
1594
|
-
border-color: blue;
|
1595
|
-
border-width: 2in;
|
1596
|
-
border-style: dashed; }
|
1064
|
+
#awesome.rule {
|
1065
|
+
color: red; }
|
1597
1066
|
|
1598
1067
|
## Output Style
|
1599
1068
|
|
1600
|
-
Although the default CSS style that Sass outputs is very nice
|
1601
|
-
and reflects the structure of the document,
|
1602
|
-
|
1069
|
+
Although the default CSS style that Sass outputs is very nice,
|
1070
|
+
and reflects the structure of the document in a similar way that Sass does,
|
1071
|
+
sometimes it's good to have other formats available.
|
1603
1072
|
|
1604
1073
|
Sass allows you to choose between four different output styles
|
1605
|
-
by setting the
|
1606
|
-
|
1074
|
+
by setting the `:style` option.
|
1075
|
+
In Rack, Rails, and Merb, this is done by setting `Sass::Plugin.options[:style]`;
|
1076
|
+
otherwise, it's done by passing an options hash with `:style` set.
|
1607
1077
|
|
1608
1078
|
### `:nested`
|
1609
1079
|
|
1610
1080
|
Nested style is the default Sass style,
|
1611
|
-
because it reflects the structure of the
|
1612
|
-
|
1081
|
+
because it reflects the structure of the document
|
1082
|
+
in much the same way Sass does.
|
1613
1083
|
Each property has its own line,
|
1614
1084
|
but the indentation isn't constant.
|
1615
1085
|
Each rule is indented based on how deeply it's nested.
|
@@ -1626,13 +1096,14 @@ For example:
|
|
1626
1096
|
font-weight: bold;
|
1627
1097
|
text-decoration: underline; }
|
1628
1098
|
|
1629
|
-
Nested style is very useful when looking at large CSS files
|
1630
|
-
|
1099
|
+
Nested style is very useful when looking at large CSS files
|
1100
|
+
for the same reason Sass is useful for making them:
|
1101
|
+
it allows you to very easily grasp the structure of the file
|
1631
1102
|
without actually reading anything.
|
1632
1103
|
|
1633
1104
|
### `:expanded`
|
1634
1105
|
|
1635
|
-
Expanded is
|
1106
|
+
Expanded is the typical human-made CSS style,
|
1636
1107
|
with each property and rule taking up one line.
|
1637
1108
|
Properties are indented within the rules,
|
1638
1109
|
but the rules aren't indented in any special way.
|
@@ -1654,12 +1125,13 @@ For example:
|
|
1654
1125
|
|
1655
1126
|
### `:compact`
|
1656
1127
|
|
1657
|
-
Compact style
|
1658
|
-
|
1128
|
+
Compact style, as the name would imply,
|
1129
|
+
takes up less space than Nested or Expanded.
|
1130
|
+
However, it's also harder to read.
|
1659
1131
|
Each CSS rule takes up only one line,
|
1660
1132
|
with every property defined on that line.
|
1661
1133
|
Nested rules are placed next to each other with no newline,
|
1662
|
-
while
|
1134
|
+
while groups of rules have newlines between them.
|
1663
1135
|
For example:
|
1664
1136
|
|
1665
1137
|
#main { color: #fff; background-color: #000; }
|
@@ -1672,8 +1144,6 @@ For example:
|
|
1672
1144
|
Compressed style takes up the minimum amount of space possible,
|
1673
1145
|
having no whitespace except that necessary to separate selectors
|
1674
1146
|
and a newline at the end of the file.
|
1675
|
-
It also includes some other minor compressions,
|
1676
|
-
such as choosing the smallest representation for colors.
|
1677
1147
|
It's not meant to be human-readable.
|
1678
1148
|
For example:
|
1679
1149
|
|