Skip to content

Instantly share code, notes, and snippets.

View thejimbirch's full-sized avatar

Jim Birch thejimbirch

View GitHub Profile
@thejimbirch
thejimbirch / paragraph--xeno-hero.html.twig
Created April 23, 2017 23:46
Partial section of Xeno Hero Drupal 8 Paragraphs Template
{# Prints div with classes, & content w/o img/invert/overlay/parallax fields. #}
<div{{ attributes.addClass(classes).setAttribute('data-overlay', overlay_levels).setAttribute('data-speed', parallax_speeds) }}>
{% if content.xeno_background_image|render %}
<div class="paragraph--type--xeno-hero__image">
{{ content.xeno_background_image }}
</div>
{% endif %}
{{ content|without('xeno_background_image', 'xeno_invert', 'xeno_overlay', 'xeno_parallax') }}
</div>
@thejimbirch
thejimbirch / Gruntfile-bootstrap-3.js
Last active December 16, 2019 03:29
Bootstrap 3 and 4 Gruntfiles with copy functions to move and rename files into a Drupal or Wordpress theme. Replace SITENAME with your site or theme name.
/*!
* Bootstrap's Gruntfile
* http://getbootstrap.com
* Copyright 2013-2016 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
module.exports = function (grunt) {
'use strict';
@thejimbirch
thejimbirch / paragraph--carousel.html.twig
Created October 21, 2016 17:54
Drupal 8 Template for Bootstrap Paragraphs customized for Carousel.
@thejimbirch
thejimbirch / field--paragraph--field-column-content.html.twig
Created October 21, 2016 17:33
Drupal 8 Template for Bootstrap Paragraphs Column field.
{#
/**
* @file
* Overrides field template to add column class based on loop length.
*
* To override output, copy the "field.html.twig" from the templates directory
* to your theme's directory and customize it, just like customizing other
* Drupal templates such as page.html.twig or node.html.twig.
*
* Instead of overriding the theming for all fields, you can also just override
@thejimbirch
thejimbirch / bootstrap-paragraphs.less
Created October 21, 2016 17:30
Drupal 8 LESS file for Paragraphs customized for Width and Background color fields.
/* -----------------------------------------------------------------------------
Paragraph Section CSS.
The following classes are available if the different Paragraph types
need their own individual styling.
.paragraph.paragraph--type--blank {}
.paragraph.paragraph--type--carousel {} -- Is used below
.paragraph.paragraph--type--columns {} -- Is used below
@thejimbirch
thejimbirch / bootstrap-paragraphs.css
Created October 21, 2016 17:29
Drupal 8 CSS file for Paragraphs customized for Width and Background color fields.
/* -----------------------------------------------------------------------------
Paragraph Section CSS.
The following classes are available if the different Paragraph types
need their own individual styling.
.paragraph.paragraph--type--blank {}
.paragraph.paragraph--type--carousel {} -- Is used below
.paragraph.paragraph--type--columns {} -- Is used below
@thejimbirch
thejimbirch / bootstrap-paragraphs-colors.css
Created October 21, 2016 17:28
Drupal 8 CSS file for Paragraphs customized for Width and Background color fields.
/* RGBA Colors from http://mdbootstrap.com/css/colors/#rgba-colors */
.paragraph--color--rgba-blue-light {
background: rgba(3, 169, 244, 0.3);
}
.paragraph--color--rgba-red-light {
background: rgba(244, 67, 54, 0.3);
}
@thejimbirch
thejimbirch / paragraph--default.html.twig
Last active March 22, 2021 18:29
Drupal 8 Template for Bootstrap Paragraphs customized for Width and Background color fields.
{#
/**
* @file
* Default theme implementation to display a paragraph in Bootstrap Paragraphs.
*
* Available variables:
* - paragraph: Full paragraph entity.
* - id: The paragraph ID.
* - bundle: The type of the paragraph, for example, "image" or "text".
* - authorid: The user ID of the paragraph author.
/* -------------------------------------------------------------------------- */
/* Extends: */
/* https://gist.github.com/thejimbirch/5b6b9ceb6e597a48f330e02edd8bcb49 */ */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/* Here we add Width Modifiers */
/* -------------------------------------------------------------------------- */
/* Adds Width Element -- Medium */
@thejimbirch
thejimbirch / drupal-7-field-bootstrap-carousel.html.php
Created August 28, 2016 22:09
Drupal 7 Field Template for creating a Bootstrap Carousel