compass 0.13.alpha.0 → 0.13.alpha.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +6 -4
- data/Rakefile +9 -0
- data/VERSION.yml +2 -2
- data/bin/compass +2 -1
- data/features/command_line.feature +5 -27
- data/features/step_definitions/command_line_steps.rb +3 -2
- data/frameworks/compass/stylesheets/compass/_css3.scss +3 -0
- data/frameworks/compass/stylesheets/compass/_support.scss +6 -0
- data/frameworks/compass/stylesheets/compass/css3/_animation.scss +77 -76
- data/frameworks/compass/stylesheets/compass/css3/_appearance.scss +15 -9
- data/frameworks/compass/stylesheets/compass/css3/_background-clip.scss +35 -36
- data/frameworks/compass/stylesheets/compass/css3/_background-origin.scss +36 -34
- data/frameworks/compass/stylesheets/compass/css3/_background-size.scss +15 -15
- data/frameworks/compass/stylesheets/compass/css3/_border-radius.scss +30 -48
- data/frameworks/compass/stylesheets/compass/css3/_box-shadow.scss +22 -27
- data/frameworks/compass/stylesheets/compass/css3/_box-sizing.scss +13 -8
- data/frameworks/compass/stylesheets/compass/css3/_box.scss +60 -82
- data/frameworks/compass/stylesheets/compass/css3/_columns.scss +145 -25
- data/frameworks/compass/stylesheets/compass/css3/_filter.scss +44 -0
- data/frameworks/compass/stylesheets/compass/css3/_hyphenation.scss +77 -0
- data/frameworks/compass/stylesheets/compass/css3/_images.scss +2 -2
- data/frameworks/compass/stylesheets/compass/css3/_inline-block.scss +14 -8
- data/frameworks/compass/stylesheets/compass/css3/_selection.scss +31 -0
- data/frameworks/compass/stylesheets/compass/css3/_shared.scss +207 -21
- data/frameworks/compass/stylesheets/compass/css3/_text-shadow.scss +52 -13
- data/frameworks/compass/stylesheets/compass/css3/_transform.scss +14 -14
- data/frameworks/compass/stylesheets/compass/css3/_transition.scss +127 -60
- data/frameworks/compass/stylesheets/compass/css3/_user-interface.scss +35 -15
- data/frameworks/compass/stylesheets/compass/typography/_units.scss +152 -0
- data/frameworks/compass/stylesheets/compass/typography/_vertical_rhythm.scss +174 -98
- data/frameworks/compass/stylesheets/compass/typography/lists/_horizontal-list.scss +5 -3
- data/frameworks/compass/stylesheets/compass/typography/lists/_inline-list.scss +6 -3
- data/frameworks/compass/stylesheets/compass/typography/text/_ellipsis.scss +1 -1
- data/frameworks/compass/stylesheets/compass/typography/text/_replacement.scss +35 -9
- data/frameworks/compass/stylesheets/compass/utilities/general/_float.scss +7 -3
- data/frameworks/compass/stylesheets/compass/utilities/general/_hacks.scss +2 -2
- data/frameworks/compass/stylesheets/compass/utilities/sprites/_base.scss +25 -10
- data/frameworks/compass/stylesheets/compass/utilities/tables/_borders.scss +14 -9
- data/lib/compass.rb +2 -2
- data/lib/compass/actions.rb +5 -1
- data/lib/compass/commands/project_base.rb +7 -1
- data/lib/compass/commands/update_project.rb +2 -2
- data/lib/compass/commands/watch_project.rb +6 -86
- data/lib/compass/compiler.rb +6 -0
- data/lib/compass/configuration/data.rb +1 -1
- data/lib/compass/configuration/helpers.rb +2 -0
- data/lib/compass/exec/global_options_parser.rb +1 -1
- data/lib/compass/exec/project_options_parser.rb +4 -0
- data/lib/compass/logger.rb +2 -0
- data/lib/compass/sass_extensions/functions/colors.rb +14 -0
- data/lib/compass/sass_extensions/functions/constants.rb +9 -0
- data/lib/compass/sass_extensions/functions/gradient_support.rb +44 -5
- data/lib/compass/sass_extensions/functions/image_size.rb +2 -1
- data/lib/compass/sass_extensions/functions/math.rb +14 -2
- data/lib/compass/sass_extensions/functions/sprites.rb +81 -14
- data/lib/compass/sass_extensions/functions/urls.rb +29 -2
- data/lib/compass/sass_extensions/sprites.rb +2 -0
- data/lib/compass/sass_extensions/sprites/engines/chunky_png_engine.rb +5 -1
- data/lib/compass/sass_extensions/sprites/image.rb +7 -2
- data/lib/compass/sass_extensions/sprites/image_methods.rb +5 -2
- data/lib/compass/sass_extensions/sprites/images.rb +29 -0
- data/lib/compass/sass_extensions/sprites/layout.rb +39 -0
- data/lib/compass/sass_extensions/sprites/layout/diagonal.rb +42 -0
- data/lib/compass/sass_extensions/sprites/layout/horizontal.rb +66 -0
- data/lib/compass/sass_extensions/sprites/layout/smart.rb +33 -0
- data/lib/compass/sass_extensions/sprites/layout/vertical.rb +68 -0
- data/lib/compass/sass_extensions/sprites/layout_methods.rb +9 -115
- data/lib/compass/sass_extensions/sprites/sprite_map.rb +5 -0
- data/lib/compass/sass_extensions/sprites/sprite_methods.rb +9 -5
- data/lib/compass/sprite_importer.rb +3 -3
- data/lib/compass/sprite_importer/content.erb +14 -12
- data/lib/compass/version.rb +2 -1
- data/lib/compass/watcher.rb +11 -0
- data/lib/compass/watcher/compiler.rb +59 -0
- data/lib/compass/watcher/project_watcher.rb +108 -0
- data/lib/compass/watcher/watch.rb +33 -0
- data/test/fixtures/stylesheets/busted_font_urls/config.rb +32 -0
- data/test/fixtures/stylesheets/busted_font_urls/css/screen.css +7 -0
- data/{examples/css3/extensions/fancy-fonts/templates/project/bgrove.ttf → test/fixtures/stylesheets/busted_font_urls/fonts/feed.ttf} +0 -0
- data/test/fixtures/stylesheets/busted_font_urls/fonts/grid.ttf +0 -0
- data/test/fixtures/stylesheets/busted_font_urls/fonts/sub/dk.ttf +0 -0
- data/test/fixtures/stylesheets/busted_font_urls/sass/screen.sass +11 -0
- data/test/fixtures/stylesheets/busted_font_urls/tmp/screen.css +7 -0
- data/test/fixtures/stylesheets/compass/css/animation-with-legacy-ie.css +0 -8
- data/test/fixtures/stylesheets/compass/css/animation.css +0 -8
- data/test/fixtures/stylesheets/compass/css/background-clip.css +5 -0
- data/test/fixtures/stylesheets/compass/css/background-origin.css +15 -0
- data/test/fixtures/stylesheets/compass/css/background-size.css +24 -0
- data/test/fixtures/stylesheets/compass/css/columns.css +81 -9
- data/test/fixtures/stylesheets/compass/css/filters.css +29 -0
- data/test/fixtures/stylesheets/compass/css/gradients.css +30 -27
- data/test/fixtures/stylesheets/compass/css/grid_background.css +7 -14
- data/test/fixtures/stylesheets/compass/css/hyphenation.css +16 -0
- data/test/fixtures/stylesheets/compass/css/lists.css +11 -13
- data/test/fixtures/stylesheets/compass/css/pie.css +0 -3
- data/test/fixtures/stylesheets/compass/css/replacement.css +59 -0
- data/test/fixtures/stylesheets/compass/css/reset.css +1 -1
- data/test/fixtures/stylesheets/compass/css/selection.css +13 -0
- data/test/fixtures/stylesheets/compass/css/sprites.css +250 -250
- data/test/fixtures/stylesheets/compass/css/text_shadow.css +22 -4
- data/test/fixtures/stylesheets/compass/css/transition.css +67 -11
- data/test/fixtures/stylesheets/compass/css/units.css +30 -0
- data/test/fixtures/stylesheets/compass/css/user-interface.css +12 -1
- data/test/fixtures/stylesheets/compass/css/utilities.css +15 -0
- data/test/fixtures/stylesheets/compass/css/vertical_rhythm.css +199 -27
- data/test/fixtures/stylesheets/compass/images/flag-s5b4f509715.png +0 -0
- data/test/fixtures/stylesheets/compass/sass/background-clip.scss +4 -2
- data/test/fixtures/stylesheets/compass/sass/background-origin.scss +10 -0
- data/test/fixtures/stylesheets/compass/sass/background-size.scss +12 -0
- data/test/fixtures/stylesheets/compass/sass/columns.scss +18 -0
- data/test/fixtures/stylesheets/compass/sass/filters.scss +24 -0
- data/test/fixtures/stylesheets/compass/sass/gradients.sass +10 -3
- data/test/fixtures/stylesheets/compass/sass/hyphenation.scss +11 -0
- data/test/fixtures/stylesheets/compass/sass/replacement.scss +22 -0
- data/test/fixtures/stylesheets/compass/sass/selection.scss +13 -0
- data/test/fixtures/stylesheets/compass/sass/text_shadow.scss +6 -1
- data/test/fixtures/stylesheets/compass/sass/transition.scss +11 -0
- data/test/fixtures/stylesheets/compass/sass/units.scss +45 -0
- data/test/fixtures/stylesheets/compass/sass/user-interface.scss +10 -5
- data/test/fixtures/stylesheets/compass/sass/utilities.scss +10 -0
- data/test/fixtures/stylesheets/compass/sass/vertical_rhythm.scss +208 -7
- data/test/fixtures/stylesheets/envtest/tmp/env.css +4 -4
- data/test/fixtures/stylesheets/valid/css/simple.css +4 -0
- data/test/helpers/test_case.rb +8 -1
- data/test/integrations/compass_test.rb +13 -13
- data/test/integrations/sprites_test.rb +173 -8
- data/test/test_helper.rb +4 -0
- data/test/units/command_line_test.rb +0 -2
- data/test/units/regressions_test.rb +35 -0
- data/test/units/sass_extensions_test.rb +23 -11
- data/test/units/sprites/image_test.rb +5 -0
- data/test/units/sprites/images_test.rb +46 -0
- data/test/units/sprites/layout_test.rb +18 -2
- data/test/units/watcher/compiler_test.rb +39 -0
- data/test/units/watcher/project_watcher_test.rb +65 -0
- data/test/units/watcher/watch_test.rb +42 -0
- metadata +83 -317
- data/bin/compass.compiled.rbc +0 -707
- data/examples/compass/images/emblem-a043c4f148.png +0 -0
- data/examples/compass/images/flag-03c3b29b35.png +0 -0
- data/examples/compass/images/flag-21cfbfbfc8.png +0 -0
- data/examples/css3/extensions/fancy-fonts/templates/project/Prociono.otf +0 -0
- data/examples/css3/extensions/fancy-fonts/templates/project/bgrove.otf +0 -0
- data/frameworks/blueprint/stylesheets/_blueprint.scss +0 -37
- data/frameworks/blueprint/stylesheets/blueprint/_buttons.scss +0 -101
- data/frameworks/blueprint/stylesheets/blueprint/_colors.scss +0 -36
- data/frameworks/blueprint/stylesheets/blueprint/_debug.scss +0 -28
- data/frameworks/blueprint/stylesheets/blueprint/_fancy-type.scss +0 -88
- data/frameworks/blueprint/stylesheets/blueprint/_form.scss +0 -66
- data/frameworks/blueprint/stylesheets/blueprint/_grid.scss +0 -258
- data/frameworks/blueprint/stylesheets/blueprint/_ie.scss +0 -111
- data/frameworks/blueprint/stylesheets/blueprint/_interaction.scss +0 -66
- data/frameworks/blueprint/stylesheets/blueprint/_link-icons.scss +0 -37
- data/frameworks/blueprint/stylesheets/blueprint/_liquid.scss +0 -152
- data/frameworks/blueprint/stylesheets/blueprint/_print.scss +0 -86
- data/frameworks/blueprint/stylesheets/blueprint/_reset.scss +0 -3
- data/frameworks/blueprint/stylesheets/blueprint/_rtl.scss +0 -121
- data/frameworks/blueprint/stylesheets/blueprint/_scaffolding.scss +0 -52
- data/frameworks/blueprint/stylesheets/blueprint/_typography.scss +0 -90
- data/frameworks/blueprint/stylesheets/blueprint/_utilities.scss +0 -37
- data/frameworks/blueprint/stylesheets/blueprint/reset/_utilities.scss +0 -80
- data/frameworks/blueprint/templates/basic/grid.png +0 -0
- data/frameworks/blueprint/templates/basic/ie.sass +0 -4
- data/frameworks/blueprint/templates/basic/manifest.rb +0 -30
- data/frameworks/blueprint/templates/basic/partials/_base.sass +0 -10
- data/frameworks/blueprint/templates/basic/print.sass +0 -4
- data/frameworks/blueprint/templates/basic/screen.sass +0 -12
- data/frameworks/blueprint/templates/buttons/buttons.sass +0 -49
- data/frameworks/blueprint/templates/buttons/buttons/cross.png +0 -0
- data/frameworks/blueprint/templates/buttons/buttons/key.png +0 -0
- data/frameworks/blueprint/templates/buttons/buttons/tick.png +0 -0
- data/frameworks/blueprint/templates/buttons/manifest.rb +0 -17
- data/frameworks/blueprint/templates/link_icons/link_icons.sass +0 -13
- data/frameworks/blueprint/templates/link_icons/link_icons/doc.png +0 -0
- data/frameworks/blueprint/templates/link_icons/link_icons/email.png +0 -0
- data/frameworks/blueprint/templates/link_icons/link_icons/external.png +0 -0
- data/frameworks/blueprint/templates/link_icons/link_icons/feed.png +0 -0
- data/frameworks/blueprint/templates/link_icons/link_icons/im.png +0 -0
- data/frameworks/blueprint/templates/link_icons/link_icons/pdf.png +0 -0
- data/frameworks/blueprint/templates/link_icons/link_icons/visited.png +0 -0
- data/frameworks/blueprint/templates/link_icons/link_icons/xls.png +0 -0
- data/frameworks/blueprint/templates/link_icons/manifest.rb +0 -23
- data/frameworks/blueprint/templates/project/grid.png +0 -0
- data/frameworks/blueprint/templates/project/ie.sass +0 -16
- data/frameworks/blueprint/templates/project/manifest.rb +0 -30
- data/frameworks/blueprint/templates/project/partials/_base.sass +0 -11
- data/frameworks/blueprint/templates/project/print.sass +0 -8
- data/frameworks/blueprint/templates/project/screen.sass +0 -46
- data/frameworks/blueprint/templates/semantic/grid.png +0 -0
- data/frameworks/blueprint/templates/semantic/ie.sass +0 -16
- data/frameworks/blueprint/templates/semantic/manifest.rb +0 -33
- data/frameworks/blueprint/templates/semantic/partials/_base.sass +0 -10
- data/frameworks/blueprint/templates/semantic/partials/_form.sass +0 -6
- data/frameworks/blueprint/templates/semantic/partials/_page.sass +0 -17
- data/frameworks/blueprint/templates/semantic/partials/_two_col.sass +0 -38
- data/frameworks/blueprint/templates/semantic/print.sass +0 -5
- data/frameworks/blueprint/templates/semantic/screen.sass +0 -14
- data/lib/compass.rbc +0 -796
- data/lib/compass/actions.rbc +0 -2736
- data/lib/compass/app_integration.rbc +0 -836
- data/lib/compass/app_integration/merb.rbc +0 -106
- data/lib/compass/app_integration/rails.rbc +0 -2096
- data/lib/compass/app_integration/rails/configuration_defaults.rbc +0 -2430
- data/lib/compass/app_integration/rails/installer.rbc +0 -3677
- data/lib/compass/app_integration/stand_alone.rbc +0 -589
- data/lib/compass/app_integration/stand_alone/configuration_defaults.rbc +0 -721
- data/lib/compass/app_integration/stand_alone/installer.rbc +0 -1487
- data/lib/compass/browser_support.rbc +0 -1144
- data/lib/compass/commands.rbc +0 -307
- data/lib/compass/commands/base.rbc +0 -1044
- data/lib/compass/commands/clean_project.rbc +0 -1856
- data/lib/compass/commands/create_project.rbc +0 -2691
- data/lib/compass/commands/default.rbc +0 -1677
- data/lib/compass/commands/generate_grid_background.rbc +0 -1939
- data/lib/compass/commands/help.rbc +0 -1921
- data/lib/compass/commands/imports.rbc +0 -969
- data/lib/compass/commands/installer_command.rbc +0 -807
- data/lib/compass/commands/interactive.rbc +0 -1341
- data/lib/compass/commands/list_frameworks.rbc +0 -1111
- data/lib/compass/commands/print_version.rbc +0 -2478
- data/lib/compass/commands/project_base.rbc +0 -2085
- data/lib/compass/commands/project_stats.rbc +0 -4202
- data/lib/compass/commands/registry.rbc +0 -1350
- data/lib/compass/commands/sprite.rbc +0 -2212
- data/lib/compass/commands/stamp_pattern.rbc +0 -2011
- data/lib/compass/commands/unpack_extension.rbc +0 -2348
- data/lib/compass/commands/update_project.rbc +0 -3002
- data/lib/compass/commands/validate_project.rbc +0 -1686
- data/lib/compass/commands/watch_project.rbc +0 -4155
- data/lib/compass/commands/write_configuration.rbc +0 -2896
- data/lib/compass/compiler.rbc +0 -4913
- data/lib/compass/configuration.rbc +0 -1398
- data/lib/compass/configuration/adapters.rbc +0 -2088
- data/lib/compass/configuration/comments.rbc +0 -843
- data/lib/compass/configuration/data.rbc +0 -2633
- data/lib/compass/configuration/defaults.rbc +0 -3617
- data/lib/compass/configuration/file_data.rbc +0 -643
- data/lib/compass/configuration/helpers.rbc +0 -3500
- data/lib/compass/configuration/inheritance.rbc +0 -3592
- data/lib/compass/configuration/paths.rbc +0 -412
- data/lib/compass/configuration/serialization.rbc +0 -1996
- data/lib/compass/dependencies.rbc +0 -232
- data/lib/compass/errors.rbc +0 -176
- data/lib/compass/exec.rbc +0 -500
- data/lib/compass/exec/command_option_parser.rbc +0 -676
- data/lib/compass/exec/global_options_parser.rbc +0 -1306
- data/lib/compass/exec/helpers.rbc +0 -758
- data/lib/compass/exec/project_options_parser.rbc +0 -1515
- data/lib/compass/exec/sub_command_ui.rbc +0 -1191
- data/lib/compass/frameworks.rbc +0 -3640
- data/lib/compass/grid_builder.rbc +0 -0
- data/lib/compass/installers.rbc +0 -152
- data/lib/compass/installers/bare_installer.rbc +0 -939
- data/lib/compass/installers/base.rbc +0 -4427
- data/lib/compass/installers/manifest.rbc +0 -3335
- data/lib/compass/installers/manifest_installer.rbc +0 -1591
- data/lib/compass/installers/template_context.rbc +0 -1030
- data/lib/compass/logger.rbc +0 -2317
- data/lib/compass/quick_cache.rbc +0 -324
- data/lib/compass/sass_extensions.rbc +0 -213
- data/lib/compass/sass_extensions/functions.rbc +0 -808
- data/lib/compass/sass_extensions/functions/colors.rbc +0 -1279
- data/lib/compass/sass_extensions/functions/constants.rbc +0 -1921
- data/lib/compass/sass_extensions/functions/cross_browser_support.rbc +0 -1966
- data/lib/compass/sass_extensions/functions/display.rbc +0 -1227
- data/lib/compass/sass_extensions/functions/enumerate.rbc +0 -446
- data/lib/compass/sass_extensions/functions/env.rbc +0 -299
- data/lib/compass/sass_extensions/functions/font_files.rbc +0 -821
- data/lib/compass/sass_extensions/functions/gradient_support.rbc +0 -14147
- data/lib/compass/sass_extensions/functions/image_size.rbc +0 -3152
- data/lib/compass/sass_extensions/functions/inline_image.rbc +0 -1678
- data/lib/compass/sass_extensions/functions/lists.rbc +0 -2601
- data/lib/compass/sass_extensions/functions/selectors.rbc +0 -1592
- data/lib/compass/sass_extensions/functions/sprites.rbc +0 -3792
- data/lib/compass/sass_extensions/functions/trig.rbc +0 -811
- data/lib/compass/sass_extensions/functions/urls.rbc +0 -5248
- data/lib/compass/sass_extensions/monkey_patches.rbc +0 -134
- data/lib/compass/sass_extensions/monkey_patches/browser_support.rbc +0 -2169
- data/lib/compass/sass_extensions/monkey_patches/traversal.rbc +0 -660
- data/lib/compass/sass_extensions/sprites.rbc +0 -363
- data/lib/compass/sass_extensions/sprites/base.rbc +0 -4529
- data/lib/compass/sass_extensions/sprites/engines.rbc +0 -662
- data/lib/compass/sass_extensions/sprites/engines/chunky_png_engine.rbc +0 -1074
- data/lib/compass/sass_extensions/sprites/image.rbc +0 -2961
- data/lib/compass/sass_extensions/sprites/image_methods.rbc +0 -900
- data/lib/compass/sass_extensions/sprites/image_row.rbc +0 -1168
- data/lib/compass/sass_extensions/sprites/layout_methods.rbc +0 -3236
- data/lib/compass/sass_extensions/sprites/row_fitter.rbc +0 -2067
- data/lib/compass/sass_extensions/sprites/sprite_map.rbc +0 -1991
- data/lib/compass/sass_extensions/sprites/sprite_methods.rbc +0 -3190
- data/lib/compass/sass_extensions/sprites/sprites.rbc +0 -1573
- data/lib/compass/sprite_importer.rbc +0 -3573
- data/lib/compass/util.rbc +0 -552
- data/lib/compass/version.rbc +0 -1245
- data/test/fixtures/stylesheets/blueprint/config.rb +0 -14
- data/test/fixtures/stylesheets/blueprint/css/ie.css +0 -76
- data/test/fixtures/stylesheets/blueprint/css/print.css +0 -56
- data/test/fixtures/stylesheets/blueprint/css/screen.css +0 -816
- data/test/fixtures/stylesheets/blueprint/css/single-imports/buttons.css +0 -58
- data/test/fixtures/stylesheets/blueprint/css/single-imports/colors.css +0 -80
- data/test/fixtures/stylesheets/blueprint/css/single-imports/debug.css +0 -12
- data/test/fixtures/stylesheets/blueprint/css/single-imports/fancy-type.css +0 -30
- data/test/fixtures/stylesheets/blueprint/css/single-imports/form.css +0 -42
- data/test/fixtures/stylesheets/blueprint/css/single-imports/grid.css +0 -435
- data/test/fixtures/stylesheets/blueprint/css/single-imports/ie.css +0 -76
- data/test/fixtures/stylesheets/blueprint/css/single-imports/interaction.css +0 -46
- data/test/fixtures/stylesheets/blueprint/css/single-imports/link-icons.css +0 -40
- data/test/fixtures/stylesheets/blueprint/css/single-imports/liquid.css +0 -651
- data/test/fixtures/stylesheets/blueprint/css/single-imports/print.css +0 -60
- data/test/fixtures/stylesheets/blueprint/css/single-imports/reset-utilities.css +0 -36
- data/test/fixtures/stylesheets/blueprint/css/single-imports/reset.css +0 -40
- data/test/fixtures/stylesheets/blueprint/css/single-imports/rtl.css +0 -437
- data/test/fixtures/stylesheets/blueprint/css/single-imports/scaffolding.css +0 -45
- data/test/fixtures/stylesheets/blueprint/css/single-imports/typography.css +0 -146
- data/test/fixtures/stylesheets/blueprint/css/single-imports/utilities.css +0 -35
- data/test/fixtures/stylesheets/blueprint/images/grid.png +0 -0
- data/test/fixtures/stylesheets/blueprint/images/link_icons/doc.png +0 -0
- data/test/fixtures/stylesheets/blueprint/images/link_icons/email.png +0 -0
- data/test/fixtures/stylesheets/blueprint/images/link_icons/external.png +0 -0
- data/test/fixtures/stylesheets/blueprint/images/link_icons/feed.png +0 -0
- data/test/fixtures/stylesheets/blueprint/images/link_icons/im.png +0 -0
- data/test/fixtures/stylesheets/blueprint/images/link_icons/pdf.png +0 -0
- data/test/fixtures/stylesheets/blueprint/images/link_icons/visited.png +0 -0
- data/test/fixtures/stylesheets/blueprint/images/link_icons/xls.png +0 -0
- data/test/fixtures/stylesheets/blueprint/sass/ie.sass +0 -3
- data/test/fixtures/stylesheets/blueprint/sass/print.sass +0 -3
- data/test/fixtures/stylesheets/blueprint/sass/screen.sass +0 -18
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/buttons.scss +0 -4
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/colors.scss +0 -34
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/debug.scss +0 -3
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/fancy-type.scss +0 -3
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/form.scss +0 -5
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/grid.scss +0 -3
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/ie.scss +0 -3
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/interaction.scss +0 -3
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/link-icons.scss +0 -13
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/liquid.scss +0 -3
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/print.scss +0 -5
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/reset-utilities.scss +0 -5
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/reset.scss +0 -1
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/rtl.scss +0 -3
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/scaffolding.scss +0 -5
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/typography.scss +0 -3
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/utilities.scss +0 -3
- data/test/fixtures/stylesheets/compass/images/flag-s4798b5a210.png +0 -0
- data/test/helpers/command_line.rbc +0 -2820
- data/test/helpers/diff.rbc +0 -1104
- data/test/helpers/io.rbc +0 -962
- data/test/helpers/rails.rbc +0 -1116
- data/test/helpers/test_case.rbc +0 -1255
- data/test/integrations/compass_test.rbc +0 -6589
- data/test/integrations/rails_integration_test.rbc +0 -1342
- data/test/integrations/sprites_test.rbc +0 -6192
- data/test/test_helper.rbc +0 -1694
- data/test/units/actions_test.rbc +0 -644
- data/test/units/command_line_test.rbc +0 -1532
- data/test/units/compass_png_test.rbc +0 -0
- data/test/units/configuration_test.rbc +0 -3833
- data/test/units/rails_configuration_test.rbc +0 -1032
- data/test/units/sass_extensions_test.rbc +0 -3586
- data/test/units/sprites/engine_test.rbc +0 -962
- data/test/units/sprites/image_row_test.rbc +0 -1578
- data/test/units/sprites/image_test.rbc +0 -2836
- data/test/units/sprites/importer_test.rbc +0 -2620
- data/test/units/sprites/row_fitter_test.rbc +0 -1479
- data/test/units/sprites/sprite_command_test.rbc +0 -1147
- data/test/units/sprites/sprite_map_test.rbc +0 -6515
data/lib/compass/compiler.rb
CHANGED
@@ -19,6 +19,12 @@ module Compass
|
|
19
19
|
self.sass_options[:compass] ||= {}
|
20
20
|
self.sass_options[:compass][:logger] = self.logger
|
21
21
|
self.sass_options[:compass][:environment] = Compass.configuration.environment
|
22
|
+
reset_staleness_checker!
|
23
|
+
end
|
24
|
+
|
25
|
+
def reset_staleness_checker!
|
26
|
+
self.staleness_checker = nil
|
27
|
+
#Sass::Plugin::StalenessChecker.dependencies_cache = {}
|
22
28
|
self.staleness_checker = Sass::Plugin::StalenessChecker.new(sass_options)
|
23
29
|
end
|
24
30
|
|
@@ -33,6 +33,8 @@ module Compass
|
|
33
33
|
nil
|
34
34
|
elsif config.is_a?(Compass::Configuration::Data)
|
35
35
|
config
|
36
|
+
elsif config.instance_of?(Hash)
|
37
|
+
Compass::Configuration::Data.new(filename, config)
|
36
38
|
elsif config.respond_to?(:read)
|
37
39
|
filename ||= config.to_s if config.is_a?(Pathname)
|
38
40
|
Compass::Configuration::FileData.new_from_string(config.read, filename, defaults)
|
@@ -26,7 +26,7 @@ module Compass::Exec::GlobalOptionsParser
|
|
26
26
|
::Compass.configuration.discover Pathname.new(frameworks_dir).realpath
|
27
27
|
end
|
28
28
|
|
29
|
-
opts.on('-I IMPORT_PATH',
|
29
|
+
opts.on('-I IMPORT_PATH', '--import-path IMPORT_PATH',
|
30
30
|
"Makes files under the IMPORT_PATH folder findable by Sass's @import directive."
|
31
31
|
) do |import_path|
|
32
32
|
require 'pathname'
|
@@ -35,6 +35,10 @@ module Compass::Exec::ProjectOptionsParser
|
|
35
35
|
opts.on('--javascripts-dir JS_DIR', "The directory where you keep your javascripts.") do |javascripts_dir|
|
36
36
|
set_dir_or_path(:javascripts, javascripts_dir)
|
37
37
|
end
|
38
|
+
|
39
|
+
opts.on('--fonts-dir FONTS_DIR', "The directory where you keep your fonts.") do |fonts_dir|
|
40
|
+
set_dir_or_path(:fonts, fonts_dir)
|
41
|
+
end
|
38
42
|
|
39
43
|
opts.on('-e ENV', '--environment ENV', [:development, :production], 'Use sensible defaults for your current environment.',
|
40
44
|
' One of: development (default), production') do |env|
|
data/lib/compass/logger.rb
CHANGED
@@ -9,6 +9,7 @@ module Compass
|
|
9
9
|
ACTION_COLORS = {
|
10
10
|
:error => :red,
|
11
11
|
:warning => :yellow,
|
12
|
+
:info => :green,
|
12
13
|
:compile => :green,
|
13
14
|
:overwrite => :yellow,
|
14
15
|
:create => :green,
|
@@ -76,6 +77,7 @@ module Compass
|
|
76
77
|
# Emit a log message
|
77
78
|
def log(msg)
|
78
79
|
puts msg
|
80
|
+
$stdout.flush
|
79
81
|
end
|
80
82
|
|
81
83
|
# add padding to the left of an action that was performed.
|
@@ -32,6 +32,20 @@ module Compass::SassExtensions::Functions::Colors
|
|
32
32
|
color.with(:saturation => scale_color_value(color.saturation, amount.value))
|
33
33
|
end
|
34
34
|
|
35
|
+
def shade(color, percentage)
|
36
|
+
assert_type color, :Color
|
37
|
+
assert_type percentage, :Number
|
38
|
+
black = Sass::Script::Color.new([0, 0, 0])
|
39
|
+
mix(black, color, percentage)
|
40
|
+
end
|
41
|
+
|
42
|
+
def tint(color, percentage)
|
43
|
+
assert_type color, :Color
|
44
|
+
assert_type percentage, :Number
|
45
|
+
white = Sass::Script::Color.new([255, 255, 255])
|
46
|
+
mix(white, color, percentage)
|
47
|
+
end
|
48
|
+
|
35
49
|
# returns an IE hex string for a color with an alpha channel
|
36
50
|
# suitable for passing to IE filters.
|
37
51
|
def ie_hex_str(color)
|
@@ -45,6 +45,15 @@ module Compass::SassExtensions::Functions::Constants
|
|
45
45
|
position
|
46
46
|
end
|
47
47
|
end
|
48
|
+
|
49
|
+
def is_url(string)
|
50
|
+
if string.is_a?(Sass::Script::String)
|
51
|
+
is_url = !!(string.value =~ /^url\(.*\)$/)
|
52
|
+
Sass::Script::Bool.new(is_url)
|
53
|
+
else
|
54
|
+
Sass::Script::Bool.new(false)
|
55
|
+
end
|
56
|
+
end
|
48
57
|
else
|
49
58
|
# returns the opposite position of a side or corner.
|
50
59
|
def opposite_position(position)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Compass::SassExtensions::Functions::GradientSupport
|
2
2
|
|
3
|
-
GRADIENT_ASPECTS = %w(webkit moz svg pie css2 o owg
|
3
|
+
GRADIENT_ASPECTS = %w(webkit moz svg pie css2 o owg).freeze
|
4
4
|
|
5
5
|
class ColorStop < Sass::Script::Literal
|
6
6
|
attr_accessor :color, :stop
|
@@ -10,6 +10,7 @@ module Compass::SassExtensions::Functions::GradientSupport
|
|
10
10
|
def initialize(color, stop = nil)
|
11
11
|
unless Sass::Script::Color === color ||
|
12
12
|
Sass::Script::Funcall === color ||
|
13
|
+
(Sass::Script::String === color && color.value == "currentColor")||
|
13
14
|
(Sass::Script::String === color && color.value == "transparent")
|
14
15
|
raise Sass::SyntaxError, "Expected a color. Got: #{color}"
|
15
16
|
end
|
@@ -21,6 +22,31 @@ module Compass::SassExtensions::Functions::GradientSupport
|
|
21
22
|
def inspect
|
22
23
|
to_s
|
23
24
|
end
|
25
|
+
|
26
|
+
def self.color_to_svg_s(c)
|
27
|
+
# svg doesn't support the "transparent" keyword; we need to manually
|
28
|
+
# refactor it into "transparent black"
|
29
|
+
if c.is_a?(Sass::Script::String) && c.value == "transparent"
|
30
|
+
"black"
|
31
|
+
elsif c.is_a?(Sass::Script::String)
|
32
|
+
c.value.dup
|
33
|
+
else
|
34
|
+
self.color_to_s(c.with(:alpha => 1))
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.color_to_svg_alpha(c)
|
39
|
+
# svg doesn't support the "transparent" keyword; we need to manually
|
40
|
+
# refactor it into "transparent black"
|
41
|
+
if c.is_a?(Sass::Script::String) && c.value == "transparent"
|
42
|
+
0
|
43
|
+
elsif c.is_a?(Sass::Script::String) && c.value == "currentColor"
|
44
|
+
1
|
45
|
+
else
|
46
|
+
c.alpha
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
24
50
|
def self.color_to_s(c)
|
25
51
|
if c.is_a?(Sass::Script::String)
|
26
52
|
c.value.dup
|
@@ -112,7 +138,6 @@ module Compass::SassExtensions::Functions::GradientSupport
|
|
112
138
|
standardized_prefix :webkit
|
113
139
|
standardized_prefix :moz
|
114
140
|
standardized_prefix :o
|
115
|
-
standardized_prefix :ms
|
116
141
|
|
117
142
|
def to_owg(options = self.options)
|
118
143
|
args = [
|
@@ -168,8 +193,16 @@ module Compass::SassExtensions::Functions::GradientSupport
|
|
168
193
|
standardized_prefix :webkit
|
169
194
|
standardized_prefix :moz
|
170
195
|
standardized_prefix :o
|
171
|
-
|
172
|
-
|
196
|
+
|
197
|
+
def supports?(aspect)
|
198
|
+
# I don't know how to support degree-based gradients in old webkit gradients (owg) or svg so we just disable them.
|
199
|
+
if %w(owg svg).include?(aspect) && position_or_angle.is_a?(Sass::Script::Number) && position_or_angle.numerator_units.include?("deg")
|
200
|
+
false
|
201
|
+
else
|
202
|
+
super
|
203
|
+
end
|
204
|
+
end
|
205
|
+
|
173
206
|
# Output the original webkit gradient syntax
|
174
207
|
def to_owg(options = self.options)
|
175
208
|
args = []
|
@@ -245,6 +278,8 @@ module Compass::SassExtensions::Functions::GradientSupport
|
|
245
278
|
ColorStop.new(*arg.value)
|
246
279
|
elsif Sass::Script::String === arg && arg.value == "transparent"
|
247
280
|
ColorStop.new(arg)
|
281
|
+
elsif Sass::Script::String === arg && arg.value == "currentColor"
|
282
|
+
ColorStop.new(arg)
|
248
283
|
else
|
249
284
|
raise Sass::SyntaxError, "Not a valid color stop: #{arg.class.name}: #{arg}"
|
250
285
|
end
|
@@ -488,7 +523,11 @@ module Compass::SassExtensions::Functions::GradientSupport
|
|
488
523
|
# color_stops = array of: [stop, color]
|
489
524
|
def color_stops_svg(color_stops)
|
490
525
|
color_stops.each.map{ |stop, color|
|
491
|
-
|
526
|
+
s = %{<stop offset="#{stop.to_s}"}
|
527
|
+
s << %{ stop-color="#{ColorStop.color_to_svg_s(color)}"}
|
528
|
+
alpha = ColorStop.color_to_svg_alpha(color)
|
529
|
+
s << %{ stop-opacity="#{alpha}"} if alpha != 1
|
530
|
+
s << "/>"
|
492
531
|
}.join
|
493
532
|
end
|
494
533
|
|
@@ -45,9 +45,10 @@ module Compass::SassExtensions::Functions::ImageSize
|
|
45
45
|
private
|
46
46
|
|
47
47
|
def image_dimensions(image_file)
|
48
|
+
image_file = image_file.respond_to?(:value) ? image_file.value : image_file
|
48
49
|
options[:compass] ||= {}
|
49
50
|
options[:compass][:image_dimensions] ||= {}
|
50
|
-
options[:compass][:image_dimensions][image_file
|
51
|
+
options[:compass][:image_dimensions][image_file] = ImageProperties.new(image_path_for_size(image_file)).size
|
51
52
|
end
|
52
53
|
|
53
54
|
def image_path_for_size(image_file)
|
@@ -5,6 +5,18 @@ module Compass::SassExtensions::Functions::Math
|
|
5
5
|
end
|
6
6
|
Sass::Script::Functions.declare :pi, []
|
7
7
|
|
8
|
+
def random(*args)
|
9
|
+
value = if args.length == 1
|
10
|
+
rand(args.pop.value)
|
11
|
+
else
|
12
|
+
range = (args.first.value..args.last.value).to_a
|
13
|
+
range[rand(range.length)]
|
14
|
+
end
|
15
|
+
Sass::Script::Number.new(value)
|
16
|
+
end
|
17
|
+
Sass::Script::Functions.declare :random, [:limit]
|
18
|
+
Sass::Script::Functions.declare :random, [:start, :limit]
|
19
|
+
|
8
20
|
def sin(number)
|
9
21
|
trig(:sin, number)
|
10
22
|
end
|
@@ -20,10 +32,10 @@ module Compass::SassExtensions::Functions::Math
|
|
20
32
|
end
|
21
33
|
Sass::Script::Functions.declare :tan, [:number]
|
22
34
|
|
23
|
-
def e
|
35
|
+
def e
|
24
36
|
Sass::Script::Number.new(Math::E)
|
25
37
|
end
|
26
|
-
Sass::Script::Functions.declare :
|
38
|
+
Sass::Script::Functions.declare :e, []
|
27
39
|
|
28
40
|
def logarithm(number, base = e )
|
29
41
|
assert_type number, :Number
|
@@ -1,5 +1,6 @@
|
|
1
1
|
module Compass::SassExtensions::Functions::Sprites
|
2
2
|
ZERO = Sass::Script::Number::new(0)
|
3
|
+
BOOL_FALSE = Sass::Script::Bool::new(false)
|
3
4
|
VALID_SELECTORS = %w(hover active target)
|
4
5
|
# Provides a consistent interface for getting a variable in ruby
|
5
6
|
# from a keyword argument hash that accounts for underscores/dash equivalence
|
@@ -10,15 +11,45 @@ module Compass::SassExtensions::Functions::Sprites
|
|
10
11
|
end
|
11
12
|
end
|
12
13
|
|
13
|
-
#Returns
|
14
|
+
# Returns the width of the generated sprite map
|
15
|
+
def sprite_width(map, sprite=nil)
|
16
|
+
verify_map(map, 'sprite-width')
|
17
|
+
file = if sprite
|
18
|
+
map.image_for(sprite).file
|
19
|
+
else
|
20
|
+
map.filename
|
21
|
+
end
|
22
|
+
width, _ = image_dimensions(file)
|
23
|
+
Sass::Script::Number.new(width, ["px"])
|
24
|
+
end
|
25
|
+
Sass::Script::Functions.declare :sprite_width, [:map]
|
26
|
+
Sass::Script::Functions.declare :sprite_width, [:map, :sprite]
|
27
|
+
|
28
|
+
# Returns the height of the generated sprite map
|
29
|
+
def sprite_height(map, sprite=nil)
|
30
|
+
verify_map(map, 'sprite-height')
|
31
|
+
file = if sprite
|
32
|
+
map.image_for(sprite).file
|
33
|
+
else
|
34
|
+
map.filename
|
35
|
+
end
|
36
|
+
_, height = image_dimensions(file)
|
37
|
+
Sass::Script::Number.new(height, ["px"])
|
38
|
+
end
|
39
|
+
Sass::Script::Functions.declare :sprite_height, [:map]
|
40
|
+
Sass::Script::Functions.declare :sprite_height, [:map, :sprite]
|
41
|
+
|
42
|
+
# Returns a list of all sprite names
|
14
43
|
def sprite_names(map)
|
44
|
+
verify_map(map, 'sprite-names')
|
15
45
|
Sass::Script::List.new(map.sprite_names.map { |f| Sass::Script::String.new(f) }, ' ')
|
16
46
|
end
|
17
47
|
Sass::Script::Functions.declare :sprite_names, [:map]
|
18
48
|
|
19
49
|
# Returns the system path of the sprite file
|
20
50
|
def sprite_path(map)
|
21
|
-
|
51
|
+
verify_map(map, 'sprite-path')
|
52
|
+
Sass::Script::String.new(map.filename)
|
22
53
|
end
|
23
54
|
Sass::Script::Functions.declare :sprite_path, [:map]
|
24
55
|
|
@@ -30,7 +61,8 @@ module Compass::SassExtensions::Functions::Sprites
|
|
30
61
|
def inline_sprite(map)
|
31
62
|
verify_map(map, "sprite-url")
|
32
63
|
map.generate
|
33
|
-
|
64
|
+
path = map.filename
|
65
|
+
inline_image_string(data(path), compute_mime_type(path))
|
34
66
|
end
|
35
67
|
Sass::Script::Functions.declare :inline_sprite, [:map]
|
36
68
|
|
@@ -57,17 +89,24 @@ module Compass::SassExtensions::Functions::Sprites
|
|
57
89
|
# Becomes:
|
58
90
|
#
|
59
91
|
# background: url('/images/icons.png?12345678') 0 -24px no-repeat;
|
60
|
-
|
61
|
-
|
92
|
+
#
|
93
|
+
# If the `use_percentages` parameter is passed as true, percentages will be
|
94
|
+
# used to position the sprite. Example output:
|
95
|
+
#
|
96
|
+
# background: url('/images/icons.png?12345678') 0 50% no-repeat;
|
97
|
+
#
|
98
|
+
def sprite(map, sprite, offset_x = ZERO, offset_y = ZERO, use_percentages = BOOL_FALSE)
|
99
|
+
sprite = convert_sprite_name(sprite)
|
62
100
|
verify_map(map)
|
63
101
|
verify_sprite(sprite)
|
64
102
|
url = sprite_url(map)
|
65
|
-
position = sprite_position(map, sprite, offset_x, offset_y)
|
103
|
+
position = sprite_position(map, sprite, offset_x, offset_y, use_percentages)
|
66
104
|
Sass::Script::List.new([url] + position.value, :space)
|
67
105
|
end
|
68
106
|
Sass::Script::Functions.declare :sprite, [:map, :sprite]
|
69
107
|
Sass::Script::Functions.declare :sprite, [:map, :sprite, :offset_x]
|
70
108
|
Sass::Script::Functions.declare :sprite, [:map, :sprite, :offset_x, :offset_y]
|
109
|
+
Sass::Script::Functions.declare :sprite, [:map, :sprite, :offset_x, :offset_y, :use_percentages]
|
71
110
|
|
72
111
|
# Returns the name of a sprite map
|
73
112
|
# The name is derived from the folder than contains the sprites.
|
@@ -148,7 +187,17 @@ module Compass::SassExtensions::Functions::Sprites
|
|
148
187
|
# Would change the above output to:
|
149
188
|
#
|
150
189
|
# background-position: 3px -36px;
|
151
|
-
|
190
|
+
#
|
191
|
+
# If you set the `use_percentages` parameter to true, the position will be
|
192
|
+
# expressed in percentages. An example:
|
193
|
+
#
|
194
|
+
# background-position: sprite-position($icons, new, 0, 0, true);
|
195
|
+
#
|
196
|
+
# Would result in something like this:
|
197
|
+
#
|
198
|
+
# background-position: 0 42%;
|
199
|
+
#
|
200
|
+
def sprite_position(map, sprite = nil, offset_x = ZERO, offset_y = ZERO, use_percentages = BOOL_FALSE)
|
152
201
|
assert_type offset_x, :Number
|
153
202
|
assert_type offset_y, :Number
|
154
203
|
sprite = convert_sprite_name(sprite)
|
@@ -160,20 +209,30 @@ module Compass::SassExtensions::Functions::Sprites
|
|
160
209
|
unless image
|
161
210
|
missing_image!(map, sprite)
|
162
211
|
end
|
163
|
-
if
|
164
|
-
|
212
|
+
if use_percentages.value
|
213
|
+
xdivis = map.width - image.width;
|
214
|
+
x = (offset_x.value + image.left.to_f) / (xdivis.nonzero? || 1) * 100
|
215
|
+
x = Sass::Script::Number.new(x, x == 0 ? [] : ["%"])
|
216
|
+
ydivis = map.height - image.height;
|
217
|
+
y = (offset_y.value + image.top.to_f) / (ydivis.nonzero? || 1) * 100
|
218
|
+
y = Sass::Script::Number.new(y, y == 0 ? [] : ["%"])
|
165
219
|
else
|
166
|
-
|
167
|
-
|
220
|
+
if offset_x.unit_str == "%"
|
221
|
+
x = offset_x # CE: Shouldn't this be a percentage of the total width?
|
222
|
+
else
|
223
|
+
x = offset_x.value - image.left
|
224
|
+
x = Sass::Script::Number.new(x, x == 0 ? [] : ["px"])
|
225
|
+
end
|
226
|
+
y = offset_y.value - image.top
|
227
|
+
y = Sass::Script::Number.new(y, y == 0 ? [] : ["px"])
|
168
228
|
end
|
169
|
-
y = offset_y.value - image.top
|
170
|
-
y = Sass::Script::Number.new(y, y == 0 ? [] : ["px"])
|
171
229
|
Sass::Script::List.new([x, y],:space)
|
172
230
|
end
|
173
231
|
Sass::Script::Functions.declare :sprite_position, [:map]
|
174
232
|
Sass::Script::Functions.declare :sprite_position, [:map, :sprite]
|
175
233
|
Sass::Script::Functions.declare :sprite_position, [:map, :sprite, :offset_x]
|
176
234
|
Sass::Script::Functions.declare :sprite_position, [:map, :sprite, :offset_x, :offset_y]
|
235
|
+
Sass::Script::Functions.declare :sprite_position, [:map, :sprite, :offset_x, :offset_y, :use_percentages]
|
177
236
|
|
178
237
|
def sprite_image(*args)
|
179
238
|
raise Sass::SyntaxError, %Q(The sprite-image() function has been replaced by sprite(). See http://compass-style.org/help/tutorials/spriting/ for more information.)
|
@@ -181,10 +240,18 @@ module Compass::SassExtensions::Functions::Sprites
|
|
181
240
|
|
182
241
|
protected
|
183
242
|
|
243
|
+
def reversed_color_names
|
244
|
+
if Sass::Script::Color.const_defined?(:HTML4_COLORS_REVERSE)
|
245
|
+
Sass::Script::Color::HTML4_COLORS_REVERSE
|
246
|
+
else
|
247
|
+
Sass::Script::Color::COLOR_NAMES_REVERSE
|
248
|
+
end
|
249
|
+
end
|
250
|
+
|
184
251
|
def convert_sprite_name(sprite)
|
185
252
|
case sprite
|
186
253
|
when Sass::Script::Color
|
187
|
-
Sass::Script::String.new(
|
254
|
+
Sass::Script::String.new(reversed_color_names[sprite.rgb])
|
188
255
|
when Sass::Script::Bool
|
189
256
|
Sass::Script::String.new(sprite.to_s)
|
190
257
|
else
|
@@ -44,9 +44,10 @@ module Compass::SassExtensions::Functions::Urls
|
|
44
44
|
if base.respond_to?(:declare)
|
45
45
|
base.declare :font_url, [:path]
|
46
46
|
base.declare :font_url, [:path, :only_path]
|
47
|
+
base.declare :font_url, [:path, :only_path, :cache_buster]
|
47
48
|
end
|
48
49
|
end
|
49
|
-
def font_url(path, only_path = Sass::Script::Bool.new(false))
|
50
|
+
def font_url(path, only_path = Sass::Script::Bool.new(false), cache_buster = Sass::Script::Bool.new(false))
|
50
51
|
path = path.value # get to the string value of the literal.
|
51
52
|
|
52
53
|
# Short curcuit if they have provided an absolute url.
|
@@ -62,7 +63,33 @@ module Compass::SassExtensions::Functions::Urls
|
|
62
63
|
Compass.configuration.http_fonts_path
|
63
64
|
end
|
64
65
|
|
65
|
-
path
|
66
|
+
# Compute the real path to the font on the file system if the fonts_dir is set.
|
67
|
+
real_path = if Compass.configuration.fonts_dir
|
68
|
+
File.join(Compass.configuration.project_path, Compass.configuration.fonts_dir, path)
|
69
|
+
end
|
70
|
+
|
71
|
+
# prepend the path to the font if there's one
|
72
|
+
if http_fonts_path
|
73
|
+
http_fonts_path = "#{http_fonts_path}/" unless http_fonts_path[-1..-1] == "/"
|
74
|
+
path = "#{http_fonts_path}#{path}"
|
75
|
+
end
|
76
|
+
|
77
|
+
# Compute the asset host unless in relative mode.
|
78
|
+
asset_host = if !relative? && Compass.configuration.asset_host
|
79
|
+
Compass.configuration.asset_host.call(path)
|
80
|
+
end
|
81
|
+
|
82
|
+
# Compute and append the cache buster if there is one.
|
83
|
+
if cache_buster.to_bool
|
84
|
+
if cache_buster.is_a?(Sass::Script::String)
|
85
|
+
path += "?#{cache_buster.value}"
|
86
|
+
else
|
87
|
+
path = cache_busted_path(path, real_path)
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
# prepend the asset host if there is one.
|
92
|
+
path = "#{asset_host}#{'/' unless path[0..0] == "/"}#{path}" if asset_host
|
66
93
|
|
67
94
|
if only_path.to_bool
|
68
95
|
Sass::Script::String.new(clean_path(path))
|