after upgrading to sass-3.1.8 form sass-3.1.7 I get this error:
Functions may only be defined at the root of a document.
any Idea how I can solve this?
I'm using some of bourbon's mixins and it's imported at the top of my stylesheets, that's all.
I have the same problem and could not solve it by modifying code.
The way I solved was to use an older version:
gem uninstall sass
gem install sass -v 3.1.1
Ok Here is what I come up with:
SASS team decided to make a change (in this case "Functions may only be defined at the root of a document.") that made some plugins incompatible. in my case it was bourbon library. I made a ticket on github homepage of the bourbon and the owner updated the code and released a new version that's working with latest api.
I think this change should have got a bigger version bump to indicate the api change.
Sass developer here. Mixins and functions were never meant to be allowed in a scoped context. A bug was fixed recently that caused them to be caught when in an imported file (before this fix they were only caught if defined in the primary sass file).
That said, it's not a feature we're explicitly opposed to, but we'd would need to properly test it, document it, and support it as an official feature.
Related
I wanted to know why AsseticBundle has been removed from all the versions of Symfony.
I looked everywhere and I don't found any site talking about this news that began for some weeks.
Initially, I thought they deleted this Bundle because there is a security flaw that will take a few days to be repaired.
This Bundle is indisponsable for including javascript and css file type from an external folder and I wanted to be sure if this Bundle wille be replaced by an another in Symfony or I should add this Bundle manually.
Thanks
The AsseticBundle is not compatible/maintained with the new version of the framework (2.8/3.x).
See the tweet of Fabpot that asking: Honest question: is #Assetic still relevant for #Symfony 3.0?
And the PR remove AsseticBundle (you can find good discussion about for and against the removal of Assetic).
Check also this great article on Symfony and Asset Management that clarify and riassume all the discussion around.
Hope this help
Although Symfony does not support assetic from versions 2.8 upwards, you can still install it by running:
composer require symfony/assetic-bundle
and then enable the bundle in your AppKernel.php like so:
new Symfony\Bundle\AsseticBundle\AsseticBundle()
I want to use this MQ Mixin, but I'm getting an error when trying to compile this mixin:
Warning: C:/xxxxx/mq:13: error: error reading values after mobile
I'm using Grunt with grunt-sass plugin to compile my sass. My first thought was that I am using the old version of grunt-sass that does not support sass maps, and I was partially right because I was using the older version. Quick update to the latest version (at the moment - 0.14.0) and nothing, still getting same error. Also I checked if the error occurs with ruby-sass (v.3.3.14) but does't, file compiles properly. So, what's going on with grunt-sass? What am I missing here? Thanks in advance.
As cimmanon mentioned, grunt-sass is using libsass, which is far behind on features. You should use grunt-contrib-sass instead, which compiles using Ruby sass. You will need Ruby and the sass gem installed for it to work.
I am trying out grunt-sass (instead of grunt-contrib-watch) to use the super speedy libsass compiler.
I've managed to get it working with compass by using a compass bower package. (https://github.com/Igosuki/compass-mixins) So the compass mixins are available. However I am getting the following error
error: only variable declarations and control directives are allowed inside functions
The error is pointing to an #if statement in one of my function calls (i've tried removing that function but it just then fails at the next #if statement).
If I omit my functions file I then get another error, pointing to one of my mixins
error: expected '{' in media query Use --force to continue.
Does anyone have any idea what's going on?
All of this stuff was working when using grunt-contrib-watch.
Thanks
With no actual sass file to look at I assume that you are using features that aren't implemented in libsass yet. To quote from the offical node-sass repo (on which grunt-sass) is based on:
The libsass library is not currently at feature parity with the 3.2
Ruby Gem that most Sass users will use, and has little-to-no support
for 3.3 syntax. While we try our best to maintain feature parity with
libsass, we can not enable features that have not been implemented in
libsass yet.
I am trying to find a nice solution working on two different compass projects. One is based off Compass using Blueprint (older version), and the other is based on susy grid (newer version).
Currently, I have to reinstall the right version for the watch process.
Is it possible to run compile with a specified version? It would be great if it is also possible to run a watch process with a specified version.
Running it as
compass _0.10.5_ compile
will do what you want. (Where you put in the desired version in place of 0.10.5, obviously.)
The tool you're looking for is probally rvm which allows you to have different versions of ruby/gems installed and easily switch between them.
Perhaps there's a simpler way.
If you can use something like Codekit or Livereload, those tools allow you to used embedded sass libraries or define your own.
That you could use the builtin libraries for one project and your custom ones for other projects.
RVM suggested above also works i believe but never tried myself.
I'm migrating a pre-Rails-3.1 app up to 3.1 (actually, someone else did part of the work of attempting to migrate to 3.0; I'd like to go ahead and get it up to 3.1 now).
When I create a new Rails 3.1 app with rails new, the skeleton app seems fine.
When I run rake test or thin start in the migrated app, though, I get:
/Users/dwhsix/.rvm/gems/ruby-1.9.2-p290#zmy/gems/sass-rails-3.1.0.rc.6/lib/sass/rails/template_handlers.rb:32:in `<class:SassTemplate>': undefined method `default_mime_type=' for Sass::Rails::SassTemplate:Class (NoMethodError)
I think I have things configured correctly. Gems are correct, application.rb has:
config.assets.enabled = true
config.generators.stylesheet_engine = :sass
Is there more that is needed somewhere?
Thanks...
May be please try adding one more at application.rb, since rails 3.1 use scss as default.
config.sass.preferred_syntax = :sass
and there is some mime related settings at initializers/mime_types.rb, so you may try to play with that too.
You could also switch to scss if you wanted to, by using the sass-convert command. I originally used sass syntax, but later decided I liked scss better and switched to that.
sass-convert -F sass -T scss mystyle.sass mystyle.scss
Okay, this turned out to be a problem of having too many versions of various gems installed. The real culprit was the wrong version of tilt, which was being brought in by some other gem. Clearing that, and resetting Gemfile.lock, took care of it.
I had the same problem just now. My solution was to update the tilt gem as described in this github issue. Apparently, the default mime type method, is added after tilt 1.3.0.