@@ -4305,11 +4305,11 @@ it("should error when `layer(…)` is used, but it's not the first param", async
|
4305 | 4305 |
|
4306 | 4306 | describe('`@reference "…" imports`', () => {
|
4307 | 4307 | test('recursively removes styles', async () => {
|
4308 |
| -let loadStylesheet = async (id: string, base: string) => { |
| 4308 | +let loadStylesheet = async (id: string, base = '/root/foo') => { |
4309 | 4309 | if (id === './foo/baz.css') {
|
4310 | 4310 | return {
|
| 4311 | +base, |
4311 | 4312 | path: '',
|
4312 |
| -base: '/root/foo', |
4313 | 4313 | content: css`
|
4314 | 4314 | .foo {
|
4315 | 4315 | color: red;
|
@@ -4355,11 +4355,11 @@ describe('`@reference "…" imports`', () => {
|
4355 | 4355 | })
|
4356 | 4356 |
|
4357 | 4357 | test('does not generate utilities', async () => {
|
4358 |
| -let loadStylesheet = async (id: string, base: string) => { |
| 4358 | +let loadStylesheet = async (id: string, base = '/root/foo') => { |
4359 | 4359 | if (id === './foo/baz.css') {
|
4360 | 4360 | return {
|
| 4361 | +base, |
4361 | 4362 | path: '',
|
4362 |
| -base: '/root/foo', |
4363 | 4363 | content: css`
|
4364 | 4364 | @layer utilities {
|
4365 | 4365 | @tailwind utilities;
|
@@ -4442,15 +4442,15 @@ describe('`@reference "…" imports`', () => {
|
4442 | 4442 | })
|
4443 | 4443 | matchUtilities(
|
4444 | 4444 | {
|
4445 |
| -'match-utility': (value) => ({ |
| 4445 | +'match-utility': (_value) => ({ |
4446 | 4446 | '@keyframes match-utilities': { '100%': { opacity: '0' } },
|
4447 | 4447 | }),
|
4448 | 4448 | },
|
4449 | 4449 | { values: { initial: 'initial' } },
|
4450 | 4450 | )
|
4451 | 4451 | matchComponents(
|
4452 | 4452 | {
|
4453 |
| -'match-components': (value) => ({ |
| 4453 | +'match-components': (_value) => ({ |
4454 | 4454 | '@keyframes match-components': { '100%': { opacity: '0' } },
|
4455 | 4455 | }),
|
4456 | 4456 | },
|
@@ -4474,30 +4474,30 @@ describe('`@reference "…" imports`', () => {
|
4474 | 4474 | })
|
4475 | 4475 |
|
4476 | 4476 | test('emits CSS variable fallback and keyframes defined inside @reference-ed files', async () => {
|
4477 |
| -let loadStylesheet = async (id: string, base: string) => { |
| 4477 | +let loadStylesheet = async (id: string, base = '/root') => { |
4478 | 4478 | switch (id) {
|
4479 | 4479 | case './one.css': {
|
4480 | 4480 | return {
|
| 4481 | +base, |
4481 | 4482 | path: '',
|
4482 |
| -base: '/root', |
4483 | 4483 | content: css`
|
4484 | 4484 | @import './two.css' layer(two);
|
4485 | 4485 | `,
|
4486 | 4486 | }
|
4487 | 4487 | }
|
4488 | 4488 | case './two.css': {
|
4489 | 4489 | return {
|
| 4490 | +base, |
4490 | 4491 | path: '',
|
4491 |
| -base: '/root', |
4492 | 4492 | content: css`
|
4493 | 4493 | @import './three.css' layer(three);
|
4494 | 4494 | `,
|
4495 | 4495 | }
|
4496 | 4496 | }
|
4497 | 4497 | case './three.css': {
|
4498 | 4498 | return {
|
| 4499 | +base, |
4499 | 4500 | path: '',
|
4500 |
| -base: '/root', |
4501 | 4501 | content: css`
|
4502 | 4502 | .foo {
|
4503 | 4503 | color: red;
|
@@ -5519,7 +5519,7 @@ describe('feature detection', () => {
|
5519 | 5519 | css`
|
5520 | 5520 | @import 'tailwindcss/preflight';
|
5521 | 5521 | `,
|
5522 |
| -{ loadStylesheet: async (_, base) => ({ base, content: '' }) }, |
| 5522 | +{ loadStylesheet: async (_, base) => ({ base, path: '', content: '' }) }, |
5523 | 5523 | )
|
5524 | 5524 |
|
5525 | 5525 | expect(compiler.features & Features.AtImport).toBeTruthy()
|
@@ -5530,7 +5530,7 @@ describe('feature detection', () => {
|
5530 | 5530 | css`
|
5531 | 5531 | @import 'tailwindcss/preflight';
|
5532 | 5532 | `,
|
5533 |
| -{ loadStylesheet: async (_, base) => ({ base, content: '' }) }, |
| 5533 | +{ loadStylesheet: async (_, base) => ({ base, path: '', content: '' }) }, |
5534 | 5534 | )
|
5535 | 5535 |
|
5536 | 5536 | // There's little difference between `@reference` and `@import` on a feature
|
@@ -5551,7 +5551,7 @@ describe('feature detection', () => {
|
5551 | 5551 | color: theme(--color-red);
|
5552 | 5552 | }
|
5553 | 5553 | `,
|
5554 |
| -{ loadStylesheet: async (_, base) => ({ base, content: '' }) }, |
| 5554 | +{ loadStylesheet: async (_, base) => ({ base, path: '', content: '' }) }, |
5555 | 5555 | )
|
5556 | 5556 |
|
5557 | 5557 | expect(compiler.features & Features.ThemeFunction).toBeTruthy()
|
@@ -5562,7 +5562,7 @@ describe('feature detection', () => {
|
5562 | 5562 | css`
|
5563 | 5563 | @plugin "./some-plugin.js";
|
5564 | 5564 | `,
|
5565 |
| -{ loadModule: async (_, base) => ({ base, module: () => {} }) }, |
| 5565 | +{ loadModule: async (_, base) => ({ base, path: '', module: () => {} }) }, |
5566 | 5566 | )
|
5567 | 5567 |
|
5568 | 5568 | expect(compiler.features & Features.JsPluginCompat).toBeTruthy()
|
@@ -5573,7 +5573,7 @@ describe('feature detection', () => {
|
5573 | 5573 | css`
|
5574 | 5574 | @config "./some-config.js";
|
5575 | 5575 | `,
|
5576 |
| -{ loadModule: async (_, base) => ({ base, module: {} }) }, |
| 5576 | +{ loadModule: async (_, base) => ({ base, path: '', module: {} }) }, |
5577 | 5577 | )
|
5578 | 5578 |
|
5579 | 5579 | expect(compiler.features & Features.JsPluginCompat).toBeTruthy()
|
@@ -5605,9 +5605,10 @@ describe('feature detection', () => {
|
5605 | 5605 | @reference "tailwindcss/utilities";
|
5606 | 5606 | `,
|
5607 | 5607 | {
|
5608 |
| -async loadStylesheet(id, base) { |
| 5608 | +async loadStylesheet(_id, base) { |
5609 | 5609 | return {
|
5610 | 5610 | base,
|
| 5611 | +path: '', |
5611 | 5612 | content: css`
|
5612 | 5613 | @tailwind utilities;
|
5613 | 5614 | `,
|
|
0 commit comments