Skip to content

Instantly share code, notes, and snippets.

View sarahbethfederman's full-sized avatar

Sarah Federman sarahbethfederman

View GitHub Profile
@sarahbethfederman
sarahbethfederman / SketchSystems.spec
Last active September 4, 2023 08:04
Contrast category open
Contrast category open
Card Displayed
Color A does not contrast with color B*
Generating suggested colors
Loaded -> Suggested colors shown
Suggested colors shown
pick suggested color -> Color A has sufficient contrast with color B
change color A -> Checking Color A with Color B
change color B -> Checking Color A with Color B
move element -> Checking Color A with Color B
Issues
First State
some event -> Second State
Second State
function render(model){
let current_state_name = model.active_states[0].name;
return $("h1",
{style: {color: "darkBlue"}},
`The current state is: ${current_state_name}`);
}
@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';
// // 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 / package.json
Last active September 21, 2020 05:19
peer-dep
dependencies: {
"myPackageThatDependsOnReact": "^1.0.0",
"react": "16.0.0"
}
@sarahbethfederman
sarahbethfederman / package.json
Last active September 21, 2020 05:19
yarn-resolution-hack
"resolutions": {
"foo": "1.4.9"
}
@sarahbethfederman
sarahbethfederman / package.json
Last active September 21, 2020 05:20
yarn-resolution-2
"resolutions": {
"foo": "1.4.9"
}
@sarahbethfederman
sarahbethfederman / package.json
Last active September 21, 2020 05:20
yarn-resolutions-1
"resolutions": {
"babel/foo": "1.4.9",
}
@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"