Skip to content

Instantly share code, notes, and snippets.

View CedricAlb's full-sized avatar
🏄
open source vibes

Cédric Albrecht CedricAlb

🏄
open source vibes
View GitHub Profile
@CedricAlb
CedricAlb / DrupalCallback.php
Created April 20, 2022 08:11 — forked from purushotamrai/DrupalCallback.php
Implementing Custom Pagination without Drupal Entity Query - Drupal 8
<?php
namespace Drupal\custom_module\Controller;
use Drupal\Core\Controller\ControllerBase;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\Core\Pager\PagerManagerInterface;
class ListNonDrupalItems extends ControllerBase {
@CedricAlb
CedricAlb / d8-deploy-content-block.php
Last active May 24, 2018 14:14
Deploy content blocks on another Drupal 8 instance
<?php
/**
* @file custom_module.install
* Install, update and uninstall functions for the custom module.
*/
/**
* Implements hook_update_N().
* installs some content blocks
@CedricAlb
CedricAlb / d8-link-in-modal.html
Created October 16, 2017 09:43
Creating a modal in Drupal 8 with one line of HTML
@CedricAlb
CedricAlb / d8-code-module-install.php
Created October 16, 2017 09:25
Programmatically install Drupal 8 module
<?php
// from https://www.millwoodonline.co.uk/quicktips/programmatically-install-drupal-module
\Drupal::service('module_installer')->install(['workspace']);
@CedricAlb
CedricAlb / dabblet.css
Created March 20, 2016 08:31
Elegant and accessible content toggle with CSS. * * 1. Hides the toggle, as it can be toggled through the label thanks to the id/for combo. * 2. Hides the toggled content when not following a checked toggled. * * Courtesy to H5BP for the visually hidden ruleset: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css#L119).
/** * Elegant and accessible content toggle with CSS. * * 1. Hides the toggle, as it can be toggled through the label thanks to the id/for combo. * 2. Hides the toggled content when not following a checked toggled. * * Courtesy to H5BP for the visually hidden ruleset: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css#L119). */.toggle, /* 1 */.toggle:not(:checked) ~ .toggled /* 2 */ { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px;}.toggle:focus ~ label { color: deeppink;}/** Demo styles, not interesting. **/body { max-width: 600px; margin: 2em auto; background: #FDFDFD; padding: 1em;}label { border: 1px solid; padding: 5px; cursor: pointer;}
@CedricAlb
CedricAlb / dabblet.css
Created March 3, 2016 10:01
Elegant and accessible content toggle with CSS. * * 1. Hides the toggle, as it can be toggled through the label thanks to the id/for combo. * 2. Hides the toggled content when not following a checked toggled. * * Courtesy to H5BP for the visually hidden ruleset: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css#L119).
/** * Elegant and accessible content toggle with CSS. * * 1. Hides the toggle, as it can be toggled through the label thanks to the id/for combo. * 2. Hides the toggled content when not following a checked toggled. * * Courtesy to H5BP for the visually hidden ruleset: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css#L119). */.toggle, /* 1 */.toggle:not(:checked) ~ .toggled /* 2 */ { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px;}.toggle:focus ~ label { color: deeppink;}/** Demo styles, not interesting. **/body { max-width: 600px; margin: 2em auto; background: #FDFDFD; padding: 1em;}label { border: 1px solid; padding: 5px; cursor: pointer;}
@CedricAlb
CedricAlb / dabblet.css
Last active August 29, 2015 14:14
floating alignment
/**
* floating alignment
*/
.product {
width: 220px;
background-color: #eee;
}
.title,
.store {
@CedricAlb
CedricAlb / dabblet.css
Created August 1, 2013 19:24
Scrolling shadows by @kizmarh and @LeaVerou
/**
* Scrolling shadows by @kizmarh and @leaverou
* Only works in browsers supporting background-attachment: local; & CSS gradients
* Degrades gracefully
*/
html {
background: white;
font: 120% sans-serif;
}
@CedricAlb
CedricAlb / dabblet.css
Created August 1, 2013 19:19
Scrolling shadows by @kizmarh and @LeaVerou
/**
* Scrolling shadows by @kizmarh and @leaverou
* Only works in browsers supporting background-attachment: local; & CSS gradients
* Degrades gracefully
*/
html {
background: white;
font: 120% sans-serif;
}
@CedricAlb
CedricAlb / dabblet.css
Created August 1, 2013 19:06
Scrolling shadows by @kizmarh and @LeaVerou
/**
* Scrolling shadows by @kizmarh and @leaverou
* Only works in browsers supporting background-attachment: local; & CSS gradients
* Degrades gracefully
*/
html {
background: white;
font: 120% sans-serif;
}