Skip to content

Instantly share code, notes, and snippets.

View mortendk's full-sized avatar
🤠
git commit -m "yolo"

mortendk mortendk

🤠
git commit -m "yolo"
View GitHub Profile
@mortendk
mortendk / theme.inc
Created April 22, 2014 19:41
merging attributes
$variables['attributes']['class'] = 'test-attribute-merge-1';
$variables['content_attributes']['class'] ='test-content_attributes-merge-2';
$variables['attributes']['role'] = 'attributes-role';
$variables['content_attributes']['role'] = 'content_attributes-role';
$variables['title_attributes']['role'] = 'title-attributes-role';
$variables['item_attributes']['0']['role'] = 'item-attributes-role';
//wtf why u not merge
@mortendk
mortendk / gruntfile.js
Created April 18, 2014 00:40
styleguide grunt kss
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
//clean
clean: {
styleguide: ['styleguide'],
css: ['css']
},
//copy
@mortendk
mortendk / menu--level.html.twig
Created April 12, 2014 15:26
drupal8 menu dummy idea
{# level one
menu--level.html.twog
#}
{% if menu_level = 1 %}
<nav class="menu menu-{{ menu-name}}">
{% endif %}
<ul class="level-{{ menu_level }}">
{% for item in items %}
@mortendk
mortendk / field--image.html.twig
Created September 18, 2013 15:06
field image twig
{# title wtf is this called label btw #}
{% if not label_hidden %}
<h3 {{ title_attributes }}>{{ label }}:&nbsp;</h3>
{% endif %}
{% for delta, item in items %}
{% if loop.length > 1 %} {# no wrappers if theres only 1 item#}
<section class="images" {{ content_attributes }}> {# wanna do a print all attributes but no class #}
<!doctype html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width; initial-scale=1.0">
<title>mobile & drop down menu</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
<script>
jQuery(document).ready(function($){
@mortendk
mortendk / _tooltip.scss
Created October 15, 2012 10:14
tooltip forms drupal
//tooltips for forms
form.tooltip{
small,
.description{
text-align:left;
width:200px;
color: white;
background: #666;
@include border-radius(2px);
@mortendk
mortendk / _menu_dropdown.scss
Created October 15, 2012 10:13
dropdown css
/*
This will create a dropdown build on clean mean css
*/
/* -- Dropdown Structure ------------------------------------------------------------------ */
.dropdown { position: relative;}
.dropdown a{ display:block;}
.dropdown ul li{ float:left; position:relative; list-style:none;}
/* lvl 2 : hide the ul & bring it back on hover */
.dropdown ul li ul{ left:-99999px; position:absolute; z-index:9999; margin:0; background:transparent;}
@mortendk
mortendk / breadcrump.twig
Created October 7, 2012 17:32
twig breadcrumbs
{#
/**
* @file
* Returns HTML for a breadcrumb trail.
*
* @param $variables
* An associative array containing:
* - breadcrumb: An array containing the breadcrumb links.
*
* @ingroup themeable
@mortendk
mortendk / themename.info
Created September 2, 2012 18:50
drupal: theme.info foad
;-------------- CSS FOAD -------------
;stylesheets[all][] = donteverloadmeagain.css
stylesheets[all][] = system.theme.css
stylesheets[all][] = system.menus.css
stylesheets[all][] = system.messages.css
stylesheets[all][] = jquery.ui.theme.css
stylesheets[all][] = user.css
stylesheets[all][] = field.css
stylesheets[all][] = node.css
stylesheets[all][] = comment.css
@mortendk
mortendk / gist:1684056
Created January 26, 2012 17:59
html aside as comment wrapper
<article class="node">
<h1>node bla bla bla</h1>
<footer>author</footer>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud </p>
<!-- id for a anchor-->
<section id="comments"><!--aside ?-->
<article>
<h3>first post</h3>