aboutsummaryrefslogtreecommitdiff
path: root/tailwind.config.js
blob: 77f5ee725b30bdc1a98b5c09afb7a4d26765a802 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/** @type {import('tailwindcss').Config} */
const colors = require("tailwindcss/colors");

const lightColors = {
  text: colors.black,
  background: colors.yellow[50],
  primary: "#7df9ff",
  secondary: "#9723c9",
  accent: "#fffF00",
};

const light = Object.keys(lightColors).reduce((acc, key) => {
  acc[`light${key}`] = lightColors[key];
  return acc;
}, {});

const darkColors = {
  text: colors.white,
  background: colors.slate[900],
  primary: "#7df9ff",
  secondary: "#9723c9",
  accent: "#fffF00",
};

const dark = Object.keys(darkColors).reduce((acc, key) => {
  acc[`dark${key}`] = darkColors[key];
  return acc;
}, {});

const shadow = (px, py, color) => `${px}px ${py}px 0px ${color}`;
const simpleShadow = (px, color) => shadow(px, px, color);
const borderedShadow = (px, color) => {
  const offset = 2;
  const actualShadow = simpleShadow(px, color);
  const rightBorder = simpleShadow(px + offset, "black");
  const leftBorder = simpleShadow(px - offset, "black");
  const leftCorner = shadow(px - offset, px + offset, "black");
  const rightCorner = shadow(px + offset, px - offset, "black");
  return `${actualShadow}, ${rightBorder}, ${leftBorder}, ${leftCorner}, ${rightCorner}`;
};

module.exports = {
  content: ["./src/**/*.{js,jsx,ts,tsx,mdx}"],
  darkMode: ["class", '[data-theme="dark"]'],
  theme: {
    extend: {
      boxShadow: {
        neoblack: "8px 8px 0px rgba(0,0,0,1)",
        neowhite: "8px 8px 0px rgba(255,0,0,1)",
        rainbow: `${borderedShadow(8, colors.cyan["400"])}, ${borderedShadow(
          8 * 2,
          colors.yellow["400"]
        )}, ${borderedShadow(8 * 3, colors.violet["400"])}`,
        neocyan: borderedShadow(8, colors.cyan["400"]),
        neoyellow: borderedShadow(8, colors.yellow["400"]),
        neoviolet: borderedShadow(8, colors.violet["400"]),
      },
      zIndex: {
        999: 999,
      },
      padding: {
        "16-9": "56.25%",
      },
      colors: {
        codeBg: "#2D2A55",
        ...light,
        ...dark,
      },
      tracking: {
        supatight: "-0.5em",
      },
    },
  },
  plugins: [],
};