diff --git a/src/__tests__/vendor/tailwind/_tailwind.tsx b/src/__tests__/vendor/tailwind/_tailwind.tsx index 3ba5db5e..a5c2f7f2 100644 --- a/src/__tests__/vendor/tailwind/_tailwind.tsx +++ b/src/__tests__/vendor/tailwind/_tailwind.tsx @@ -26,7 +26,7 @@ export type NativewindRenderOptions = RenderOptions & { theme?: boolean; /** Whether to include the preflight in the generated CSS @default false */ preflight?: boolean; - /** Whether to include the plugin in the generated CSS. @default true */ + /** Whether to include the tailwindcss-safe-area plugin in the generated CSS. @default true */ plugin?: boolean; /** Enable debug logging. @default false - Set process.env.NATIVEWIND_TEST_AUTO_DEBUG and run tests with the node inspector */ debug?: boolean | "verbose"; @@ -44,6 +44,7 @@ export async function render( debug = debugDefault, theme = true, preflight = false, + plugin = true, extraCss, ...options }: NativewindRenderOptions = {}, @@ -59,7 +60,11 @@ export async function render( css += `@import "tailwindcss/preflight.css" layer(base);\n`; } - css += `@import "tailwindcss/utilities.css" layer(utilities) source(none);\n@import "tailwindcss-safe-area";`; + css += `@import "tailwindcss/utilities.css" layer(utilities) source(none);`; + + if (plugin) { + css += `\n@import "tailwindcss-safe-area";`; + } } css += sourceInline diff --git a/src/__tests__/vendor/tailwind/safe-area.test.tsx b/src/__tests__/vendor/tailwind/safe-area.test.tsx index 4ef24b01..f931e2c7 100644 --- a/src/__tests__/vendor/tailwind/safe-area.test.tsx +++ b/src/__tests__/vendor/tailwind/safe-area.test.tsx @@ -3,7 +3,7 @@ import type { ViewProps } from "react-native"; import { SafeAreaProvider } from "react-native-css/components/react-native-safe-area-context"; import { type Metrics } from "react-native-safe-area-context"; -import { renderCurrentTest } from "./_tailwind"; +import { renderCurrentTest, renderSimple } from "./_tailwind"; const initialMetrics: Metrics = { insets: { @@ -355,3 +355,13 @@ test("pb-safe-or-20", async () => { }, }); }); + +test("pt-safe without the plugin", async () => { + expect( + await renderSimple({ + className: "pt-safe", + plugin: false, + wrapper: Wrapper, + }), + ).toStrictEqual({ props: {} }); +});