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

important.test.ts — tailwindcss Source File

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

File typescript Oxide 4 imports

Entity Profile

Dependency Diagram

graph LR
  9d42e4b7_b49d_20d1_0d69_9ae670a18615["important.test.ts"]
  f9b7eac1_3b10_a208_408b_b98998a33868["run.ts"]
  9d42e4b7_b49d_20d1_0d69_9ae670a18615 --> f9b7eac1_3b10_a208_408b_b98998a33868
  b8347223_2c86_b56c_bee4_53f1b5cc1312["compileCss"]
  9d42e4b7_b49d_20d1_0d69_9ae670a18615 --> b8347223_2c86_b56c_bee4_53f1b5cc1312
  f1e05e5f_c1b2_a3f5_b2e8_3317b9243ac3["vitest"]
  9d42e4b7_b49d_20d1_0d69_9ae670a18615 --> f1e05e5f_c1b2_a3f5_b2e8_3317b9243ac3
  4a833a47_de88_b79a_24ac_de077593f60a["."]
  9d42e4b7_b49d_20d1_0d69_9ae670a18615 --> 4a833a47_de88_b79a_24ac_de077593f60a
  style 9d42e4b7_b49d_20d1_0d69_9ae670a18615 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { expect, test } from 'vitest'
import { compile } from '.'
import { compileCss } from './test-utils/run'

const css = String.raw

test('Utilities can be wrapped in a selector', async () => {
  // This is the v4 equivalent of `important: "#app"` from v3
  let input = css`
    #app {
      @tailwind utilities;
    }
  `

  let compiler = await compile(input)

  expect(compiler.build(['underline', 'hover:line-through'])).toMatchInlineSnapshot(`
    "#app {
      .underline {
        text-decoration-line: underline;
      }
      .hover\\:line-through {
        &:hover {
          @media (hover: hover) {
            text-decoration-line: line-through;
          }
        }
      }
    }
    "
  `)
})

test('Utilities can be marked with important', async () => {
  // This is the v4 equivalent of `important: true` from v3
  let input = css`
    @import 'tailwindcss/utilities' important;
  `

  let compiler = await compile(input, {
    loadStylesheet: async (id: string, base: string) => ({
      base,
      content: '@tailwind utilities;',
      path: '',
    }),
  })

  expect(compiler.build(['underline', 'hover:line-through'])).toMatchInlineSnapshot(`
    ".underline {
      text-decoration-line: underline !important;
    }
    .hover\\:line-through {
      &:hover {
        @media (hover: hover) {
          text-decoration-line: line-through !important;
        }
      }
    }
    "
  `)
// ... (72 more lines)

Domain

Dependencies

Frequently Asked Questions

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