Skip to content

Instantly share code, notes, and snippets.

View sarahbethfederman's full-sized avatar

Sarah Federman sarahbethfederman

View GitHub Profile
@sarahbethfederman
sarahbethfederman / yarn.lock
Last active September 21, 2020 05:20
yarn-lock-update-1
"pkg-a@1.1.0"
version "1.1.0"
dependencies:
pkg-b "^2.1.0"
"pkg-c@1.0.0"
version "1.0.0"
dependencies:
pkg-b "^2.0.0"
@sarahbethfederman
sarahbethfederman / yarn.lock
Last active September 21, 2020 05:21
yarn-lock-install
"pkg-a@1.0.0"
version "1.0.0"
dependencies:
pkg-b "^2.0.0"
"pkg-c@1.0.0"
version "1.0.0"
dependencies:
pkg-b "^2.0.0"
@sarahbethfederman
sarahbethfederman / yarn.lock
Last active September 21, 2020 05:21
yarn-lock-101-3
"pkg-a@<VERSION_RANGE>"
version: version of pkg-a that we resolve to
dependencies:
pkg-b: the range that is specified in pkg-a's package.json
"pkg-b@<VERSION_RANGE>"
version: the version that packages depending on pkg-b@<VERSION-RANGE> get
"pkg-b@<INCOMPATIBLE_VERSION_RANGE>"
@sarahbethfederman
sarahbethfederman / yarn.lock
Last active September 21, 2020 05:21
yarn-lock-101-2
"pkg-a@<VERSION_RANGE>"
version: version of pkg-a that we resolve to
dependencies:
pkg-b: the range that is specified in pkg-a's package.json
"pkg-b@<VERSION_RANGE>, pkg-b@<COMPATIBLE_VERSION_RANGE>"
version: the version that packages depending on pkg-b get
@sarahbethfederman
sarahbethfederman / yarn.lock
Last active September 21, 2020 05:22
Yarn-locks-101-1
"pkg-a@<VERSION_RANGE>"
version: version of pkg-a that we resolve to, aka what ends up being bundled
dependencies:
pkg-b: the range that is specified in pkg-a's package.json
"pkg-b@<VERSION_RANGE>"
version: the version that packages depending on pkg-b@<VERSION_RANGE> get
@sarahbethfederman
sarahbethfederman / yarn.lock
Last active September 21, 2020 05:23
yarn-lock-dedupe
"pkg-a@1.1.0"
version "1.1.0"
dependencies:
pkg-b "^2.1.0"
"pkg-c@1.0.0"
version "1.0.0"
dependencies:
pkg-b "^2.0.0"
// // LUI Next Colors
// // LUI Now colors live in @lendi-ui/color package
import hexToRgba from 'hex-to-rgba';
export const isHex = (str: string) => str.match(/^#(?:[0-9a-fA-F]{3}){1,2}$/);
type Shade = Partial<950 | 900 | 800 | 700 | 600 | 500 | 400 | 300 | 200 | 100 | 50 | 25 | 0>;
type Format = 'hexadecimal' | 'rgba';
type Category = 'primary' | 'secondary' | 'success' | 'error' | 'warning' | 'info' | 'shade' | 'focus';
type ColorObject = Partial<{ [key in Shade]: { value: string; format: Format } }>;
@sarahbethfederman
sarahbethfederman / RichTextRenderer.js
Last active May 12, 2021 17:56
Using contentful with gatsby and react
import React from 'react';
import { Link as GatsbyLink } from 'gatsby';
import * as deepmerge from 'deepmerge';
import { INLINES, BLOCKS, MARKS } from '@contentful/rich-text-types';
import { documentToJSX } from './../scripts/documentToJSX';
import { getEntry } from './../scripts/getContentfulEntry';
const Link = ({ children, to, activeClassName, ...other }) => {
const internal = /^\/(?!\/)/.test(to);
@sarahbethfederman
sarahbethfederman / flexgap.tsx
Created May 6, 2021 06:43
Flex gap polyfill
import { useState, useLayoutEffect, useEffect } from 'react';
// remove this once safari support ships
function checkFlexGap() {
// create flex container with row-gap set
const flex = document.createElement('div');
flex.style.display = 'flex';
flex.style.flexDirection = 'column';
flex.style.rowGap = '1px';
Issues
First State
some event -> Second State
Second State