Skip to content

Instantly share code, notes, and snippets.

View zslabs's full-sized avatar

Zach Schnackel zslabs

View GitHub Profile
@zslabs
zslabs / getComponents.js
Created April 22, 2022 17:18 — forked from steveruizok/getComponents.js
Get components and styles (as full nodes) from a Figma file.
async function getComponents(fileKey, token) {
// Get file
const file = await fetch(`https://api.figma.com/v1/files/${fileKey}`, {
headers: { "X-Figma-Token": token }
}).then((r) => r.json())
if (file.err === undefined) {
// Get style ids
const styleIds = Object.keys(file.styles)
@zslabs
zslabs / StylesContext.tsx
Created December 16, 2021 16:09 — forked from alexkuz/StylesContext.tsx
Styled Components in Remix
import { createContext } from 'react';
import { ServerStyleSheet } from 'styled-components';
export default createContext<{
styles: React.ReactNode[];
renderMode: 'head' | 'body' | 'all';
}>({ styles: [], renderMode: 'all' });
<?php
add_theme_support('menus');
/*
http://codex.wordpress.org/Function_Reference/register_nav_menus#Examples
*/
register_nav_menus( array(
'main-menu' => 'Main Menu' // registers the menu in the WordPress admin menu editor
) );