Skip to content

Instantly share code, notes, and snippets.

View mariohernandez's full-sized avatar
✌️

Mario Hernandez mariohernandez

✌️
View GitHub Profile
@mariohernandez
mariohernandez / .gitkeep
Last active March 24, 2024 19:55
Storybook demo files
We couldn’t find that file to show.
@mariohernandez
mariohernandez / story
Created March 21, 2024 17:43
Storybook Story Scafolding
import parse from 'html-react-parser';
// Imports decorators for background colors.
import { SantaBarbaraSandBg, VeniceCanalBg } from '../../../../.storybook/decorators';
import callout from './callout.twig';
import data from './callout.yml';
const settings = {
title: 'Components/Callout',
@mariohernandez
mariohernandez / attributes
Created March 21, 2024 17:11
Component wrapper with modifier and attributes
<article class="card{{ modifier ? ' ' ~ modifier }}{{- attributes ? ' ' ~ attributes.class -}}"
{{- attributes ? attributes|without(class) -}}>
@mariohernandez
mariohernandez / sdc
Created February 19, 2024 21:13
JSON Notation for SDC
# Everything in this file is optional. Still, the file needs to exist. Adding
# metadata here will improve the DX when using components.
# Note: currently in Drupal 10.1, the schema will fail to validate if
# props section is not present. This may change in a future release.
# This is so your IDE knows about the syntax for fixes and autocomplete.
$schema: https://git.drupalcode.org/project/sdc/-/raw/1.x/src/metadata.schema.json
# The human readable name.
{
"items": [
{
"title": "Home",
"url": "#",
"in_active_trail": false
},
{
"title": "About Us",
"url": "#",
@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
$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';
# 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
<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>
<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>