Posted by antonyanimator on November 16, 2012 at 4:36pm
3 followers
Jump to:
| Project: | AdaptiveTheme |
| Version: | 7.x-3.x-dev |
| Component: | CSS/HTML |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | postponed |
Issue Summary
Hi,
I'm trying to use sassy module with AT but it seems that the scss files are not being loaded. To test I have moved some custom css code (which is working in the normal css files) to a .scss in the sass directory.
Has anyone used sassy with this theme? If so am I doing it the right way? I would assume adding css to a .scss file would still work?
Thanks
I
Comments
#1
Not really sure, I have not used or tested with this module, I will install and see what gives.
#2
Well, as it stands Sassy will not work with this theme, so we will need to make some modifications to force the theme to work with the module.
Let me go over what the main issues are and how we might solve these:
1. AT makes extensive use of drupal_add_css() and makes hard coded assumptions about what those files extensions are, i.e. that they are .css files.
2. AT makes hard coded (and rather difficult to change) assumptions about where those files reside, aka they must be in certain directorys.
There are a lot of issues at play here in AT because of the complexity of the CSS subsystem, however my gut reaction is this can work with some savvy re factoring. This could include the following:
- use glob() to scan directories for .scss/.sass files
- a theme setting to switch the default path for CSS files, aka tell AT to load files from the /sass/ directory instead of the /css/ directory
- tell AT to compile its aggregated responsive css styles from the prepro public directory
- stuff like the above, not a complete list, you get the gist...
On a very basic level you can use Sassy to load at least two stylesheets by changing the declarations in your sub-themes info file, aka use this:
stylesheets[screen][] = sass/global.base.scssstylesheets[screen][] = sass/global.styles.scss
However that is far from the whole story in AT and we need some re-factoring of load.inc and other functions to make this work properly. We need to be aware of performance, glob() looks quite slow and we don't want to be using that in a production environment, but in development it will be fine - initial testing appears to be pretty quick and Sassy is working just fine.
Initially however I tend to think glob() (or similar approach) will not be needed and we can simply use the theme setting approach to switch directories, and the above mentioned edit to your info file.
#3
I will add a final point in saying that it is relatively easy to install Ruby and the required gems, such as Compass, and get sass compilation working in almost any environment - I use Ruby and the command line and have no issues and its dead simple. Granted not everyone wants to do that and there is a reasonable amount of support for Sassy, so I think it might worth a crack to make this work.
#4
OK, spent the past couple of hours working through this and doing various tests - upshot is this is hard to achieve but not impossible, just hard, which is never a reason not to do something... however that said because it is hard (takes a long time, lots of code and testing) I am going to postpone this and gauge public interest first.
I am making a new release of AT Core today, so this will not be included nor any specific support this Sassy/Prepro.
So, tell me how much you want this people and I will listen, but without public support I am rather on the fence whether to introduce the additional complexity and support requirements.
#5
Thanks for all your efforts with figuring out was going on with this.
I personally have not started using sass or less yet. It does sound like sass is overall better than less.
I wanted to intall sass on my server but unfortunately my sme centos server doesn't easily allow me to install gem. Therefore the sassy module was my next best option. I can imagine that there may be a fair few people who may not be able to install sass through ruby.
Also the fact that sassy only needs php means it will probably grow in use in the near future.
That being said I would say not to spend the time supporting this until more people are using the sassy module. At the moment I don't think many people are using sassy but I may be wrong.
Cheers
#6
Hi, just wanted to put in my 2-cents worth. I started earlier this year with Sassy/Prepro. It was great to be able to use SASS without having to add Ruby to the the server environment. However, as I have learned more SASS, and after several months of Sassy running on a few of my websites, I wouldn't encourage it's use. I've experienced huge performance issues while running Sassy/Prepro on my websites, and tons of errors clogging the watchdog log. More than one error in the php-sassy processor have whitescreened my sites on more than one occasion during updates.
Bottom line - Sassy/Prepro is nice for testing, playing, and getting your feet wet on a development site. But I would not at all recommend Sassy/Prepro in a production environment. Yes, the need to install Ruby for SASS is a bit of a tall first step, bit there are other, better ways (such as desktop compilers) http://mhs.github.com/scout-app/ http://compass.handlino.com/) that - if someone is serious about learning SASS, they will put in some effort and learn SASS the right way, Sassy/Prepro is just an accident waiting to happen to a production site, and I would not want to see Sassy compatibility in AdaptiveTheme.
Lastly - you can use Sassy and compile it as Jeff said by adding it in the theme.info file
stylesheets[screen][] = sass/global.styles.scss, so in that way, all themes support Sassy on a basic level. Sorry for the bit of a rant, I'm just not keen on Sassy/Prepro after using it for the past few months, so much so that I've disabled it and I just compile the SASS stlyesheets by hand whenever I need to update the sass/css now on those particular sites.--Tony
#7
Thanks for the feedback guys.
Those two apps look great, might even try them out myself, although I use Ruby and the command line.
Honestly I think Sassy is an interesting idea but flawed, mainly for the fact that you cannot turn it off - something like Sassy needs to be strictly development. I think that is the biggest turn off for me, and as you say Tony there are issues with running it in production.
The low usage stats are a sign something is not quite right, or that people are simply choosing command line or the app approach - bottom line is that its just not very popular.
I'll leave this postponed for now, maybe we see where this goes in a year or so, things could change but I tend to think those apps will get better and better and be the likely winners for widespread adoption by designers.