I have been playing with SASS for a while now and think its a good idea to offer SCSS files for those that want to use SASS. I am moving all my dev to using SASS so this makes sense.

Patches more than welcome!

Setting as major since I really want this done.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jeff Burnz’s picture

Very basic implimentation has been made in 7.x-3.x, but we still need to develop the mixins and variables that could be useful, and convert the actual CSS files, they are all there as .scss (set compass to watch the /scss/ folder and it will overwrite all CSS files in /css/).

I need to re-write all the .scss files, and need some help and input on this etc.

Jeff Burnz’s picture

In the most recent update to 7.x-3.x I removed most of the current .scss files except for base and partials, I am doing a bit of file restructuring and will reinstate a full compliment of scss files once this is fully thought out and implemented.

Jeff Burnz’s picture

After some long hard thinking I settled on following Zens lead with regards to CSS structure, its not identical but much the same, which is almost the same as it always has been... lol, so after going around in circles I have returned to the idea that modular stylesheets really do make sense (we have to test these notion, even after years of real life work, its worth exploring new ideas).

What I have done is poached Zens CSS and modified it to suit AT. Mostly this means removing bits, adding bits and changing some bits (bits = files, selectors and styles). The upshot is that I can use Zens scss files with the same rather minimal modifications, thats a big win and will get us SASS integration sooner rather than later.

smoothify’s picture

FileSize
845 bytes
4.81 KB

Hi Jeff

I've been looking at and learning SASS, and wanted to use it to handle responsive layouts rather than have it done through the theme settings.

I created a set of mixins for the different core layouts in AT, which can then be included in the responsive stylesheet. Currently this doesn't cover the panels / gpanels layouts.

I'm not sure if this fits into your plans for AT and SASS, but thought you might like to see it anyway as it may give an idea to you.

The base file referred to is simply the one from the zen theme.

Jeff Burnz’s picture

Its cool, but not really what I am driving at - the theme has all-powerful layout capability built in so I am more wanting to focus on style/design for SASS and leave the layout heavy lifting up to theme settings.

So mixins for style, regularly used stuff and setting variables for reuse, that sort of thing, but most of all just getting a really good CSS structure in place - which is why I went back to my original modular type structure and pinched a lot out of Zen (mainly because that gives me a head start and lots of helpful documented CSS files to boot).

I have sort of left this for a while now, I have been working on other things in the theme, which I will reveal very shortly...

I'm going to make a commit later today, if you are interested please take a look at the CSS files and the structure, you will see I have the base and custom partials from Zen in the SASS directory and a modified config.rb file there also, the modular CSS needs converting to SASS, which is the big job, but its still being tweaked.

smoothify’s picture

Yeah, i thought that might be the case - but i thought it worth sharing here anyway on the off chance.

The base theme i'm creating is actually a real hybrid of stuff (AT, zen and my own stuff) - it needs to work on D6 and D7 (.info changes aside) for some internal projects.

I don't need settings done from the UI, and i didn't fancy porting everything back to 6.x - so this seems the simplest way for me to get the responsive layouts into a modern D6 theme that will need no transition to D7.

I will keep an tab on what you're doing though.

Jeff Burnz’s picture

Oh yes, please do keep me up to date, sounds like an interesting project.

Jeff Burnz’s picture

OK, I just pushed a MAJOR update to git.

Jeff Burnz’s picture

Just a quick brain dump here:

I think the CSS structure and even the actual CSS is pretty much done from my point of view, I am really open to adjustments to the default CSS (the actual styles) that ship with the theme, in particular in the sub-theme, so I am really looking for help with doing this SASS conversion of those existing CSS files in the sub-theme to scss equivalents.

Probably a lot can be lifted strait out of Zen and tweaked, or start from scratch, not sure which will be faster, maybe from scratch might be less checking and be a smoother ride.

If someone still wants to grab this please be quick, I am champing at the bit to get a stable release out next week and working like a dog to make this happen.

Jeff Burnz’s picture

Status: Active » Fixed

An initial port to SASS has been committed.

We can all thank Barraponto for his awesome work on these files, thanks man, you rock!

Jeff Burnz’s picture

Assigned: Unassigned » Jeff Burnz
Category: task » bug
Status: Fixed » Needs work

OK, on deeper review there are a number of mistakes in the current SASS files and I want to reformat them to use a formatting style more inline with Drupal CSS coding conventions.

Jeff Burnz’s picture

Status: Needs work » Fixed

I've made commits over the past few days to clean these up, added in the @imports for the base and custom partials, its hard to know for sure how good they are without actually giving them a few site builds to see where they can be improved, so will mark this as fixed and probably commit small incremental improvements over the next few weeks. I'm doing a custom theme build right now and everything is going very smoothly on 7.x-3.x, the SASS integration is a huge win and the new settings are making life real easy in many regards.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

mossy2100’s picture

This is great stuff. I'm just starting a new D7 theme and keen to use SCSS. This looks like a great solution. I'm assuming it will require the sassy module?

