Skip to content

Instantly share code, notes, and snippets.

View mwood23's full-sized avatar
🚀
Building products

Marcus Wood mwood23

🚀
Building products
View GitHub Profile
@mwood23
mwood23 / shadowStyler.js
Created August 24, 2023 18:03
Web Component Shadow Root Pierer
class ShadowStyler {
constructor(componentName) {
this.componentName = componentName;
this.element = document.querySelector(this.componentName);
this.shadowRoot = this.element?.shadowRoot;
}
setStyle(selector, styles) {
if (this.shadowRoot) {
this._applyStyle(selector, styles);
@mwood23
mwood23 / NumberInput.tsx
Last active August 17, 2023 21:53
Better Shopify Polaris Input
import { TextField, TextFieldProps } from "@shopify/polaris";
import React, {
ChangeEvent,
KeyboardEvent,
useCallback,
useEffect,
useState,
} from "react";
type NumberInputCommonProps = Omit<
@mwood23
mwood23 / gist:e605ebdf9579cd84b34bc3a6aae7247a
Created August 8, 2023 05:49
Gadget Dark Mode Editor Theme
// ==UserScript==
// @name New script - gadget.app
// @namespace Violentmonkey Scripts
// @match https://packagepal.gadget.app/edit/*
// @grant none
// @version 1.0
// @author -
// @description 8/7/2023, 11:16:28 PM
// ==/UserScript==
@mwood23
mwood23 / universalLintRules.json
Created March 21, 2023 04:13
Lint rules used in Tamagui universal development
{
"rules": {
"no-restricted-imports": [
"error",
{
"paths": [
{
"name": "next/router",
"message": "Not universal. Use solito/router instead."
},
@mwood23
mwood23 / button.tsx
Created January 24, 2023 07:26
Tamagui Button With Multiple Variants
import {
Stack,
styled,
GetProps,
themeable,
TamaguiElement,
VariantSpreadFunction,
} from '@tamagui/core'
import { Text } from './text'
import { forwardRef } from 'react'