Skip to content

Instantly share code, notes, and snippets.

View aaronrobertshaw's full-sized avatar

Aaron Robertshaw aaronrobertshaw

View GitHub Profile
@aaronrobertshaw
aaronrobertshaw / block.json
Last active June 21, 2021 10:26
Group block.json with support for height and width enabled
{
"apiVersion": 2,
"name": "core/group",
"title": "Group",
"category": "design",
"description": "Combine blocks into a group.",
"keywords": [ "container", "wrapper", "row", "section" ],
"textdomain": "default",
"attributes": {
"tagName": {
@aaronrobertshaw
aaronrobertshaw / experimental-default-theme.json
Last active August 30, 2021 02:42
Theme.json with custom dimensions enabled
{
"version": 1,
"settings": {
"color": {
"palette": [
{
"name": "Black",
"slug": "black",
"color": "#000000",
"origin": "core"
@aaronrobertshaw
aaronrobertshaw / experimental-default-theme.json
Last active August 30, 2021 02:31
Theme JSON with dimensions supports enabled
{
"version": 1,
"settings": {
"color": {
"palette": [
{
"name": "Black",
"slug": "black",
"color": "#000000",
"origin": "core"
@aaronrobertshaw
aaronrobertshaw / block.json
Last active June 8, 2021 03:10
Group block with height dimension block support
{
"apiVersion": 2,
"name": "core/group",
"title": "Group",
"category": "design",
"description": "Combine blocks into a group.",
"keywords": [ "container", "wrapper", "row", "section" ],
"textdomain": "default",
"attributes": {
"tagName": {
@aaronrobertshaw
aaronrobertshaw / block.json
Created June 4, 2021 06:20
possible default control flag options
{
"apiVersion": 2,
"name": "core/group",
"title": "Group",
"category": "design",
"description": "Combine blocks into a group.",
"keywords": [ "container", "wrapper", "row", "section" ],
"textdomain": "default",
"attributes": {
"tagName": {
@aaronrobertshaw
aaronrobertshaw / block-support-hook-boilerplate.js
Last active June 3, 2021 07:10
Basic boilerplate for block support hook
/**
* WordPress dependencies
*/
import { getBlockSupport } from '@wordpress/blocks';
// 👀 Import whichever control components are required, UnitControl is a placeholder.
import { __experimentalUnitControl as UnitControl } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
/**
* Internal dependencies
@aaronrobertshaw
aaronrobertshaw / padding.js
Created May 31, 2021 09:32
Padding block support with disabled box control reset
/**
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { Platform } from '@wordpress/element';
import { getBlockSupport } from '@wordpress/blocks';
import {
__experimentalUseCustomUnits as useCustomUnits,
__experimentalBoxControl as BoxControl,
} from '@wordpress/components';
@aaronrobertshaw
aaronrobertshaw / experimental-default-theme.json
Last active May 24, 2021 08:48
Experimental theme.json with borders enabled prior to theme.json shape changes.
{
"settings": {
"defaults": {
"color": {
"palette": [
{
"name": "Black",
"slug": "black",
"color": "#000000"
},
@aaronrobertshaw
aaronrobertshaw / block.json
Created May 19, 2021 06:19
Site Title Block JSON - Skipping spacing support serialization
{
"apiVersion": 2,
"name": "core/site-title",
"title": "Site Title",
"category": "design",
"description": "Displays and allows editing the name of the site. The site title usually appears in the browser title bar, in search results, and more. Also available in Settings > General.",
"textdomain": "default",
"attributes": {
"level": {
"type": "number",
@aaronrobertshaw
aaronrobertshaw / block.json
Created May 19, 2021 06:02
Group Block JSON for skipping spacing serialization
{
"apiVersion": 2,
"name": "core/group",
"title": "Group",
"category": "design",
"description": "Combine blocks into a group.",
"keywords": [ "container", "wrapper", "row", "section" ],
"textdomain": "default",
"attributes": {
"tagName": {