Skip to content

Instantly share code, notes, and snippets.

View thejimbirch's full-sized avatar

Jim Birch thejimbirch

View GitHub Profile
{% if page.header %}
<nav class="navbar">
<div class="container-fluid">{{ page.header }}</div>
</nav>
{% endif %}
core: 8.x
type: theme
base theme: stable
name: 'Theme Name'
description: 'Theme Name is a custom theme based on Stable (not theme)'
regions:
page_top: 'Page Top'
page_bottom: 'Page Bottom'
global-styling:
version: 1.x
css:
base:
css/bootstrap.css: {}
js:
js/bootstrap.js: {}
dependencies:
- core/jquery
{% block content %}
{% if site_logo %}
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
Menu
</button>
<a class="navbar-brand" href="{{ path('<front>') }}" title="{{ site_name }}" rel="home">
<img src="{{ site_logo }}" alt="{{ site_name }}" />
</a>
<div id="navbar" class="collapse navbar-collapse">
{{ content }}
</div>
{{ menus.menu_links(items, attributes, 0) }}
{% macro menu_links(items, attributes, menu_level) %}
{% import _self as menus %}
{% if items %}
{% if menu_level == 0 %}
<ul class="nav navbar-nav">
{% else %}
<ul class="nav navbar-nav">
{% endif %}
@thejimbirch
thejimbirch / Bootstrap Drupal 8 Tabs - menu-local-task.html.twig
Last active February 26, 2017 23:42
Add these two files to your Bootstrap enambled theme at themes/custom/THEME/templates/navigation/
<li{{ attributes.addClass(is_active ? 'active') }}>{{ link }}</li>
@thejimbirch
thejimbirch / drupal-paragraph-multi-column.html.twig
Last active August 15, 2016 02:36
Simple Drupal Paragraph Template - Example Filename would be paragraph--MACHINE-NAME.html.twig
<div class="element element--layout-columns">
{{ content }}
</div>
{%- for item in items -%}
<div class="element--layout-columns__{{ loop.length }}col">{{ item.content }}</div>
{%- endfor -%}
/* -------------------------------------------------------------------------- */
/* Base Paragraph Styling. This is the BEM Block */
/* -------------------------------------------------------------------------- */
.element {
padding-top: @jumbotron-padding;
.make-sm-column(10);
.make-sm-column-offset(1);
.make-md-column(8);
.make-md-column-offset(2);