Setting expanded output style in sass doesn´t work - sass

I want to change output style in my sass file to expanded but setting :
sass --watch style.scss:style.css --style expanded
doesn´t work for me. Instead it return me this
Encoding::CompatibilityError: incompatible character encodings: CP852 and UTF-8
Use --trace for backtrace.
Is there any possible to fix it? I´m not quite sure about it too because I´m new in Sass.But when I tried first , things went well in my single line selector in compresed style .I did some changes in sass file, I have here now more selectors formated in expanded output style , but it seems that problem is that compiler still want to see my sass file in compresed output style because it gives me back this:
Compilation Error
Error: Invalid CSS after "body {": expected "}", was "{"
on line 1 of sass/c:\Users\Doma\Desktop\Nové webovky\Javascript
& webovky\alfabeta\pionyr.sass
body { {
Can someone please help? Maybe is some basic thing but I really didn´t find solution to this and I searched in many sources
Thank you very much

that happening because you use native language not english for your operation system to change that and make sure sass compiler working without errors write this in terminal/command line before you use sass compiling command chcp 1252 after code activated use sass compile as expected sass --watch style.scss:style.css --style expanded
update
sometimes this error happening because silly mistake try this may help some causes this solution with helpfully change the path name from c:\Users\Doma\Desktop\Nové webovky\Javascript & webovky\alfabeta\pionyr.sass to c:\Users\Doma\Desktop\Nov webovky\Javascript & webovky\alfabeta\pionyr.sass
just take out é form the folder path and try again.

Related

fix Line is too long error in a ruby file

how to fix Line is too long error in a ruby file without ignoring it and not introducing new errors.
I have tried giving the extra character in the next line using IDE. It is introducing new errors like 'Ternary operators must not be nested. Prefer if or else constructs instead.'
Rubocop already suggested the way to fix this error. Let me repeat it here. Assuming you have a very long line that reads:
variable = long_condition ? true_clause : false_clause
change it to:
variable = if long_condition
true_clause
else
false_clause
end
Other way would be to instruct rubocop to [temporary] ignore this error by running from the very project directory:
rubocop --auto-gen-config
Or, as last but not the least chance, update your .rubocop.yml file to increase a line length within a respective rule.
Rubocop tells you what to do, just follow its advice.
Also, have a look at the ruby styleguide, which explains all the rubocop rules in detail.

Compass & Sass Deprecation warning

I just installed and Compass & Sass as described here.
I got the following warning when I ran compass watch for the first time. What exactly does it mean? What should I do to fix it, do I need to do anything?
$ (master) compass watch
>>> Compass is watching for changes. Press Ctrl-C to Stop.
DEPRECATION WARNING on line 87 of /Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/css3/_deprecated-support.scss: #{} interpolation near operators will be simplified
in a future version of Sass. To preserve the current behavior, use quotes:
unquote('"$moz-"#{$experimental-support-for-mozilla} "$webkit-"#{$experimental-support-for-webkit} "$opera-"#{$experimental-support-for-opera} "$microsoft-"#{$experimental-support-for-microsoft} "$khtml-"#{$experimental-support-for-khtml}')
You can use the sass-convert command to automatically fix most cases.
DEPRECATION WARNING on line 92 of /Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/css3/_deprecated-support.scss: #{} interpolation near operators will be simplified
in a future version of Sass. To preserve the current behavior, use quotes:
unquote('"$ie6-"#{$legacy-support-for-ie6} "$ie7-"#{$legacy-support-for-ie7} "$ie8-"#{$legacy-support-for-ie8}')
You can use the sass-convert command to automatically fix most cases.
write css/styles.css
To fix the error message, just change the line 87 from your "_deprecated-support.scss" file to this:
// A debug tool for checking browser support
#mixin debug-support-matrix($experimental: true, $ie: true) {
#debug '#{"$moz-"}$experimental-support-for-mozilla'
'#{"$webkit-"}$experimental-support-for-webkit'
'#{"$opera-"}$experimental-support-for-opera'
'#{"$microsoft-"}$experimental-support-for-microsoft'
'#{"$khtml-"}$experimental-support-for-khtml';
#debug '#{"$ie6-"}$legacy-support-for-ie6'
'#{"$ie7-"}$legacy-support-for-ie7'
'#{"$ie8-"}$legacy-support-for-ie8';
}
The file can be found at your /Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/css3/_deprecated-support.scss

programatically invoking Sass::Exec::SassConvert generates wrong syntax

Sass::Exec::SassConvert.new(["{path_to_scss_file}.scss", "{path_to_css_file_to_generate}.css"]).process_result
When I run following command from inside a ruby script, the generated file contains "sass"-syntax instead of valid css
When I try to add a set_opts command to specify "-F scss -T css", just to be sure the convertor knows what to do, it throws an error:
NoMethodError: undefined method `banner=' for ["-F scss -T css"]:Array
The goal is to compile scss files to css files from inside an ant build script.
Everything is working except for the wrong syntax issue.
Is there anything I'm missing here?
I rewrote the script to use Sass::Engine instead of SassConvert.
After looking through the code of the SassConvert class, the following fragment pointed me to the solution:
unless [:scss, :sass].include?(#options[:to])
raise "Unknown format for sass-convert --to: #{name}"
end
It appears the SassConvert class only converts CSS files to .scss or .sass, not the other way around.
Also, the correct way to add option flags when calling Sass::Exec::SassConvert, is by doing the following:
sassConvert = Sass::Exec::SassConvert.new(["-F scss", "-T sass", "{path_to_from_file}", "{path_to_file_to_generate}"]
sassConvert.parse!
sassConvert.process_result

Does clang allow preprocessor ==?

I am trying to compile PHP on my Mac OS X 10.8 and I am getting the following problem:
In file included from /Users/ryan/Downloads/php-5.4.5/ext/phar/util.c:23:
ext/phar/phar_internal.h:223:19: error: invalid token at start of a preprocessor
expression
# if SIZEOF_SHORT == 2
^
I'm not sure why this error is occurring as this looks fine to me. I have opened the header file and could make changes if not or remove the if all together as I know what my system should be, but I was wondering if this is the proper approach to this problem.
It looks like SIZEOF_SHORT expands to no tokens. You should investigate where SIZEOF_SHORT is being #defined (this may be on the command line via -DSIZEOF_SHORT=) and fix that to provide the right value.
Alternatively, you could use this:
#include "limits.h"
/* ... */
#if SHRT_BIT == CHAR_BIT * 2
I didn't really find a solution to this problem, but I removed the if's and left behind the line that would be processed anyway and the program compiled just fine. I really don't know what was wrong with this file.

SASS: Invalid #import: expected end of line, was ";" - sometimes

I've got a sass file that only contains import statements
#import "this";
#import "that";
if I run sass from the command line everything's good
bundle exec sass foo.scss:foo.css
If, however I run it from within a script (also via bundle exec) it gets upset about those semicolons. This...
template = File.read("foundation.scss")
sass_engine = Sass::Engine.new(template)
sass_output = sass_engine.render
...produces the following on the sass_engine.render call:
(sass):1: Invalid #import: expected end of line, was ";". (Sass::SyntaxError)
if i get rid of the semicolons then the situation is reversed. It complains on the command line and not in the script.
What's going on, and how do I get it to accept the semicolons when run from a script?
The difference is that the Sass command line program notices the "scss" extension and parses the file as SCSS instead of traditional Sass. When doing it programatically, you are starting a Sass engine and not telling it that it is SCSS instead.
So, the error is that its reading it as Sass instead of SCSS.
http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#options
This should fix your problem right up!
template = File.read("foundation.scss")
sass_engine = Sass::Engine.new(template, :syntax => :scss)
sass_output = sass_engine.render
Viola!

Resources