Skip to content

Instantly share code, notes, and snippets.

View victorpavlov's full-sized avatar

Victor Pavlov victorpavlov

View GitHub Profile
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
/* Styles */
}
/* Smartphones (landscape) ----------- */
@media only screen
and (min-width : 321px) {
::-webkit-input-placeholder { color:#f00; } /* Chrome/Safari */
::-moz-placeholder { color:#f00; } /* Firefox */
:-ms-input-placeholder { color:#f00; } /* for IE */
input:-moz-placeholder { color:#f00; } /* Basic/default declaration */
#name::-webkit-input-placeholder { color:#00f; margin-left:20px; } /* for an input having the ID 'name' */
/* * Mixin for basic CSS triangles * @include triangle(up, #000, 50px) */
@mixin triangle($direction:up, $color:#000, $size:100px) {
@if($direction == up) {
border-color: transparent transparent $color;
border-style: solid;
border-width: 0 $size $size;
height: 0;
width: 0;
}
@if($direction == down) {
<?php
function YOURTHEME_form_alter(&$form, &$form_state, $form_id) {
if ($form_id == 'search_block_form') {
$form['search_block_form']['#title'] = t('Search'); // Change the text on the label element
$form['search_block_form']['#title_display'] = 'invisible'; // Toggle label visibilty
$form['search_block_form']['#size'] = 40; // define size of the textfield
$form['search_block_form']['#default_value'] = t('Search'); // Set a default value for the textfield
$form['actions']['submit']['#value'] = t('GO!'); // Change the text on the submit button
$form['actions']['submit'] = array('#type' => 'image_button', '#src' => base_path() . path_to_theme() . '/images/search-button.png');
// Add extra attributes to the text box
git push origin `git rev-parse --abbrev-ref HEAD`
element.onclick = function(event) {
event = event || window.event
if (event.preventDefault) { // if method exist
event.preventDefault();
} else { // variant for IE<9:
event.returnValue = false;
}
// Can be shortcuted
// event.preventDefault ? event.preventDefault() : (event.returnValue=false);
<?php
function THEME_preprocess_page(&$vars, $hook) {
if (isset($vars['node']->type)) {
// If the content type's machine name is "my_machine_name"
//the file name will be "page--my-machine-name.tpl.php".
$vars['theme_hook_suggestions'][] = 'page__' . $vars['node']->type;
}
}
?>
html {
font-size: 62.5%; /* 1 */
}
@function parseInt($n) { /* 2 */
@return $n / ($n * 0 + 1);
}
@mixin rem($property, $values) {
$px : (); /* 3 */
@victorpavlov
victorpavlov / drush-vset-theme_debug
Created March 18, 2015 16:02
Set theme debug info by Drush comand
drush vset theme_debug 1