SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Zealot
    Join Date
    Aug 2010
    Posts
    193
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    run SASS with js

    this is sort of a hybrid js / css questions.

    I heard you can run SASS with js. I must be googling the wrong keywords, I haven't found a site with the file.

    Isn't there a js file to run SASS? Where can I get it?

  2. #2
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,938
    Mentioned
    214 Post(s)
    Tagged
    12 Thread(s)
    Hi,

    Are you looking for a way to compile it server-side or client-side?

  3. #3
    SitePoint Zealot
    Join Date
    Aug 2010
    Posts
    193
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    client side

  4. #4
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,938
    Mentioned
    214 Post(s)
    Tagged
    12 Thread(s)
    AFAIK there is no officially sanctioned JavaScript implementation of sass.
    And, although there are a couple of use cases that I could think of, generally speaking it is not a good idea to do this on the client-side.
    Doing so means that your users take a performance hit and your site will fall apart at the seams if JavaScript is disabled.

    That said, you might want to check this out: https://github.com/bmavity/scss-js
    Please note, that it hasn't had any commits in over a year.

    A much better route would be to use something like node.js, then you can use this: https://github.com/visionmedia/sass.js/

    Further reading: http://stackoverflow.com/questions/4...g-like-less-js

  5. #5
    SitePoint Zealot
    Join Date
    Aug 2010
    Posts
    193
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    thanks. that might be what I'm looking for.

    I know it's bad to render sass to css on the fly with js at runtime in production. I thought it was commonplace to use js to render sass to css on a local machine while testing, then for production create all the css files.

    I never used github ( that's bad isn't it? ) I think that link is what I'm looking for.

    Beside that, how else would I write sass on windows?

  6. #6
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,938
    Mentioned
    214 Post(s)
    Tagged
    12 Thread(s)
    Hi there,

    Quote Originally Posted by sessions View Post
    Beside that, how else would I write sass on windows?
    You can set Sass up, so that it watches files for you and compiles them on the fly.

    Code:
    sass --watch styles.scss:styles.css
    Here's a very good tutorial on getting up and running on a Windows box.
    http://www.impressivewebs.com/sass-on-windows/

    Pay particular attention to point 4.

    Oh and BTW, using Github on Windows is not as hard as it sounds.
    If you look at the button that says "Clone in Windows", there is a button marked "Zip", which will let you download the repo as a zip file


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •