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

plugin.test.ts — tailwindcss Source File

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

File typescript Oxide 3 imports

Entity Profile

Dependency Diagram

graph LR
  704df07a_457a_df9c_4afa_959bd37666e0["plugin.test.ts"]
  914a5326_dcdd_e839_bbc4_d6545cf4c5d5["plugin.ts"]
  704df07a_457a_df9c_4afa_959bd37666e0 --> 914a5326_dcdd_e839_bbc4_d6545cf4c5d5
  f1e05e5f_c1b2_a3f5_b2e8_3317b9243ac3["vitest"]
  704df07a_457a_df9c_4afa_959bd37666e0 --> f1e05e5f_c1b2_a3f5_b2e8_3317b9243ac3
  4a833a47_de88_b79a_24ac_de077593f60a["."]
  704df07a_457a_df9c_4afa_959bd37666e0 --> 4a833a47_de88_b79a_24ac_de077593f60a
  style 704df07a_457a_df9c_4afa_959bd37666e0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { expect, test } from 'vitest'
import { compile } from '.'
import plugin from './plugin'

const css = String.raw

test('plugin', async () => {
  let input = css`
    @plugin "my-plugin";
  `

  let compiler = await compile(input, {
    loadModule: async () => ({
      module: plugin(function ({ addBase }) {
        addBase({
          body: {
            margin: '0',
          },
        })
      }),
      base: '/root',
      path: '',
    }),
  })

  expect(compiler.build([])).toMatchInlineSnapshot(`
    "@layer base {
      body {
        margin: 0;
      }
    }
    "
  `)
})

test('plugin.withOptions', async () => {
  let input = css`
    @plugin "my-plugin";
  `

  let compiler = await compile(input, {
    loadModule: async () => ({
      module: plugin.withOptions(function (opts = { foo: '1px' }) {
        return function ({ addBase }) {
          addBase({
            body: {
              margin: opts.foo,
            },
          })
        }
      }),
      base: '/root',
      path: '',
    }),
  })

  expect(compiler.build([])).toMatchInlineSnapshot(`
    "@layer base {
      body {
        margin: 1px;
      }
    }
    "
  `)
})

Domain

Dependencies

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free