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
Consider to replace Compass against libsass #3600
Comments
Compass is just used on the CMS developer side to compile core styles, and it shouldn't dictate any specific tool for developing websites with django CMS |
The setup is very cool and makes the static pipeline much simpler. The problem I see with incorporating this into django-cms itself, is that we'd force the django-compress and libsass dependencies and the additional configuration needed on everyone using django-cms. Pros:
Cons:
|
@yakky
so is PIL, psycopg2, lxml. Without a C compiler you won't be able to install a virtual environment for djangoCMS anyway. Therefore IMHO that's a very week con.
would you say, that a separate Can we vote about this? |
@jrief I'm definitely not voting against |
@yakky this is a valid argument. |
On the long term we should even consider to remove all third party libraries from the git repo and replace them by node_modules and/or bower_componets controlled by a tool such as shrinkwrap. I just came across this wonderful statement: |
Since there is some opposition to require
This new compressor will do the following: Otherwise, if I would add this compilation step into I don't believe that developers, working directly against the CMS source tree, would have a problem to add @yakky @stefanfoulis : If you think this is a feasible solution, I'll add that feature. |
@jrief That would be an awesome solution! |
@FinalAngel Angelo, would you mind giving this a) a quick look and b) your opinion? |
@jrief Love it. So developers just installing django-cms from pypi will not On Tue, Dec 9, 2014 at 5:25 PM, Daniele Procida notifications@github.com
Divio AG |
I already started with implementing this. The good news is, that django-compressor allows pregeneration of CSS files though So unless we postpone precompression, I'll have to wait until I get an answer for the above question. |
We have the goal also internally to move over to libsass, however there are other dependencies to consider such as autoprefixer which have to work as well (in order to get rid of compass) Regarding the libsass dependency, I'm with @yakky and @stefanfoulis on the additional requirements. We should rather make it easier to configure the cms than harder. It might also draw developers away if they are using less and see that the cms supports natively only sass. Though I'm pro for dropping compass at some point. (would target this for 3.2 though) |
@ojii Therefore in order to implement this useful feature we have 3 options:
Please see django-compressor/django-compressor#351: Update docs to note that django-sekizai doesn't work with offline compression. If 2. and 3. are impossible to solve, would 1. be an option? |
I had a look at this a while back and the problem is that offline compression isn't compatible with sekizai, because with sekizai the whole idea is that you don't know in advance (in the case of django CMS at least) what assets will end up on a page. I guess there could be a way to compress each individual |
@ojii so, what you say is, that there will not be any solution in the near future which can use django-compress with Sekizai. Ok, then we have to reconsider option 1 again, or drop that feature completely. |
Just for clarification, you can use django-sekizai with django-compressor, the amazing folks over at compressor made that happen. What is not possible at the moment is offline compression because of technical (how compressor looks for files to offline compress) and logical (way of how sekizai is intended to be used) reasons. I know offline compression + sekizai is an important topic to people, but I have no answer for it at the moment. I'd be very interested in actual solutions (proposed or implemented) for this, but let's discuss this over on the django-sekizai tracker (if you happen to have a solution). |
We now have a solution to solve this: |
django-sekizai-processorsI just released a package to do the Additionally it adds a sourcemap to each compiled file, so that when using element inspection on modern browsers, the source file is referred instead of the compiled css file. For details, please see here: https://pypi.python.org/pypi/django-sekizai-processors/0.1.0 This means, we now could start to migrate django-cms to use libasss exclusively, instead of Ruby SASS |
\O/ great job @jrief ! |
So after digging into deeper: I will start now on a libsass branch where I migrate accordingly. Though using Backing the django stack on the libsass compilation is the wrong move, we need to include a node / gulp (or Grunt) kinda way to compile, minify, concatenate, lint and optimise the generated output. Frontend developers are far more comfortable working in that environment. Additionally we need autoprefixer support to take care of the lack of mixins on the libsass front, there is not yet a solution for django there. Also considering all the other advantages which we get through node such as linting and at some point testing. I'll reference my efforts to this issue. |
Agree. Decoupling the CMS deployment from any specific way to generate and serve assets it's the only viable option, while still having a more integrated option is a very welcome addition |
May I remind to evaluate this package: https://github.com/jrief/django-sass-processor |
@jrief though it has some downsides:
things I'm not sure of:
|
|
@jrief just to answer your points
anyhow, my proposal goes towards the node integration in https://github.com/FinalAngel/django-cms/pull/6. Using the right tool for the right job ;) |
However supportive I would be if you could use a python only solution, after much tinkering with different methods (sekzai/django-compressor, django-bower and the like) I'm glad @FinalAngels' branch proposes the gulp |
@driesdesmet https://github.com/jrief/django-sass-processor is a pure Python approach. That's the reason I wrote it. The second reason was, that I dislike having to run a daemon, watching some directories and then acting. |
done :) |
This would have many advantages:
pip
..scss
are referenced directly in the templates, rather than having to refer an autogenerated css-file.For more information refer to this post: https://groups.google.com/forum/#!topic/django-cms/KO7K1iMIjmo
The text was updated successfully, but these errors were encountered: