Giter Club home page Giter Club logo

Comments (10)

badsyntax avatar badsyntax commented on July 24, 2024

Thanks for bringing this to my attention. This is an issue with the sass-convert tool :( I'm looking into it.

from sassbeautify.

badsyntax avatar badsyntax commented on July 24, 2024

Replicated issue with Sass 3.2.4

from sassbeautify.

badsyntax avatar badsyntax commented on July 24, 2024

Replicated issue with Sass 3.2.9

from sassbeautify.

badsyntax avatar badsyntax commented on July 24, 2024

I've created an issue on the Sass repo: sass/sass#822

from sassbeautify.

badsyntax avatar badsyntax commented on July 24, 2024

Also tested on Sass 3.3.0.alpha.195. This is definitely a Sass issue. Hopefully they can fix this soon.

from sassbeautify.

badsyntax avatar badsyntax commented on July 24, 2024

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.

mullens avatar mullens commented on July 24, 2024

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.

badsyntax avatar badsyntax commented on July 24, 2024

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.

badsyntax avatar badsyntax commented on July 24, 2024

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.

badsyntax avatar badsyntax commented on July 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.