Skip to content

Instantly share code, notes, and snippets.

View iamnbutler's full-sized avatar

Nate Butler iamnbutler

View GitHub Profile
@iamnbutler
iamnbutler / tailwind-dynamic-font-sizes.tailwind.config.ts
Last active April 3, 2024 13:07
Dynamic Font Sizes for TailwindCSS
import tailwindTypography from '@tailwindcss/typography';
import { Config } from 'tailwindcss';
import typography from './typography';
const fontKeys = {
xs: 'xs',
sm: 'sm',
base: 'base',
lg: 'lg',
@iamnbutler
iamnbutler / radix-color-scale.tailwind.config.ts
Last active September 1, 2023 16:18
A quick lil function to add a radix color scale to your tailwind config
import type { Config } from 'tailwindcss';
const radix_color_scale = (colorName: string) => {
return {
DEFAULT: `var(--${colorName}-9)`,
a1: `var(--${colorName}-a1)`,
a2: `var(--${colorName}-a2)`,
a3: `var(--${colorName}-a3)`,
a4: `var(--${colorName}-a4)`,
a5: `var(--${colorName}-a5)`,
use gpui::SharedString;
#[allow(unused)]
use gpui::{div, IntoElement, ParentElement, RenderOnce, Styled, WindowContext};
use serde::{Deserialize, Serialize};
const GRID_WIDTH: usize = 10;
const GRID_HEIGHT: usize = 20;
#[derive(Clone, Copy, Serialize, Deserialize)]
pub struct Block {
@iamnbutler
iamnbutler / gpui-app-extension.rs
Last active April 20, 2025 18:40
GPUI App extension example
//! # GPUI App extension example
//!
//! Add gpui to your Cargo.toml:
//! gpui = { git = "https://github.com/zed-industries/zed", rev = "c04c5812b6295ab683fbf1900499330cbc2b3058"}
use gpui::{
bounds, div, hsla, point, px, size, App, AppContext as _, Application, Context, FocusHandle,
Global, Hsla, IntoElement, Menu, ParentElement as _, Render, Styled as _, TitlebarOptions,
Window, WindowBounds, WindowOptions,
};

Adding Transform to Quad Struct

User

The following items were attached by the user. They are up-to-date and don't need to be re-read. ```rs zed/crates/gpui/src/scene.rs