Jump to content

Creating a Drupal Subtheme

Contrablind

I am very new to Drupal especially to theming so bear with me  please.

 

I am trying to create a subtheme of Omega 4 on Drupal 7. I am running my Drupal installation on a Windows 8 machine via xampp. Now I have seen several tutorials that recommend creating the subtheme with Drush but I just cannot figure out how to do that on Windows since all the tutorials I've found are for Mac. Is there a way to do it on Windows (manually if necessary)?

 

Also I would like to use sass for this project since Omega seems to be built for it but I have not worked with sass before either and I am unsure how to go about it. Do I have to do the compiling via Drush somehow as well? Or is there some other compiler I could use (e.g. Prepros)? Alternatively would it be ok to just ignore the sass and directly code the css files?

 

Any help or pointers would be greatly appreciated!

 

Link to comment
Share on other sites

Link to post
Share on other sites

It's easy peas. You need to read up on subthemeing here: https://www.drupal.org/node/225125. The important part is the "base theme" line in the .info file.

 

Until you know why you should be using sass, you should just use CSS, it's easier. I have no idea how to compile sass on windows, anyway, as most sane people do web development on Mac or Linux.

Link to comment
Share on other sites

Link to post
Share on other sites

Thanks for the reply. That's actually helpful. Well I know why I should be using it: it's quicker to write once you get the hang of it. I feel like I'm pretty good with regular CSS now and just wanted to try out something new. But I'll stick to CSS then. Yeah I considered moving to Mac or Linux but since I like to game as well and several games are only available on Windows, I'm afraid I'm stuck.

Link to comment
Share on other sites

Link to post
Share on other sites

For anyone wondering the same thing I did: I found this article https://www.drupal.org/node/2204227. It does work but I had to type out the install command for all the ruby gems myself individually within command prompt. Luckily it tells you all of them so you simply have to copy them down. I'm up and running with sass so I'm not gonna complain.

Link to comment
Share on other sites

Link to post
Share on other sites

Thanks for the reply. That's actually helpful. Well I know why I should be using it: it's quicker to write once you get the hang of it. I feel like I'm pretty good with regular CSS now and just wanted to try out something new. But I'll stick to CSS then. Yeah I considered moving to Mac or Linux but since I like to game as well and several games are only available on Windows, I'm afraid I'm stuck.

 

It's not really quicker to write in my experience, unless you are using some kind of front-end framework (a la Bootstrap) that provides lots of useful mixins out of the box (or you've written your own). What I find that does actually speed up writing CSS is to use something like the Firefox CSS editor that allows you to see your changes live and then save them to disk.

 

As for using Linux on windows, the solution is to use a virutal machine. This is what I do, both at home and at work - specifically, I'm running a custom Vagrant box which I've specifically tailored for Drupal development. If you're interested I can pm you more information.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×