Home / File/ config.test.ts — tailwindcss Source File

config.test.ts — tailwindcss Source File

Architecture documentation for config.test.ts, a typescript file in the tailwindcss codebase. 5 imports, 0 dependents.

File typescript Oxide 5 imports

Entity Profile

Dependency Diagram

graph LR
  79e55422_077b_cc18_428e_522cf1765560["config.test.ts"]
  914a5326_dcdd_e839_bbc4_d6545cf4c5d5["plugin.ts"]
  79e55422_077b_cc18_428e_522cf1765560 --> 914a5326_dcdd_e839_bbc4_d6545cf4c5d5
  fc692362_201d_7126_85aa_6ae8a948d6cc["flatten-color-palette.ts"]
  79e55422_077b_cc18_428e_522cf1765560 --> fc692362_201d_7126_85aa_6ae8a948d6cc
  17f732a0_9d10_51ac_2acd_c4cc0178d4db["flattenColorPalette"]
  79e55422_077b_cc18_428e_522cf1765560 --> 17f732a0_9d10_51ac_2acd_c4cc0178d4db
  f1e05e5f_c1b2_a3f5_b2e8_3317b9243ac3["vitest"]
  79e55422_077b_cc18_428e_522cf1765560 --> f1e05e5f_c1b2_a3f5_b2e8_3317b9243ac3
  9136f017_616b_a3c5_5967_4217d21e2fc8[".."]
  79e55422_077b_cc18_428e_522cf1765560 --> 9136f017_616b_a3c5_5967_4217d21e2fc8
  style 79e55422_077b_cc18_428e_522cf1765560 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { describe, expect, test, vi } from 'vitest'
import { compile, type Config } from '..'
import { default as plugin } from '../plugin'
import flattenColorPalette from './flatten-color-palette'

const css = String.raw

test('Config files can add content', async () => {
  let input = css`
    @tailwind utilities;
    @config "./config.js";
  `

  let compiler = await compile(input, {
    loadModule: async () => ({ module: { content: ['./file.txt'] }, base: '/root', path: '' }),
  })

  expect(compiler.sources).toEqual([{ base: '/root', pattern: './file.txt', negated: false }])
})

test('Config files can change dark mode (media)', async () => {
  let input = css`
    @tailwind utilities;
    @config "./config.js";
  `

  let compiler = await compile(input, {
    loadModule: async () => ({ module: { darkMode: 'media' }, base: '/root', path: '' }),
  })

  expect(compiler.build(['dark:underline'])).toMatchInlineSnapshot(`
    ".dark\\:underline {
      @media (prefers-color-scheme: dark) {
        text-decoration-line: underline;
      }
    }
    "
  `)
})

test('Config files can change dark mode (selector)', async () => {
  let input = css`
    @tailwind utilities;
    @config "./config.js";
  `

  let compiler = await compile(input, {
    loadModule: async () => ({ module: { darkMode: 'selector' }, base: '/root', path: '' }),
  })

  expect(compiler.build(['dark:underline'])).toMatchInlineSnapshot(`
    ".dark\\:underline {
      &:where(.dark, .dark *) {
        text-decoration-line: underline;
      }
    }
    "
  `)
})

// ... (1714 more lines)

Domain

Frequently Asked Questions

What does config.test.ts do?
config.test.ts is a source file in the tailwindcss codebase, written in typescript. It belongs to the Oxide domain.
What does config.test.ts depend on?
config.test.ts imports 5 module(s): .., flatten-color-palette.ts, flattenColorPalette, plugin.ts, vitest.
Where is config.test.ts in the architecture?
config.test.ts is located at packages/tailwindcss/src/compat/config.test.ts (domain: Oxide, directory: packages/tailwindcss/src/compat).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free