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 %}
.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 {
{#
/**
* @file
* Theme override to display a menu.
*
* Available variables:
* - menu_name: The machine name of the menu.
* - items: A nested list of menu items. Each menu item contains:
* - attributes: HTML attributes for the menu item.
* - below: The menu item child items.
items:
- title: 'Home'
url: '#'
menu_level: 0
- title: 'About Us'
url: '#'
menu_level: 0
below:
- title: 'Our Team'
url: '#'
{%
set classes = [
'block',
'block-' ~ configuration.provider|clean_class,
'block-' ~ plugin_id|clean_class,
]
%}
{% set attributes = attributes.addClass(classes) %}
{% embed '@sixflags_theme/main-menu/main-menu.twig' with {
attributes: attributes,
{{ 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 %}
{% 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 %}
<ul{{ attributes }}>
{% else %}
<!-- THEME DEBUG -->
<!-- THEME HOOK: 'menu__main' -->
<!-- FILE NAME SUGGESTIONS:
* menu--main.html.twig
x menu.html.twig
-->
<!-- BEGIN OUTPUT from 'core/themes/stable/templates/navigation/menu.html.twig' -->
<nav class="main-menu">
<ul class="main-menu__items">
{% for item in items %}
<li class="main-menu__item{{ item.below ? ' has-submenu' }}">
<a class="main-menu__item--link" href="{{ item.url }}">
{{ item.title }}
</a>
{% if item.below %}
<ul class="main-menu__sub-menu" id="main-menu">
{% for sublink in item.below.items %}
@mariohernandez
mariohernandez / movie-card.scss
Created February 3, 2019 02:58
Movie card styles
// Import site utilities.
@import '../../global/utils/init';
.movie-card {
background: $color-black;
color: $color-white;
height: 250px;
max-width: 420px;
overflow: hidden;
position: relative;