Skip to content

Instantly share code, notes, and snippets.

View aaroniker's full-sized avatar

Aaron Iker aaroniker

View GitHub Profile
@aaroniker
aaroniker / panda.config.ts
Created July 19, 2024 14:25
Panda CSS example config for fluidTypography.ts
import { defineConfig } from '@pandacss/dev';
import { fluidTypography } from './fluidTypography';
declare module '@pandacss/dev' {
interface ThemeConfig {
fluidFont: Record<string, FluidFontProps>;
}
}
const config = defineConfig({
@aaroniker
aaroniker / fluidTypography.ts
Last active July 19, 2024 14:22
panda-css fluid typography
import { defineUtility } from '@pandacss/dev';
type Unit = 'px' | 'rem' | 'em';
type VwUnit = 'vw' | 'vh' | '%';
interface FluidFontConfig {
defaultUnit: Unit;
defaultVwUnit: VwUnit;
defaultMinVw: number;
defaultMaxVw: number;
@aaroniker
aaroniker / .eslintrc.cjs
Created January 20, 2024 14:30
.eslintrc.cjs
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'prettier'
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
@aaroniker
aaroniker / gist:418467cccfb23b9e2da9d17f5d5a54a1
Last active January 15, 2024 21:09
Figma Plugin resize snippets
// Add element to markup
<div id="resize">
<svg viewBox="0 0 20 20">
<path d="...icon..." />
</svg>
</div>
// Styling
#resize {
position: absolute;
@aaroniker
aaroniker / useArrayState.ts
Created December 13, 2023 11:13
useArrayState React Hook w/ Typescript Support
const useArrayState = <T>(initialState: T[] = []) => {
const [state, setState] = useState<T[]>(initialState);
const add = (newValue: T) => {
setState((currentState) => [...currentState, newValue]);
};
const remove = (index: number) => {
setState((currentState) => {
const newState = [...currentState];
$breakpoints: (
xs: 576px,
sm: 768px,
md: 992px,
lg: 1200px
);
@mixin min($breakpoint) {
@if map-has-key($breakpoints, $breakpoint) {
@media (min-width: map-get($breakpoints, $breakpoint)) {