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

plugin-api.test.ts — tailwindcss Source File

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

Entity Profile

Dependency Diagram

graph LR
  39808083_b3b3_36c5_05f5_c039828c7b9e["plugin-api.test.ts"]
  fda9325c_b5ff_9f58_5fbb_98511cb0b478["plugin.ts"]
  39808083_b3b3_36c5_05f5_c039828c7b9e --> fda9325c_b5ff_9f58_5fbb_98511cb0b478
  cf14281b_29d9_c059_3148_2e2cc2fe19ae["run.ts"]
  39808083_b3b3_36c5_05f5_c039828c7b9e --> cf14281b_29d9_c059_3148_2e2cc2fe19ae
  85b013b1_163d_9594_1737_4dd7f391d8ce["optimizeCss"]
  39808083_b3b3_36c5_05f5_c039828c7b9e --> 85b013b1_163d_9594_1737_4dd7f391d8ce
  1b5321a5_0fcc_2351_1f22_0d4bed4c097e["default-theme.ts"]
  39808083_b3b3_36c5_05f5_c039828c7b9e --> 1b5321a5_0fcc_2351_1f22_0d4bed4c097e
  af1a6ece_0432_a556_fd63_8cb4a91f12ad["plugin-api.ts"]
  39808083_b3b3_36c5_05f5_c039828c7b9e --> af1a6ece_0432_a556_fd63_8cb4a91f12ad
  696bd648_5f24_1b59_8e8b_7a97a692869e["vitest"]
  39808083_b3b3_36c5_05f5_c039828c7b9e --> 696bd648_5f24_1b59_8e8b_7a97a692869e
  defe3085_cb6b_a1e5_b72d_c90fcb3dd3f2[".."]
  39808083_b3b3_36c5_05f5_c039828c7b9e --> defe3085_cb6b_a1e5_b72d_c90fcb3dd3f2
  style 39808083_b3b3_36c5_05f5_c039828c7b9e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { describe, expect, test, vi } from 'vitest'
import { compile } from '..'
import plugin from '../plugin'
import { optimizeCss } from '../test-utils/run'
import defaultTheme from './default-theme'
import type { CssInJs, PluginAPI } from './plugin-api'

const css = String.raw

describe('theme', async () => {
  test('plugin theme can contain objects', async () => {
    let input = css`
      @tailwind utilities;
      @plugin "my-plugin";
    `

    let compiler = await compile(input, {
      loadModule: async (id, base) => {
        return {
          path: '',
          base,
          module: plugin(
            function ({ addBase, theme }) {
              addBase({
                '@keyframes enter': theme('keyframes.enter'),
                '@keyframes exit': theme('keyframes.exit'),
              })
            },
            {
              theme: {
                extend: {
                  keyframes: {
                    enter: {
                      from: {
                        opacity: 'var(--tw-enter-opacity, 1)',
                        transform:
                          'translate3d(var(--tw-enter-translate-x, 0), var(--tw-enter-translate-y, 0), 0) scale3d(var(--tw-enter-scale, 1), var(--tw-enter-scale, 1), var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))',
                      },
                    },
                    exit: {
                      to: {
                        opacity: 'var(--tw-exit-opacity, 1)',
                        transform:
                          'translate3d(var(--tw-exit-translate-x, 0), var(--tw-exit-translate-y, 0), 0) scale3d(var(--tw-exit-scale, 1), var(--tw-exit-scale, 1), var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))',
                      },
                    },
                  },
                },
              },
            },
          ),
        }
      },
    })

    expect(compiler.build([])).toMatchInlineSnapshot(`
      "@layer base {
        @keyframes enter {
          from {
            opacity: var(--tw-enter-opacity, 1);
// ... (4536 more lines)

Domain

Frequently Asked Questions

What does plugin-api.test.ts do?
plugin-api.test.ts is a source file in the tailwindcss codebase, written in typescript. It belongs to the OxideEngine domain.
What does plugin-api.test.ts depend on?
plugin-api.test.ts imports 7 module(s): .., default-theme.ts, optimizeCss, plugin-api.ts, plugin.ts, run.ts, vitest.
Where is plugin-api.test.ts in the architecture?
plugin-api.test.ts is located at packages/tailwindcss/src/compat/plugin-api.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