Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compass/sass config not accessible? #126

Open
michaelparenteau opened this issue Nov 30, 2016 · 1 comment
Open

compass/sass config not accessible? #126

michaelparenteau opened this issue Nov 30, 2016 · 1 comment

Comments

@michaelparenteau
Copy link

Expected behavior and actual behavior

When in config.rb:

compass_config do |config|
  config.output_style = :expanded
  config.line_comments = true
end
activate :sprockets

I would expect to see output of css in development to be "expanded" and to see "line comments", but no. I am seeing css output as :nested. I also tried:

set :sass, output_style: "expanded"

And then when visiting http://127.0.0.1:4567/__middleman/config I see the :output_style has changed from the config's point of view.. but no change in the actual output in the css.

When I comment out sprockets, the expected behavior is good.. but then out goes the coffee2js compilation so... any way to ensure compass/sass settings in config are picked up and so sprockets does what I'd expect?

Steps to reproduce the problem (from a clean middleman installation) or example repo

Gemfile:

ruby '2.3.1'

# Middleman Gems
gem 'middleman', '>= 4.1.8'
gem "middleman-sprockets", github: 'middleman/middleman-sprockets'
gem 'middleman-livereload'
gem 'middleman-compass', '>= 4.0.1'

# See: https://github.com/Compass/compass/pull/2088
# --
# The following github branch should be replaced when Compass catches up and merges
# the new interpolation near operator syntax fixes and middleman-compass is updated.
git 'https://github.com/ably-forks/compass', branch: 'sass-deprecation-warning-fix' do
  gem 'compass-core'
end

gem 'middleman-gh-pages'
gem 'susy', '~> 2.2.11'
gem 'breakpoint', '~> 2.5.0'
gem 'middleman-syntax', '~> 2.1.0'
gem 'middleman-jquery'
gem "faker", "~> 1.6.3"
gem 'rack-contrib'
gem 'puma'

Additional information

  • Ruby version: 2.3.1
  • Middleman version: 4.1.8
  • Middleman Sprockets version: latest master as of today 11/30/2016
  • OS version: Mac OS 10.11.6
@michaelparenteau michaelparenteau changed the title activate :sprockets and compass/sass config not accessible? compass/sass config not accessible? Nov 30, 2016
@stevenosloan
Copy link
Collaborator

Ah interesting, I hadn't ever thought about it as I'd always used the default in dev and depended on the css compressor extension for production. It looks like actually configuring Sass is something that hasn't landed in a "stable" Sprockets yet (but will come with 4.x). That should definitely be something we support.

That wouldn't really help you though if you do need anything special from Compass. Middleman::Sprockets & Middleman::Compass aren't really compatible since Middleman::Compass configures Tilt templates that would never get used w/ Sprockets.

For you, I think if you don't need any of Sprockets specific features in your sass, the best thing would be to disable it for those files and only run it on your js.

activate :sprockets do |c|
  c.supported_output_extensions = [".js"]
end

Hope that is helpful, thanks for the great report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants