Skip to content

Instantly share code, notes, and snippets.

View piotrekwitkowski's full-sized avatar

piotrekwitkowski

View GitHub Profile
@sladg
sladg / AmazingDiv.tsx
Created July 27, 2022 14:12
Div wrapper with improved functions for mobile and desktop
import React, { PropsWithChildren, useEffect, useRef, CSSProperties } from 'react'
import { logger } from 'utils/logger'
export type CustomMouseEvent = React.MouseEvent<HTMLDivElement, MouseEvent>
export type CustomTouchEvent = React.TouchEvent<HTMLDivElement>
const MOUSE_MOVE_DELTA = 20
const TOUCH_MOVE_DELTA = 30
const HOLD_TRESHOLD = 500
const DUPLICATE_TRESHOLD = 80
@praveenpuglia
praveenpuglia / shadow-dom.md
Last active March 28, 2024 15:06
Everything you need to know about Shadow DOM

I am moving this gist to a github repo so more people can contribute to it. Also, it makes it easier for me to version control.

Please go to - https://github.com/praveenpuglia/shadow-dom-in-depth for latest version of this document. Also, if you find the document useful, please shower your love, go ⭐️ it. :)

Shadow DOM

Heads Up! It's all about the V1 Spec.

In a nutshell, Shadow DOM enables local scoping for HTML & CSS.