Skip to content

Instantly share code, notes, and snippets.

View opdavies's full-sized avatar

Oliver Davies opdavies

View GitHub Profile
@opdavies
opdavies / _classes.scss
Last active December 29, 2015 15:59
A library of custom classes to include within a SCSS project.
// Include this within your main "_init.scss" file using
// @import "classes";
// The opposite of Drupal's .js-hide class which hides an element when
// JavaScript is enabled (this hides an element when JavaScript is disabled).
// Add this to an element using the @extend directive. For example:
//
// .tabs {
// @extend %no-js-hide.
// }
@opdavies
opdavies / hook-form-alter-add-action-classes.php
Last active December 29, 2015 15:19
Add classes to form actions in Drupal 7
<?php
/**
* Implements hook_form_alter().
*/
function MYTHEME_form_alter(&$form) {
// Add additional classes to each form action.
if (isset($form['actions'])) {
$actions = element_children($form['actions']);
foreach ($actions as $action) {
@opdavies
opdavies / st2-d7-project.json
Last active December 16, 2015 08:39
A default Drupal 7 project file for Sublime Text 2
{
"folders":
[
{
"path": "/",
"file_exclude_patterns":
[
"drupal/.gitignore",
"drupal/.htaccess",
"drupal/authorize.php",