Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sass 3.4.17 not adding semicolon #1806

Closed
radu-matei opened this issue Aug 24, 2015 · 9 comments
Closed

Sass 3.4.17 not adding semicolon #1806

radu-matei opened this issue Aug 24, 2015 · 9 comments

Comments

@radu-matei
Copy link

I have just installed Sass 3.4.17 Selective Steve and when creating my main.min.css it doesn't add semicolons after the first two imports.

I saw in the changelog that there was a fix related to semicolons, so I believe the issues are related.
Until there is a fix, I rolled back to 3.4.16.

@chriseppstein
Copy link

Can you please provide a code example of what's broken?

@radu-matei
Copy link
Author

@import url("../../node_modules/bootstrap/dist/css/bootstrap.min.css")@import url("../../node_modules/font-awesome/css/font-awesome.min.css") etc

Notice how after the first import the semicolon is missing, even though in the initial css it was there. So was the case after the second import.

@chriseppstein
Copy link

I cannot reproduce this. Please provide a minimal code example and the commands you're using to compile it.

@radu-matei
Copy link
Author

This is the command I use:
cmd.exe /c grunt -b "C:\Users..." --gruntfile "C:\Users...Gruntfile.js" sass:dist

And this is part of the file that needs to be processed:
@charset "utf-8";

/:::: Main Stylesheet ::::/
$image-path: "../..";

@import 'reset.scss';
@import url("../../node_modules/bootstrap/dist/css/bootstrap.min.css");
@import url("../../node_modules/font-awesome/css/font-awesome.min.css");

Now, when the processing is complete, those semicolons (all 3) are missing.

And this is the grunt task I use:

    sass: {
        dist: {
            options: {
                style: 'compressed'
            },
            files: [
              {
                  expand: true,
                  cwd: 'Content/sass',
                  src: ["**/main.scss"],
                  dest: "Content/css",
                  ext: ".min.css"
              }
            ]
        }
    }

@robchenski
Copy link

I'm getting exactly the same behaviour with Sass 3.4.17 Selective Steve. With compressed output style.

@import url(MyFontsWebfontsKit.css)html{font-size:62.5%} etc.

no semicolon after @import url()

It's stopping my fonts from loading! No console errors either.

It was fine before I moved / ugraded my dev env.
Only just installed this too in a new dev environment and probably got all newer versions than what I previously had in my last setup.

As a workaround and to save trawling about for the problem I've changed output style to 'expanded'. Which is not ideal but gets me out of a tight spot.

Here's my options and style that causes the problem etc:

sass : {
dist : {
options : {
style : 'compressed'
},
files : {
'css/main.css' : 'sass/main.scss'
}
}
}

@import 'MyFontsWebfontsKit.css';
html {
box-sizing: border-box;
font-size: 62.5%;
}

I'll wait and see what happens here..

@chriseppstein
Copy link

Fixed in 3.4.18 which was just released.

@robchenski
Copy link

Working for me in 3.4.18 !
Thanx and darn quick too.. Good skills

@marschro
Copy link

marschro commented Jan 31, 2017

have this issue still in 3.4.21 (critical steve)

@mixin device($media) {
  @if $media == mobile {
    @media only screen and (max-width: 375px) { @content; }
  }
  @else if $media == tablets {
    @media only screen and (min-width: 376px) and (max-width: 768px) { @content; }
  }
  @else if $media == desktop {
    @media only screen and (min-width: 769px) { @content; }
  }
}

Using:

@include device(mobile) {font-size: 12em;}

Parses to:

@media only screen and (max-width: 375px){
    h1{
        font-size:12em
    }
}

UPDATE:
Only happens when sass --style compressed
bummer...

@xzyfer
Copy link

xzyfer commented Jan 31, 2017

@marschro the trailing semicolon on the last declaration is not needed in CSS so it was left out as an optimisation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants