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

Converted normalize.css to SASS #9

Closed
wants to merge 1 commit into from
Closed

Conversation

Traxmaxx
Copy link

@Traxmaxx Traxmaxx commented Jun 9, 2011

converted normalize.css to SASS ( http://sass-lang.com/ ) and switched to single-line comments so they will be removed in output.

@necolas
Copy link
Owner

necolas commented Jun 14, 2011

I think the existing normalize.css file could just be included in a SASS project by changing the extensions to .scss. Don't seem to be many gains from converting it to .sass. In particular it would involve maintaining two separate files and ensuring that errors/differences don't creep into the .sass version (there are already some in your pull request).

@necolas necolas closed this Jun 18, 2011
@joefiorini
Copy link

Would this be worth discussing again? With the advent pf Bower, converting it manually would mean giving up the benefits of having a pacakge manager. Importing a CSS template into a Sass template compiles to a standard CSS @import rather than pulling in the partial, which makes deployments more difficult. I know there are SCSS versions on bower, but this is the only one guaranteed to be up-to-date. Thoughts?

@necolas
Copy link
Owner

necolas commented May 12, 2013

Importing a CSS template into a Sass template compiles to a standard CSS @import

That's not true. Don't include the .css extension in the import statement.

@Melindrea
Copy link

I can't get it to work, is there something else to it?

I have a file called test.css in the same folder as my Sass file (to ensure that there are no issues with paths).

Relevant part of the file:

@charset "UTF-8";

@import "test";
@import "vendor/normalize"; 
@import "variables"; 

Gives the error stack:

error app/styles/style.scss (Line 3: File to import not found or unreadable: test.
Load paths:
/home/marie/projects/web/mariehogebrandt.se/app/styles
/home/marie/.rvm/gems/ruby-1.9.3-p327/gems/compass-0.12.2/frameworks/blueprint/stylesheets

@joefiorini
Copy link

@Melindrea That makes sense to me; I was under the impression if you don't include an extension, Sass assumes it's looking for an SCSS file. Is that incorrect @necolas?

@necolas
Copy link
Owner

necolas commented May 12, 2013

Oh, looks like I was wrong, been a while since I used Sass - sass/sass#193

I'd suggest you use one of the existing Sass forks or get your build step to combine the files.

@Melindrea
Copy link

Fair enough.

@mlawren
Copy link

mlawren commented May 13, 2013

The trick I use in my local repository is a symbolic link from normalize.scss to nomalize.css. Then a @import "src/normalize.css/normalize.scss"; seems to work just fine. Is this not achieving the desired effect discussed here?

@necolas
Copy link
Owner

necolas commented May 13, 2013

Nice idea

@appleboy
Copy link

I fork normalize.css project

https://github.com/appleboy/normalize.scss

and install it via bower (http://bower.io/).

$ bower install normalize-scss

import it via sass.

/*
* import normalize css
*/
@import "../vendor/normalize-scss/_normalize.scss";

@Melindrea
Copy link

@mlawren I like that! I tend to pull normalize in through ST2 fetch, but I prefer your way.

@joefiorini
Copy link

Hadn't thought about the symlink approach. I wrote a custom importer that allows me to not specify an extension but still import CSS files as though they are SCSS templates like:

@import "bower!normalize-css/normalize";

It's on gist (https://gist.github.com/joefiorini/5563919) right now, I'm hoping to release a gem eventually.

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

Successfully merging this pull request may close these issues.

6 participants