Skip to content

Instantly share code, notes, and snippets.

View mariohernandez's full-sized avatar
✌️

Mario Hernandez mariohernandez

✌️
View GitHub Profile
{% import _self as menus %}
{{ menus.main_menu(items, attributes, 0) }}
{% macro main_menu(items, attributes, menu_level) %}
{% import _self as menus %}
{% if items %}
{% if menu_level == 0 %}
<ul{{ attributes }}>
{% else %}
<ul>
<li>
<a href="#">Top level link</a>
</li>
<li>
<a href="#">Top level link</a>
<ul>
<li>
<a href="#">First submenu link</a>
<ul>
<nav class="main-menu">
<ul class="main-menu__list">
<li class="main-menu__item main-menu__item--level-0">
<a href="/" class="main-menu__link">About Us</a>
</li>
<li class="main-menu__item main-menu__item--level-0">
<a href="#" class="main-menu__link">Our Services</a>
<ul class="main-menu__submenu">
<li class="main-menu__item main-menu__item--level-1">
<a href="#" class="main-menu__link">Training</a>
items:
- title: 'Home'
url: '#'
menu_level: 0
- title: 'About Us'
url: '#'
menu_level: 0
below:
- title: 'Our Team'
url: '#'
# Custom configuration for Stylelint.
#
# Preset all items to warning to prevent breaking themes.
# Delete line to activate linter build-breaking errors.
defaultSeverity: warning
# Plugins integrated.
plugins:
- stylelint-scss
$settings['container_yamls'][] = DRUPAL_ROOT . '/sites/development.services.yml';
$config['system.performance']['css']['preprocess'] = FALSE;
$config['system.performance']['js']['preprocess'] = FALSE;
$settings['cache']['bins']['render'] = 'cache.backend.null';
$settings['cache']['bins']['dynamic_page_cache'] = 'cache.backend.null';
$settings['cache']['bins']['page'] = 'cache.backend.null';
@mariohernandez
mariohernandez / .ddev-docker-compose-patternlab.yaml
Last active June 19, 2020 18:23
patternlab docker-compose*.yaml
# docker-compose.patternlab.com to pass port 3000 inside the container
# to https://<something>.ddev.site:3001
version: '3.6'
services:
web:
ports:
# Expose port 3000 for the patternlab app
- "3001"
environment:
# Override the web container's standard HTTP_EXPOSE and HTTPS_EXPOSE
{
"items": [
{
"title": "Home",
"url": "#",
"in_active_trail": false
},
{
"title": "About Us",
"url": "#",
{{ attach_library('your-namespace-here/navigation') }}
{% import _self as menus %}
{{ menus.menu_links(items, attributes, 0) }}
{% macro menu_links(items, attributes, menu_level) %}
{% import _self as menus %}
{% if items %}
{% if menu_level == 0 %}
.navigation__menu {
background-color: #fff;
list-style-type: none;
margin: 0;
padding: 0;
position: relative;
z-index: 20;
// Align top level list items in a row using flexbox.
&.navigation--level-1 {