Skip to content

Instantly share code, notes, and snippets.

View himerus's full-sized avatar
🖥️
Creating big things with sharp tools...

Jake Strawn himerus

🖥️
Creating big things with sharp tools...
View GitHub Profile
@himerus
himerus / outline-container.full.html
Last active November 7, 2022 22:57
Description of usage for `outline-container` with the `container-width` set to `full`.
<outline-container container-width="full" top-margin="spacing-12" bottom-margin="spacing-12">
<outline-alert statusType="success" size="large">
<span slot="header">Container: Full</span>
<p>This `outline-container` component is using the `container-width` set to `full`.</p>
</outline-alert>
<outline-image image-href={code7} image-label="image of code on a screen" image-ratio="42/9"></outline-image>
</outline-container>
@himerus
himerus / tailwind.colors.json
Last active November 25, 2022 22:04
Tailwind CSS color variables in JSON format, ready for Amazon Style Dictionary.
{
"color": {
"slate": {
"50": { "value": "#f8fafc" },
"100": { "value": "#f1f5f9" },
"200": { "value": "#e2e8f0" },
"300": { "value": "#cbd5e1" },
"400": { "value": "#94a3b8" },
"500": { "value": "#64748b" },
"600": { "value": "#475569" },
@himerus
himerus / outline-widget.ts
Last active April 12, 2022 11:23
Sample code snippet for an extremely simple Lit2 Web Component with a hard coded render function.
import { html, css, CSSResultGroup, TemplateResult } from 'lit';
import { OutlineElement } from '../outline-element/outline-element';
import { customElement } from "lit/decorators.js";
/**
* The Outline Widget Component
*
* @element OutlineWidget
* @extends OutlineElement
*/
@himerus
himerus / outline-button.css
Created March 26, 2022 12:32
Updated `outline-button.css` replacing all Tailwind classes with CSS Variables
:host {
/* flex and border-radius constrain the actual boundaries of the element,
preventing literal edge cases where a user can click on the edge or corner of the button and defeat states like disabled */
display: inline-flex;
border-radius: var(--spacing-2);
vertical-align: middle;
}
.btn {
display: flex;
@himerus
himerus / Blocks.md
Created May 14, 2020 14:38 — forked from bdlangton/Blocks.md
Drupal 8 programmatic solutions

Render custom blocks

$bid = 'myblock';
$block = \Drupal\block_content\Entity\BlockContent::load($bid);
$render = \Drupal::entityTypeManager()->getViewBuilder('block_content')->view($block);

Render plugin blocks

$block_manager = \Drupal::service('plugin.manager.block');
@himerus
himerus / nodemaker_term_create.php
Created January 21, 2017 11:38
Create a taxonomy term programmatically in Drupal 8.
<?php
/**
* @file
* Contains various helper functions.
*/
use Drupal\taxonomy\Entity\Term;
/**
@himerus
himerus / nodemaker_vocabulary_delete.php
Last active January 22, 2017 22:15
Uninstall a taxonomy vocabulary programmatically in Drupal 8.
<?php
/**
* @file
* Contains various helper functions.
*/
use Drupal\taxonomy\Entity\Vocabulary;
/**