Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

10.4 KB
Raw Blame
import containerQueries from "@tailwindcss/container-queries";
import forms from "@tailwindcss/forms";
import typography from "@tailwindcss/typography";
import scrollbarHide from "tailwind-scrollbar-hide";
import type { Config } from "tailwindcss";
import radix from "tailwindcss-radix";

const config: Config = {
  content: ["./src/**/*.{js,ts,jsx,tsx,mdx}"],
  darkMode: "class",
  future: {
    hoverOnlyWhenSupported: true,
  },
  theme: {
    extend: {
      screens: {
        xs: "420px",
      },
      typography: {
        DEFAULT: {
          css: {
            "blockquote p:first-of-type::before": { content: "none" },
            "blockquote p:first-of-type::after": { content: "none" },
            "code::before": { content: '""' },
            "code::after": { content: '""' },
          },
        },
      },
      fontFamily: {
        display: ["var(--font-satoshi)", "system-ui", "sans-serif"],
        default: ["var(--font-inter)", "system-ui", "sans-serif"],
        mono: [
          "var(--font-geist-mono, ui-monospace)",
          "ui-monospace",
          "monospace",
        ],
      },
      fontSize: {
        "2xs": [
          "0.625rem",
          {
            lineHeight: "0.875rem",
          },
        ],
      },
      animation: {
        // Modal
        "scale-in": "scale-in 0.2s cubic-bezier(0.16, 1, 0.3, 1)",
        "fade-in": "fade-in 0.2s ease-out forwards",
        "fade-in-blur": "fade-in-blur 0.5s ease-out forwards",
        "scale-in-fade": "scale-in-fade 0.2s ease-out forwards",
        // Popover, Tooltip
        "slide-up-fade": "slide-up-fade 0.4s cubic-bezier(0.16, 1, 0.3, 1)",
        "slide-right-fade":
          "slide-right-fade 0.4s cubic-bezier(0.16, 1, 0.3, 1)",
        "slide-down-fade": "slide-down-fade 0.4s cubic-bezier(0.16, 1, 0.3, 1)",
        "slide-left-fade": "slide-left-fade 0.4s cubic-bezier(0.16, 1, 0.3, 1)",
        // Sheet
        "slide-in-from-right": "slide-in-from-right 0.2s ease",
        "slide-out-to-right": "slide-out-to-right 0.2s ease",
        // Navigation menu
        "enter-from-right": "enter-from-right 0.15s ease",
        "enter-from-left": "enter-from-left 0.15s ease",
        "exit-to-right": "exit-to-right 0.15s ease",
        "exit-to-left": "exit-to-left 0.15s ease",
        "scale-in-content": "scale-in-content 0.2s ease",
        "scale-out-content": "scale-out-content 0.2s ease",
        // Accordion
        "accordion-down": "accordion-down 300ms cubic-bezier(0.87, 0, 0.13, 1)",
        "accordion-up": "accordion-up 300ms cubic-bezier(0.87, 0, 0.13, 1)",
        // Custom wiggle animation
        wiggle: "wiggle 0.75s infinite",
        // Custom spinner animation (for loading-spinner)
        spinner: "spinner 1.2s linear infinite",
        // Custom blink animation (for loading-dots)
        blink: "blink 1.4s infinite both",
        // Custom pulse animation
        pulse: "pulse 1s linear infinite alternate",
        // Aurora background (drift + breathe on separate cycles so it never visibly loops)
        aurora:
          "aurora-drift 20s ease-in-out infinite alternate, aurora-breathe 9s ease-in-out infinite alternate",
        "aurora-reverse":
          "aurora-drift 26s ease-in-out infinite alternate-reverse, aurora-breathe 12s ease-in-out infinite alternate-reverse",
      },
      keyframes: {
        // Modal
        "scale-in": {
          "0%": { transform: "scale(var(--from-scale,0.95))" },
          "100%": { transform: "scale(var(--to-scale,1))" },
        },
        "fade-in": {
          "0%": { opacity: "0" },
          "100%": { opacity: "1" },
        },
        "fade-in-blur": {
          "0%": { opacity: "0", filter: "blur(4px)" },
          "50%": { opacity: "0.5", filter: "blur(0px)" },
          "100%": { opacity: "1", filter: "blur(0px)" },
        },
        "scale-in-fade": {
          "0%": { transform: "scale(0.95)", opacity: "0" },
          "100%": { transform: "scale(1)", opacity: "1" },
        },
        // Popover, Tooltip
        "slide-up-fade": {
          "0%": { opacity: "0", transform: "translateY(var(--offset, 2px))" },
          "100%": { opacity: "1", transform: "translateY(0)" },
        },
        "slide-right-fade": {
          "0%": { opacity: "0", transform: "translateX(var(--offset, -2px))" },
          "100%": { opacity: "1", transform: "translateX(0)" },
        },
        "slide-down-fade": {
          "0%": { opacity: "0", transform: "translateY(var(--offset, -2px))" },
          "100%": { opacity: "1", transform: "translateY(0)" },
        },
        "slide-left-fade": {
          "0%": { opacity: "0", transform: "translateX(var(--offset, 2px))" },
          "100%": { opacity: "1", transform: "translateX(0)" },
        },
        // Sheet
        "slide-in-from-right": {
          "0%": { transform: "translateX(100%)" },
          "100%": { transform: "translateX(0)" },
        },
        "slide-out-to-right": {
          "0%": { transform: "translateX(0)" },
          "100%": { transform: "translateX(100%)" },
        },
        // Navigation menu
        "enter-from-right": {
          "0%": { transform: "translateX(200px)", opacity: "0" },
          "100%": { transform: "translateX(0)", opacity: "1" },
        },
        "enter-from-left": {
          "0%": { transform: "translateX(-200px)", opacity: "0" },
          "100%": { transform: "translateX(0)", opacity: "1" },
        },
        "exit-to-right": {
          "0%": { transform: "translateX(0)", opacity: "1" },
          "100%": { transform: "translateX(200px)", opacity: "0" },
        },
        "exit-to-left": {
          "0%": { transform: "translateX(0)", opacity: "1" },
          "100%": { transform: "translateX(-200px)", opacity: "0" },
        },
        "scale-in-content": {
          "0%": { transform: "rotateX(-30deg) scale(0.9)", opacity: "0" },
          "100%": { transform: "rotateX(0deg) scale(1)", opacity: "1" },
        },
        "scale-out-content": {
          "0%": { transform: "rotateX(0deg) scale(1)", opacity: "1" },
          "100%": { transform: "rotateX(-10deg) scale(0.95)", opacity: "0" },
        },
        // Accordion
        "accordion-down": {
          from: { height: "0" },
          to: { height: "var(--radix-accordion-content-height)" },
        },
        "accordion-up": {
          from: { height: "var(--radix-accordion-content-height)" },
          to: { height: "0" },
        },
        // Custom wiggle animation
        wiggle: {
          "0%, 100%": {
            transform: "translateX(0%)",
            transformOrigin: "50% 50%",
          },
          "15%": { transform: "translateX(-4px) rotate(-4deg)" },
          "30%": { transform: "translateX(6px) rotate(4deg)" },
          "45%": { transform: "translateX(-6px) rotate(-2.4deg)" },
          "60%": { transform: "translateX(2px) rotate(1.6deg)" },
          "75%": { transform: "translateX(-1px) rotate(-0.8deg)" },
        },
        // Custom spinner animation (for loading-spinner)
        spinner: {
          "0%": {
            opacity: "1",
          },
          "100%": {
            opacity: "0",
          },
        },
        // Custom blink animation (for loading-dots)
        blink: {
          "0%": {
            opacity: "0.2",
          },
          "20%": {
            opacity: "1",
          },
          "100%": {
            opacity: "0.2",
          },
        },
        // Custom pulse animation
        pulse: {
          from: {
            opacity: "0",
          },
          to: {
            opacity: "1",
          },
        },
        // Aurora background
        "aurora-drift": {
          from: { translate: "-6% 0" },
          to: { translate: "6% 0" },
        },
        "aurora-breathe": {
          from: { scale: "1 1" },
          to: { scale: "1 1.25" },
        },
      },
      colors: {
        // Merged into Tailwind's default neutral scale
        neutral: {
          150: "#ededed",
        },
        brown: {
          50: "#fdf8f6",
          100: "#f2e8e5",
          200: "#eaddd7",
          300: "#e0cec7",
          400: "#d2bab0",
          500: "#bfa094",
          600: "#a18072",
          700: "#977669",
          800: "#846358",
          900: "#43302b",
        },

        // Light/dark mode colors

        "bg-emphasis": "rgb(var(--bg-emphasis, 229 229 229) / <alpha-value>)",
        "bg-default": "rgb(var(--bg-default, 255 255 255) / <alpha-value>)",
        "bg-subtle": "rgb(var(--bg-subtle, 245 245 245) / <alpha-value>)",
        "bg-muted": "rgb(var(--bg-muted, 250 250 250) / <alpha-value>)",
        "bg-inverted": "rgb(var(--bg-inverted, 23 23 23) / <alpha-value>)",

        "bg-info": "rgb(var(--bg-info, 219 234 254) / <alpha-value>)",
        "bg-success": "rgb(var(--bg-success, 220 252 231) / <alpha-value>)",
        "bg-attention": "rgb(var(--bg-attention, 255 237 213) / <alpha-value>)",
        "bg-warning": "rgb(var(--bg-warning, 254 249 195) / <alpha-value>)",
        "bg-error": "rgb(var(--bg-error, 254 226 226) / <alpha-value>)",

        "border-emphasis":
          "rgb(var(--border-emphasis, 163 163 163) / <alpha-value>)",
        "border-default":
          "rgb(var(--border-default, 212 212 212) / <alpha-value>)",
        "border-muted": "rgb(var(--border-muted, 245 245 245) / <alpha-value>)",
        "border-subtle":
          "rgb(var(--border-subtle, 229 229 229) / <alpha-value>)",

        "content-inverted":
          "rgb(var(--content-inverted, 255 255 255) / <alpha-value>)",
        "content-muted":
          "rgb(var(--content-muted, 163 163 163) / <alpha-value>)",
        "content-subtle":
          "rgb(var(--content-subtle, 115 115 115) / <alpha-value>)",
        "content-default":
          "rgb(var(--content-default, 64 64 64) / <alpha-value>)",
        "content-emphasis":
          "rgb(var(--content-emphasis, 23 23 23) / <alpha-value>)",

        "content-info": "rgb(var(--content-info, 37 99 235) / <alpha-value>)",
        "content-success":
          "rgb(var(--content-success, 22 163 74) / <alpha-value>)",
        "content-attention":
          "rgb(var(--content-attention, 234 88 12) / <alpha-value>)",
        "content-warning":
          "rgb(var(--content-warning, 202 138 4) / <alpha-value>)",
        "content-error": "rgb(var(--content-error, 220 38 38) / <alpha-value>)",
      },
      dropShadow: {
        "card-hover": ["0 2px 4px #222A350d"],
      },
    },
  },
  plugins: [
    forms,
    typography,
    scrollbarHide,
    radix,
    // TODO: Remove the container queries plugin when we upgrade to Tailwind v4
    containerQueries,
  ],
};

export default config;