File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { readFileSync } from "node:fs";
33import { describe , expect , it } from "vitest" ;
44
55const css = readFileSync ( new URL ( "./index.css" , import . meta. url ) , "utf8" ) ;
6+ const landingCss = readFileSync ( new URL ( "./landing.css" , import . meta. url ) , "utf8" ) ;
67
78describe ( "design system (index.css)" , ( ) => {
89 describe ( "landing tokens are defined for both light and dark" , ( ) => {
@@ -67,6 +68,12 @@ describe("design system (index.css)", () => {
6768 }
6869 } ) ;
6970
71+ it ( "scans the landing page sources for route-specific utilities" , ( ) => {
72+ expect ( landingCss ) . toContain ( '@source "./app/(site)/home.tsx";' ) ;
73+ expect ( landingCss ) . toContain ( '@source "./components/hero-install-preview.tsx";' ) ;
74+ expect ( landingCss ) . not . toContain ( '@source "./app/home.tsx";' ) ;
75+ } ) ;
76+
7077 it ( "uses Inter for landing page body text" , ( ) => {
7178 const landingPageBlock = css . match ( / \. l a n d i n g - p a g e \s * \{ ( [ ^ } ] + ) \} / ) ?. [ 1 ] ?? "" ;
7279 expect ( landingPageBlock ) . toContain ( 'font-family: var(--font-sans), "Inter", sans-serif;' ) ;
Original file line number Diff line number Diff line change 22
33@import "tailwindcss/utilities.css" layer(utilities) source(none);
44
5- @source "./app/home.tsx" ;
5+ @source "./app/(site)/home.tsx" ;
6+ @source "./components/hero-install-preview.tsx" ;
You can’t perform that action at this time.
0 commit comments