From 3e5745fbb28bb4cf8cc53c8618461bf136b67381 Mon Sep 17 00:00:00 2001 From: Philipp Spiess Date: Tue, 3 Dec 2024 13:48:52 +0100 Subject: [PATCH] Update changelog and add test for absolute url rebasing (#15282) I noticed uncommitted changes of #15275 on my local setup so here's the updated changelog and the added unit test. --- CHANGELOG.md | 2 +- packages/@tailwindcss-node/src/urls.test.ts | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aace62b6e..a8087a60e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -- Ensure absolute `url()`s inside imported CSS files are not rebased when using `@tailwindcss/vite` +- Ensure absolute `url()`s inside imported CSS files are not rebased when using `@tailwindcss/vite` ([#15275](https://github.com/tailwindlabs/tailwindcss/pull/15275)) - Fix issues with dev servers using Svelte 5 with the Vite plugin ([#15274](https://github.com/tailwindlabs/tailwindcss/issues/15274)) - Fix resolution of imported CSS files in Vite SSR builds ([#15279](https://github.com/tailwindlabs/tailwindcss/issues/15279)) - Ensure other plugins can run after `@tailwindcss/postcss` ([#15273](https://github.com/tailwindlabs/tailwindcss/pull/15273)) diff --git a/packages/@tailwindcss-node/src/urls.test.ts b/packages/@tailwindcss-node/src/urls.test.ts index d6d9fcb3a..3378e45ed 100644 --- a/packages/@tailwindcss-node/src/urls.test.ts +++ b/packages/@tailwindcss-node/src/urls.test.ts @@ -18,6 +18,12 @@ test('URLs can be rewritten', async () => { background: url('./image.jpg'); background: url("./image.jpg"); + /* Absolute URLs: ignored */ + background: url(/image.jpg); + background: url(/foo/image.jpg); + background: url('/image.jpg'); + background: url("/image.jpg"); + /* External URL: ignored */ background: url(http://example.com/image.jpg); background: url('http://example.com/image.jpg'); @@ -99,6 +105,10 @@ test('URLs can be rewritten', async () => { background: url(./foo/image.jpg); background: url('./foo/bar/image.jpg'); background: url("./foo/bar/image.jpg"); + background: url(/image.jpg); + background: url(/foo/image.jpg); + background: url('/image.jpg'); + background: url("/image.jpg"); background: url(http://example.com/image.jpg); background: url('http://example.com/image.jpg'); background: url("http://example.com/image.jpg");