deno.land / x / esm@v135_2 / test / postcss / postcss.test.ts

postcss.test.ts
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { assertStringIncludes } from "https://deno.land/std@0.180.0/testing/asserts.ts";
import postcss from "http://localhost:8080/postcss@8.4.16";import autoprefixer from "http://localhost:8080/autoprefixer@10.4.12?deps=postcss@8.4.16";import tailwindCSS from "http://localhost:8080/tailwindcss@3.3.5?deps=postcss@8.4.16";
Deno.test("postcss(autoprefixer)", async () => { const { css } = await postcss([autoprefixer]).process(` backdrop-filter: blur(5px); user-select: none; `).async(); assertStringIncludes(css, "-webkit-backdrop-filter: blur(5px);"); assertStringIncludes(css, "-webkit-user-select: none;");});
Deno.test("postcss(tailwindCSS)", async () => { const { css } = await postcss([ tailwindCSS({ content: [{ raw: '<div class="font-bold text-blue">', extension: "html" }], theme: { colors: { "blue": "rgba(31, 182, 255, 0.9)", }, }, }) as any, ]).process(` @tailwind base; /* Preflight will be injected here */ @tailwind components; @tailwind utilities; `).async();
assertStringIncludes( css, "1. Prevent padding and border from affecting element width.", // preflight.css ); assertStringIncludes(css, ".font-bold {"); assertStringIncludes(css, "font-weight: 700;"); assertStringIncludes(css, ".text-blue {"); assertStringIncludes(css, "color: rgba(31, 182, 255, 0.9);");});
esm

Version Info

Tagged at
a year ago