Skip to content

Instantly share code, notes, and snippets.

View jacine's full-sized avatar
😁

Jacine Luisi jacine

😁
View GitHub Profile
{
"rules": {
// http://stylelint.io/user-guide/rules/
// http://stylelint.io/user-guide/example-config/
"at-rule-empty-line-before": "never",
"at-rule-name-case": "lower",
"at-rule-name-space-after": "always-single-line",
"at-rule-no-vendor-prefix": true,
"at-rule-semicolon-newline-after": "always",
"block-closing-brace-newline-after": "always-multi-line",
options:
formatter: stylish
files:
include: '**/*.s+(a|c)ss'
# ignore:
rules:
# Extends
extends-before-mixins: 1
extends-before-declarations: 1
placeholder-in-extend: 1
libraries-override:
contextual/drupal.contextual-links:
css:
component:
/core/modules/contextual/css/contextual.module.css: false
theme:
/core/modules/contextual/css/contextual.theme.css: css/overrides/contextual.theme.css
/core/modules/contextual/css/contextual.icons.theme.css: false
@jacine
jacine / .theme.php
Last active July 6, 2016 18:46
HTML in menu items D8
<?php
/**
* Implements hook_preprocess_menu().
*/
function THEME_preprocess_menu(&$vars, $hook) {
if ($hook == 'menu__main') {
$items = $vars['items'];
foreach ($items as $key => $item) {
$original_title = $vars['items'][$key]['title'];
@jacine
jacine / theming-hell.php
Last active July 6, 2016 21:50
Give me my HTML in my Drupal 8 menu links!
<?php
/**
* Implements hook_preprocess_menu().
*/
function THEME_preprocess_menu(&$vars, $hook) {
if ($hook == 'menu__account') {
$items = $vars['items'];
foreach ($items as $key => $item) {
if ($key == 'user.page') {
@jacine
jacine / setup.md
Last active September 24, 2016 15:14
Drupal 8 setup

Drupal 8 Setup

  1. Copy sites/default/default.settings.php, renaming to sites/default/settings.local.php.
  2. Copy sites/default/development.services.yml, renaming to sites/default/services.yml.

Changes in settings.local.php:

@todo Write out details. https://gist.github.com/jacine/4520c74beb5b77ef5af8

parameters:
session.storage.options:
# Default ini options for sessions.
#
# Some distributions of Linux (most notably Debian) ship their PHP
# installations with garbage collection (gc) disabled. Since Drupal depends
# on PHP's garbage collection for clearing sessions, ensure that garbage
# collection occurs by using the most common settings.
# @default 1
gc_probability: 1
@jacine
jacine / mytheme.theme.php
Last active April 19, 2016 17:45
Theme Environment Settings
<?php
/**
* @file
* mytheme.theme
*/
use Drupal\Core\Site\Settings;
function mytheme_css_alter(&$css) {
@jacine
jacine / fail.md
Created April 12, 2016 20:05
Twig FAIL

Twig FAIL

Symptoms

  • Nothing in the PHP, Apache or MySQL logs (broken locally - MAMP-PHP7, AND on dev - Pantheon).
  • No errors on screen either (they're configured in php.ini and settings.local.php)

Things I tried

  • Tried multiple cache rebuilds.