It might be off-topic, but have you thought of using the html5boilerplate style.css (which incorporates normalize.css) as a starting point instead of your html-elements.css? See also http://drupal.org/project/normalize

Thank you
Shaun

mossy2100’s picture

In your 7.x-3.0-alpha3 version, sass/_README.txt:

"This directory includes Sass versions of AT's CSS files.

Sass is a language that is just normal CSS plus some extra features, like
variables, nested rules, math, mixins, etc."

SCSS is not the same as SASS if you are referring to the syntax. Technically, this should read:

"This directory includes SCSS versions of AT's CSS files.

SCSS is a language that is just normal CSS plus some extra features, like
variables, nested rules, math, mixins, etc."

The folder should also be named 'scss'.

HTH
SHaun

mossy2100’s picture

Another point of interest. As opposed to what's written in the same file (7.x-3.0-alpha3 version, sass/_README.txt) you don't need Ruby to use SCSS in Drupal. Just install the sassy module and the phpsass library, and you're good to go. No "compass watch", no "compass compile", no Ruby.

See: http://drupal.org/project/sassy

HTH
Shaun

Jeff Burnz’s picture

Status: Active » Closed (fixed)

Hey, hows it, I missed all this because the issue is set to closed, make em active if you update an issue so it pops up on my radar.

Jeff Burnz’s picture

Status: Closed (fixed) » Active

Ops

Jeff Burnz’s picture

Status: Closed (fixed) » Active

If you look AT already has quite a few things that are in normalize, although I have not done a full audit some things are quite similar and share a lot of commonality. I do not like the look of the form resets in normalize, for that reason alone I would not touch it.

I tend to take a very pragmatic approach to these things, I know what works for Drupal and will stick to working software rather than include something that I know is not well tested in Drupal.

Jeff Burnz’s picture

I have not tested with Sassy module, it would be good to have some feedback if you are using it, that everything is working just fine or not, as the case may be. I use Ruby and Compass, so that is what I have tested with. If its working fine with Sassy then I can include a link in the docs to that module, it could be useful to many people who don't want to use command line.

mossy2100’s picture

Hey Jeff

Sorry for not making the issue active again, I didn't notice it was closed, and I am still learning to be bold enough to edit settings when commenting on issues.

I take your point on normalize. It seems like a great idea to me, but I have not attempted to integrate it into any themes as yet, simply because of the time cost involved. It really needs to be in core rather than in a theme (imho).

I have created a subtheme of AT, and it's working great with the prepro, sassy and sassy_compass modules, and the phpsass library. I'm currently in the process of evaluating LESS and SCSS, both of which are similar and have pros and cons. SCSS has more features, plus the beautiful Compass library; however, I have turned off caching in prepro and finding that SCSS takes noticeably longer to compile than LESS.

I suspect that most Drupal developers would much prefer to use a Drupal/PHP solution rather than Ruby.

Thanks again for a great starter theme. This is my first attempt at making a mobile-friendly site. I started with Omega but was a bit overwhelmed by the options; AT is simpler, but still does what I need. My intention is to make the theme fully HTML5/CSS3 with graceful fallback and as much built-in cleverness to cater for old browsers/IE as well as possible; to this end I am also using html5shiv (by way of the html5_tools module) and css3pie.

I'm in Australia, that's why my messages come through at an odd time compared to your time zone :)

Shaun

Jeff Burnz’s picture

The theme already loads the HTML5 shiv, by default too, its in the "Settings" tab under Polyfills. PIE is great, I have used it a lot, very useful and something I should think abut including in the core theme, I need to recheck the licencing.

I use Ruby and Compass and find the compile time to be near instant, I mean its very fast. Most of the hard core front end people I know in Drupal are using Compass and Ruby. I gave the Sassy module a test but I couldn't get it to work, but I don't have much spare time to figure out what is wrong, its hard to get time to test these things.

Glad you appreciate the approach - I take a more simple approach in the UI, and leave the raw power hiding under the hood, which is easy to tap if you really need it.

Jeff Burnz’s picture

Status: Active » Fixed

I added Sassy reference to the README file and added a note about using scss syntax. I dont want to change the directory name, I can live with a minor naming convention issue, the tradeoff is many people know what SASS is and can visually identify it immediately, whereas SCSS is just less well known - I'm talking about those who have never used SASS, but maybe heard of it, for those who have used it and are experienced it makes little difference either way.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Kendall Totten’s picture

FileSize
21.62 KB

For what it's worth, I ended up on this issue page hoping to find a version of Adaptive Theme that was using the SASS syntax instead of the SCSS syntax. SASS is more of a true shorthand, as it does not include semicolons or brackets, and you may use + instead of @include for mixins.
I went through and coverted each of the SCSS files to SASS, so I figured I'd attach them here for others who may be looking for the same thing.

NOTE: Since these stylesheets include many empty selectors to guide you, you'll get a lot of warnings when you compile in the command line as it tells you that these selectors do not have any properties and will not be rendered. However these are only warnings and not errors. The SASS files are still compiling just fine and your resulting CSS will still work.

Cheers!