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 / 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 / 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 / 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
$path = \Drupal::request()->getPathInfo();
if($path){
$foo = explode("/", $path);
$body_classes[] = 'path-' . $foo[1];
}
@mortendk
mortendk / Gruntfile.js
Created May 28, 2014 15:45
grunt file for styleguide etc
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
//clean folders
clean: {
styleguide: ['styleguide'],
css: ['css'],
// images:['images']
},
@mortendk
mortendk / gist:923a97fd553fa602cc35
Created August 4, 2015 19:20
force drupal to test on classy
function testMessages() {
// Enable the Classy theme.
\Drupal::service('theme_handler')->install(['classy']);
$this->config('system.theme')->set('default', 'classy')->save();
....
@mortendk
mortendk / gist:1358113
Created November 11, 2011 14:26
book.theme.css
.book-navigation .menu {
border-top: 1px solid #D6D6D6;
padding: 1em 0 0 3em; /* LTR */
}
.book-navigation .page-links {
border-bottom: 1px solid #D6D6D6;
border-top: 1px solid #D6D6D6;
letter-spacing: -3px; /* removes the inline-block letter-spacing on the .page-links list elements */
margin: 0;
padding: 0.5em 0;
@mortendk
mortendk / dabblet.css
Created December 22, 2011 23:16
checkbox checked
/**
* checkbox checked
*/
div{display:inline-block;padding-top:100px}
label{ padding:15px; margin:50px; border-radius:10px; font-size:50px}
input[type=radio]{ position: absolute; top: -9999px; left: -9999px; }
input[type=radio] ~ label { background:red;}
input[type=radio]:checked ~ label { background:green;}
@mortendk
mortendk / dabblet.css
Created December 28, 2011 12:28
css input checkbox
/**
* The first commented line is your dabblet’s title
*/
input[type=checkbox]{
position: absolute;
top: -9999px;
left: -9999px;
}
input[type=checkbox] ~ label { background:red;}
@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>