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.

Entity Profile

Dependency Diagram

graph LR
  c3734112_ed54_5e9d_bbeb_fcb691f82bb5["config.test.ts"]
  fda9325c_b5ff_9f58_5fbb_98511cb0b478["plugin.ts"]
  c3734112_ed54_5e9d_bbeb_fcb691f82bb5 --> fda9325c_b5ff_9f58_5fbb_98511cb0b478
  7ea5d6e8_c93c_0fe9_ee45_7db80046a7c5["flatten-color-palette.ts"]
  c3734112_ed54_5e9d_bbeb_fcb691f82bb5 --> 7ea5d6e8_c93c_0fe9_ee45_7db80046a7c5
  fb8751d6_f450_b27d_e61e_cbe05f028b79["flattenColorPalette"]
  c3734112_ed54_5e9d_bbeb_fcb691f82bb5 --> fb8751d6_f450_b27d_e61e_cbe05f028b79
  696bd648_5f24_1b59_8e8b_7a97a692869e["vitest"]
  c3734112_ed54_5e9d_bbeb_fcb691f82bb5 --> 696bd648_5f24_1b59_8e8b_7a97a692869e
  defe3085_cb6b_a1e5_b72d_c90fcb3dd3f2[".."]
  c3734112_ed54_5e9d_bbeb_fcb691f82bb5 --> defe3085_cb6b_a1e5_b72d_c90fcb3dd3f2
  style c3734112_ed54_5e9d_bbeb_fcb691f82bb5 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 OxideEngine 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: OxideEngine, 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