simpLESS not compiling - css

I am using 'simpLESS' program to compile my .less files into .css files on the fly.
It is really great!
However, after using it only for couple of days, 'simpLESS' stopped copiling the .less into .css files.
I have tried to reinstall, redownload and then reinstall, tried other directories, other .less files, tried recompiling manuall - but nothing works.
Has anyone experienced this?
Thanks!

Simpless is always bad with error handling! instead of telling you what's wrong it just doesn't work! So here is what I do: when Simpless doesn't display the error I use Winless to find the error and after I fix it I go back to Simpless.
note: I use Simpless because it works fine with #import .less files in the other hand Winless doesn't.

I seem to found the problem.
I had the following code:
#result{
.result_padding;
.icon{
height: 17px;
width: 23px;
}
}
However, the ".result_padding" actually was not defined. The simpLESS compiler should have spotted this, but I guess this is a bug. Anyway, after removing this line - it worked.

Related

Live Sass Compiler does not correctly prefix VSCode [duplicate]

I have an issue with the Live Sass compiler in VS Code, namely when working with lists. None of the usual operations work. In the following example, it's list.nth(list,index).
The following works fine in a Codepen:
HTML
<p>red</p>
<p>blue</p>
<p>green</p>
SCSS
#use "sass:list";
p {
font-size: 25x;
font-weight: bold;
}
$colors: red blue green;
#for $n from 1 through 3 {
p:nth-child(#{$n}) {
color: list.nth($colors,$n);
}
}
This also works fine when compiling it locally with the Dart Sass CLI.
But when I try to compile this with the Live Sass compiler in VS Code, I get the following error:
Compilation Error
Error: Invalid CSS after "... color: list": expected expression (e.g. 1px, bold), was ".nth($colors, $n);"
Why is that?
Use Live Sass Compiler by Glenn Marks
I had exactly the same problem. You read the SASS official website, follow the instructions, write the code in Visual Studio Code, and then you get this strange Compilation Error when saving the SASS or SCSS file. You double-check everything and it seems like it should work, but it doesn't.
Well, the problem is caused by the Visual Studio Code extension you are using for compiling SASS or SCSS files to CSS files.
Don't use this extension: Live Sass Compiler by Ritwick Dey
You are probably using this extension: Live Sass Compiler by Ritwick Dey. It's widely used, but is no longer supported by the author. Consequently, the SASS version isn't updated. This extension produces the error you are describing.
Use this extension: Live Sass Compiler by Glenn Marks
You should use this extension: Live Sass Compiler by Glenn Marks. As the author states: A big thank you to #ritwickdey for all his work. However, as they are no longer maintaining the original work, I have released my own which has been built upon it. This extension compiles your SASS or SCSS files to CSS files successfully.
The extension you are using does not seem to be maintained anymore, you can try to use this one instead.

i have installed koala & compile scss file but still sass css is not working

I am using sass css i have an issue in compile nested css. I am using Koala for compiling. I have tried a lot of things but its still giving me such kind of error.
I am using this css for test please let me know if have issue in that code
.first{
background: blue;
p{color:red;}
}
can anyone please help me out from this how can is do that?
if you are using SASS the code should be without {} and ,
SASS code:
.first
background: blue
p
color:red
or just change you file format from .sass to .scss and everithing should works fine

LESS in Visual Studio 2015

I have downloaded and imported the font-awesome in my MVC project. I am using the .less files for styling.
I have a different less file for styles which runs fine but for some reason the font-awesome less file is not working, it gives the following error:
variable #fa-font-size-base is undefined on line 6 in file 'core.less':
[5]: display: inline-block;
[6]: font: normal normal normal #fa-font-size-base/#fa-line-height-base FontAwesome; // shortening font declaration
-----------------------------^
[7]: font-size: inherit; // can't have font-size inherit on line above, so need to override
I am not importing any file in the other less files, but seems like font-awesome has a bunch of imports. Can anyone help?
I ran into a very similar error which brought me here.
In my case, the problem was that I was using an out-date version of the dotless compiler (http://www.dotlesscss.org/)
We had been using an older version of Font Awesome and after upgrading it would no longer compile to CSS due to that missing variable. The newest version (as of this posting) had corrected whatever was causing the compilation failure. After upgrading the version of dotless we used, the problem went away.
Even if you're not using dotless, might be worth determining which .less compiler you are using to see if a newer version is available.

LESS compile error ParseError: Syntax Error on line 1

I am trying to do some customisation on my existing bootstrap less file by importing import my own less file into existing bootstrap.less.
I thought it would be simple, however I've spend painful couple hours already to try to make new less compiled.
every time I add my file in I got:
ParseError: Syntax Error on line 1 in C:\xxx\content\bootst
rap\less\xxx.form.less:9:999 8 }
My own less file:
.form-unit {
background-color: #F5F5F5;
border-radius: 6px 6px 6px 6px;
margin-bottom: 30px;
padding: 10px;
min-height: 170px;
position:relative;
}
Anyone have same problems? what did i missed???
I compiled it online not surprisingly it works, I am so confused
Are you using SimpLESS as your LESS compiler? If so there's a bug where it can't read files encoded in UTF-8 with BOM. Just convert your file to UTF-8 without BOM and it will work.
To anyone using Visual Studio and continuing to tear their hair out with the problem above (I've been in the same boat for the last hour or so, and the approved answer above didn't work for me), I'd recommend getting hold of the Web Essentials extension.
It allows for instant compilation of LESS files into minified CSS whenever they are saved in much the same way as SimpLESS does. No complaints about encoding, line endings or anything else!
For all .less files used in Visual Studio, you need to change the UTF encoding....
File > Advanced Save Options...
Set "Encoding" to "Unicode (UTF-8 without signature) - codepage 65001
Once you do this, the Simpless compiler will work for your files.
If you are using Visual Studio, make sure that you didn't accidentally add the included file to the compile list. Check compilerconfig.json and make sure you aren't trying to compile both the main SASS file and the included one.

How to get started with Compass/Sass on Mac – Invalid CSS error?

I am trying to get started with Compass/Sass on my Mac. After running sudo gem install compass, I have set up a project with a single main.scss file and I use compass watch to have the file automatically compiled to CSS.
main.scss looks like this:
#import "compass/css3/border-radius"
div .blah .baz {
#include border-radius(4px, 4px);
font-weight: bold;
}
Seems like nothing complicated, right? Well, every time I save the file, I get an error like this:
>>> Change detected to: /Users/mikl/Sites/ddk7/profiles/blaahval/themes/kaskelot/./scss/main.scss
error ./scss/main.scss (Line 3: Invalid CSS after ".../border-radius"": expected selector or at-rule, was "$blue: #3bbfce;")
overwrite ./css/main.css
Is there something wrong with my SCSS syntax, or just compass just have very poor error messages?
As #jnpcl said, a semi-colon would be good. However, if that was the issue it should throw an error directly related to that.
This seems like a stretch, but did you copy and paste that line? Perhaps there is character weirdness happening?

Resources