Comments (10)
Thanks for bringing this to my attention. This is an issue with the sass-convert tool :( I'm looking into it.
from sassbeautify.
Replicated issue with Sass 3.2.4
from sassbeautify.
Replicated issue with Sass 3.2.9
from sassbeautify.
I've created an issue on the Sass repo: sass/sass#822
from sassbeautify.
Also tested on Sass 3.3.0.alpha.195. This is definitely a Sass issue. Hopefully they can fix this soon.
from sassbeautify.
Thinking about it, I can't be sure this is a bug with Sass, as I can't be sure as to the 'correct' way of negating a value.
Ultimately what you want to do is to display the output of the variable, and stick a hyphen (-) in front of it. I think there's a possibility you're using parenthesis for the wrong thing here, but I could totally be wrong about that.
(It looks like you're trying to do string concatenation, instead of negating a value, which you can do like: $page * -1
)
Have a look through the reference docs, and find all references to 'parenthesis': http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html
Perhaps, instead of using parenthesis, you want to interpolate the variable so that it can be treated as plain CSS without Sass trying to perform some operation on it: http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#interpolation_
So, you could do something like:
$marg: 10px;
.body {
margin: 0 -#{$marg} 20px -#{$marg};
}
I'll love to get a reply from the Sass devs about this..
from sassbeautify.
Could very well be the wrong way to do it, but Googling "negative SASS variable" gives http://stackoverflow.com/questions/13296419/sass-negative-variable-value which is where I learned to do it this way.
Either way, a beautifier should never change the result of code, right?
from sassbeautify.
I agree, a beautifier shouldn't change the code, only the white-space. As this plugin is simply a wrapper around 'sass-convert', i guess you can't call it a typical beautifier, but more of a compiler. It uses sass-convert to compile your Sass into Sass, which is why we're seeing these issues (and the reason why I question what is the correct way of doing things). As this plugin is entirely dependent on sass-convert, issues like this are a bit out of my hands, I'm sorry. I'll wait to see what the Sass devs say about this issue and I'll also look for an alternative solution in the meantime.
from sassbeautify.
Just a FYI, the sass devs have created a fix for this (but have not yet merged): sass/sass#829
Hopefully they will merge this as part of the next major release. Thanks for this bug report @lucasmullens, you've essentially found a bug in sass-convert!
In the meantime you can either interpolate or just multiply by -1. I'm going to close this ticket as there's nothing I can do to fix this issue, it's entirely dependant on the fix coming through from sass.
from sassbeautify.
This is now fixed since sass version 3.2.11: http://sass-lang.com/documentation/file.SASS_CHANGELOG.html#3211
from sassbeautify.
Related Issues (20)
- General config file in repo for sharing between developers
- Not working after latest ST3 Update HOT 2
- Option to re-order css properties on beautify HOT 3
- Leading zero HOT 1
- [Errno 2] No such file or directory: 'sass-convert' HOT 7
- Indentation HOT 4
- Extra line between comment and closing bracket HOT 1
- Add missing semicolons automatically rather than sass-convert throwing error
- Double quotes in single quotes are changed on compile
- Simply not working
- it does't work and throw a error 'UnicodeDecodeError'
- UTF-8 not supported
- SassBeautify throwing the following error - No such file or directory 'sass-convert' HOT 9
- Attempting to use BEM methodology Sass breaks formatting
- Ability to set FinalNewline to true HOT 1
- [Errno 2] No such file or directory: 'sass-convert' HOT 2
- Double quotes are changed on compile
- Allow manual use on non .scss/.sass/.css files. HOT 1
- Error
- going insane
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sassbeautify.