Skip to content

Instantly share code, notes, and snippets.

View thejimbirch's full-sized avatar

Jim Birch thejimbirch

View GitHub Profile
@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
@thejimbirch
thejimbirch / drupal-field-bootstrap-carousel.html.twig
Last active June 24, 2020 11:55
Drupal Field Twig Template for creating a Bootstrap Carousel
@thejimbirch
thejimbirch / drupal-paragraph-bootstrap-carousel.html.twig
Last active October 16, 2016 11:21
Drupal Paragraph Twig Template for creating a Bootstrap Carousel
@thejimbirch
thejimbirch / select.html.twig
Created August 18, 2016 22:51
Styling Exposed View Forms in Drupal 8 - Twig Template
{#
/**
* @file
* Theme override for a select element.
*
* Available variables:
* - attributes: HTML attributes for the select tag.
* - options: The option element children.
*
* @see template_preprocess_select()