Skip to content

Instantly share code, notes, and snippets.

@tsavory
tsavory / no media quries
Created June 5, 2012 22:44
overcome ie7+ie8 lack of media query to perform layout switch. litwol piggybacked ride on omega multi-layout support. but he couldn't use media queries. so the aim was to provide different means to trigger layout change without relying on media query.
function hook_css_alter(&$css) {
if ('[your theme name]' == $GLOBALS['theme'] && ($theme = alpha_get_theme()) && $theme->settings['responsive']) {
$request_session = request_session_get(); // This is my internal api. tells me parameters about current widget request. namely what size it wants to be in this request... narrow or wide.
$old_grid = $theme->grid;
$layouts = $theme->grids['[your custom layout name]'];
$size_selector = [some selector criteria/request];
switch ($size_selector) {
case '1':
$layouts['layouts']['narrow']['enabled'] = FALSE;
break;
@tsavory
tsavory / css3-colums.js
Created June 5, 2012 20:06
Copy of CSS3MultiColumn
// CSS3MultiColumn - a javascript implementation of the CSS3 multi-column module
// v1.02 beta - Jan 08 2008
// Copyright (c) 2005 Cdric Savarese <pro@4213miles.com>
// Copyright (c) 2012 Gabriel Saldana <gabriel@gabrielsaldana.org>
// This software is licensed under the CC-GNU LGPL <http://creativecommons.org/licenses/LGPL/2.1/>
// For additional information, see : http://www.csscripting.com/
// Supported Properties:
// column-count
@tsavory
tsavory / sidebars
Created June 5, 2012 19:02
change sidebars columns depending on layout css
(function ($) {
Drupal.behaviors.yourfunction = {
attach: function(context) {
$('body', context).once('responsetoggle', function () {
$('body').bind('responsivelayout', function (e, d) {
if (d.to == 'narrow') {
@tsavory
tsavory / Navin Basse Css
Created June 5, 2012 06:46
added layer styles
css[navin-base.css][name] = 'Navin: Base'
css[navin-base.css][description] = 'This file contains the base page styling.'
css[navin-base.css][options][weight] = '10'
settings[alpha_css][navin-base.css] = 'navin-base.css'
css[navin-font.css][name] = 'Navin: Font'
css[navin-font.css][description] = 'This file contains the font stylings for the site.'
css[navin-font.css][options][weight] = '11'
settings[alpha_css][navin-font.css] = 'navin-font.css'
@tsavory
tsavory / global.css
Created May 8, 2012 21:42
Help fix css for nifelseki
/* This file will hold styles for the mobile version of your website (mobile first). */
/* This also can include ANY global CSS that applies site-wide. Unless overwritten by a more specific style rule, CSS declarations in global.css will apply site-wide. */
div#page{
background: url('/sites/default/files/images/main_bg.jpg') no-repeat;
background-attachment: fixed;
background-position: center top;
background-color: #153c63;
}
instructions on how to get the body field in the content region to have multiple columns