Igosuki / compass-mixins

A collection of compass' stylesheet for bower dependencies and libsass
Other
592 stars 197 forks source link

Why not to just support everything? (Thoughts on automatic porting) #42

Closed OnkelTem closed 9 years ago

OnkelTem commented 9 years ago

I've got into a situation when I was needed some compass mixins which are yet to be "porterd" into compass-mixins. So I decided to add this support myself and started copying stuff from original compass sass files.

After 30 minutes of manually resolving unknown variables and mixins (first - by adding them into compass-mixins files, and then by just replacing some of them with compass originals), I realized that my success is not guarantied at all, the process is highly inconvenient and seems more like a monkey business then a real deal (not all dependencies can be resolved, many files in comass-mixins are just outdated etc). Wait, I thought, wtf? Can't compass be splitted into pure sass part and... the rest?

If I'm not missing something important the first goal can be achieved by creating a script, which would place Compass sass files in the proper place correspondingly replacing @import paths. For the the other part (not existing in libsass) stubs can be created, and later implementations on js will follow.

Has my vision any sense for you?

michaek commented 9 years ago

It's not possible to support everything, but that approach may get us to closer parity. I stepped into this project when many of the assumptions were already made, but I'll give that some thought.

Igosuki commented 9 years ago

Porting compass to js would defeat the purpose trying to be achieved here, which is to allow compiling compass' files with libsass.

I'm trying to stub all the ruby methods so that there won't be any errors. Unfortunately these functions are used all over the place so it's not possible to just separate them without rewriting everything.

Igosuki commented 9 years ago

The hard part of porting is actually the statistics of capabilities of each browser in order to determine whether or not to use a prefix for a given expression. The rest is simple, we can simply look at how it's done in bourbon for gradients, for instance. Let us know if you wish to port any of the extensions here https://github.com/Compass/compass/tree/stable/core/lib/compass/core/sass_extensions/functions to pure sass.