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 compiler integration #418

Closed
madskristensen opened this issue Jan 5, 2014 · 21 comments
Closed

SASS compiler integration #418

madskristensen opened this issue Jan 5, 2014 · 21 comments

Comments

@madskristensen
Copy link
Owner

SASS as in .scss files and not .sass.

All the features we have for compiling LESS files should be mirrored for SASS compilation as well. Preferably, the compiler should run on nodejs just like LESS and CoffeeScript.

VS2013 will add a SASS editor in an Update soon and WE needs to support it.

Here are the features:

  • Compile on save
  • Compile on build
  • Menu button for solution-wide recompilation
  • Options page
  • Preview window (Margin)

VS takes care of:

  • Content type definitions
  • Editor Intellisense and validation
  • File icon

These features should be started independent of the VS editor support, to make sure it's ready on time

@am11
Copy link
Contributor

am11 commented Jan 5, 2014

Nice idea! Now we have node base ready, it shouldn't be a hassle :)

Lets do it for both SASS (.sass) and SCSS (.scss). Where SASS will have indentation-wise syntax and SCSS has curly braces syntax (like LESS).

@madskristensen
Copy link
Owner Author

I don't think we should do anything for .sass unless it's super cheap, since there will be no editor support. Also, no one uses .sass anymore.

@am11
Copy link
Contributor

am11 commented Jan 5, 2014

Peeps who are in love with CoffeeScript (nifty syntax), do appreciate sass. Would it be possible giving basic syntax highlighting support via WE?

@am11
Copy link
Contributor

am11 commented Jan 5, 2014

We can hook node based compilers for both.

@madskristensen
Copy link
Owner Author

Don't you think they use Stylus instead of .sass?

@am11
Copy link
Contributor

am11 commented Jan 5, 2014

Yes and that too (also HAML, but that's beside the point) :)

Sass and Scss both supports equal syntax. Just differ in style.

@madskristensen
Copy link
Owner Author

My point is that I'd try to avoid adding larger features for things that less than 3% uses. I believe .sass is one of them.

I'd rather do .scss first and then see if people will ask for .sass. My gut tells me that no one will ask for the support.

@am11
Copy link
Contributor

am11 commented Jan 5, 2014

Yes, you are right. SASS is less widespread and low popularity was the main reason they introduced LESS-like scss syntax in first place. So .scss that is and we would refer it as SASS. (although I am wondering, would the name "SASS" confuse masses? as people may tend to try .sass with WE.)

@SLaks
Copy link
Collaborator

SLaks commented Jan 5, 2014

We can't really work on this without a ContentType definition.
Can we have a beta of the update?

@madskristensen
Copy link
Owner Author

No, it's still too early. I'll see what I can do though. We can add a content type definition hidden behind a #Debug flag for development.

@am11
Copy link
Contributor

am11 commented Jan 5, 2014

I am figuring out which files to keep in node_modules directory. Each package has different test folders and sometimes more folders for development environment.

@SLaks
Copy link
Collaborator

SLaks commented Jan 5, 2014

Note that we should do all SASS work in a separate branch so that we don't interfere with releases.

@am11
Copy link
Contributor

am11 commented Jan 5, 2014

@madskristensen, duplicate all the Less keys with Sass prefix.

@madskristensen
Copy link
Owner Author

No, let's keep to this branch

@SLaks
Copy link
Collaborator

SLaks commented Jan 5, 2014

Why?

am11 added a commit to am11/WebEssentials2013 that referenced this issue Jan 5, 2014
@am11
Copy link
Contributor

am11 commented Jan 5, 2014

@madskristensen, here we go :)

am11 added a commit to am11/WebEssentials2013 that referenced this issue Jan 5, 2014
am11 added a commit to am11/WebEssentials2013 that referenced this issue Jan 5, 2014
am11 added a commit to am11/WebEssentials2013 that referenced this issue Jan 5, 2014
@madskristensen
Copy link
Owner Author

@SLaks Because I'm a Git novice and I'm afraid of getting lost. Also, I foresee major merge conflicts when merging the branches

@am11
Copy link
Contributor

am11 commented Jan 5, 2014

I guess next we need to:

@SLaks
Copy link
Collaborator

SLaks commented Jan 5, 2014

And add unit tests.

@am11
Copy link
Contributor

am11 commented Jan 5, 2014

YES! I always envy people who practice TDD. But in our workflow its kind of hard, unless @madskristensen start rejecting PR with missing required tests! :D

am11 added a commit to am11/WebEssentials2013 that referenced this issue Jan 5, 2014
Also refactored code for better classification.
madskristensen added a commit that referenced this issue Jan 5, 2014
SASS: Added in MarginFactory (Issue #418)
am11 added a commit to am11/WebEssentials2013 that referenced this issue Jan 5, 2014
@am11
Copy link
Contributor

am11 commented Jan 5, 2014

[UPDATED]

As soon as these are resolved, we will unfix the hacks / tweaks (and sourceMaps would be made functional). Currently, the sourceMaps are inline, like this:

/* line 65, C:\Users\Adeel\Documents\Visual Studio 2013\WebSites\WebSite1\1\2\3\cd.scss */
h6 {
  font-family: "Segoe UI", Frutiger, "Frutiger Linotype", "Dejavu Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 12px; }

/* line 71, C:\Users\Adeel\Documents\Visual Studio 2013\WebSites\WebSite1\1\2\3\cd.scss */
#main-nav {
  background: url('menu_background.png') repeat-x;
  min-height: 45px;
  margin-bottom: 60px; }
  /* line 76, C:\Users\Adeel\Documents\Visual Studio 2013\WebSites\WebSite1\1\2\3\cd.scss */
  #main-nav .top-bar {
    margin: 0 auto;
    background-color: transparent; }

Also, formatting is weird. I used --output-style=expanded switch and yet this is the prettiest output its generating. I guess the ROR's sass gem (the one provided with Zurb Foundation) formats the output after the compilation. Can we trigger VS's built-in CSS document formatter in post-processing method?

Here is the related issue: sass/libsass#233

@madskristensen, this can be closed now. 8-)

madskristensen added a commit that referenced this issue Jan 5, 2014
SASS: Fully functional; with tweaks. (Issue #418)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants