-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed
Description
The source detection is finding files outside of the src
directory when imported in src/app.css
. The output contains classes that are not used.
Currently I can fix it by disabling automatic source detection as noted in the docs. But based on what I understand from the docs, this should be identical to the base path used for source detection.
@import "tailwindcss/utilities" layer(utilities) source(none);
@source "../src";
Reproduce
- Start with the create-vite template for svelte (https://github.com/vitejs/vite/tree/main/packages/create-vite/template-svelte-ts)
npm install tailwindcss @tailwindcss/vite
and add the plugin tovite.config.ts
- Delete all the styles in the files so the output css should be empty.
npm run build
Below is the build output with no styles in App.svelte
with only the utilities layer in app.css
.
@import "tailwindcss/utilities" layer(utilities);
/*! tailwindcss v4.0.6 | MIT License | https://tailwindcss.com */
@layer utilities {
.absolute {
position: absolute;
}
.fixed {
position: fixed;
}
.relative {
position: relative;
}
.static {
position: static;
}
.container {
width: 100%;
}
.\!block {
display: block !important;
}
.block {
display: block;
}
.contents {
display: contents;
}
.hidden {
display: none;
}
.inline {
display: inline;
}
.\!transform {
transform: var(--tw-rotate-x) var(--tw-rotate-y) var(--tw-rotate-z) var(--tw-skew-x) var(--tw-skew-y) !important;
}
.transform {
transform: var(--tw-rotate-x) var(--tw-rotate-y) var(--tw-rotate-z) var(--tw-skew-x) var(--tw-skew-y);
}
.resize {
resize: both;
}
.filter {
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
}
.transition {
transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow,
transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter;
transition-timing-function: var(--tw-ease, ease);
transition-duration: var(--tw-duration, 0s);
}
}
@property --tw-rotate-x {
syntax: "*";
inherits: false;
initial-value: rotateX(0);
}
@property --tw-rotate-y {
syntax: "*";
inherits: false;
initial-value: rotateY(0);
}
@property --tw-rotate-z {
syntax: "*";
inherits: false;
initial-value: rotateZ(0);
}
@property --tw-skew-x {
syntax: "*";
inherits: false;
initial-value: skewX(0);
}
@property --tw-skew-y {
syntax: "*";
inherits: false;
initial-value: skewY(0);
}
@property --tw-blur {
syntax: "*";
inherits: false;
}
@property --tw-brightness {
syntax: "*";
inherits: false;
}
@property --tw-contrast {
syntax: "*";
inherits: false;
}
@property --tw-grayscale {
syntax: "*";
inherits: false;
}
@property --tw-hue-rotate {
syntax: "*";
inherits: false;
}
@property --tw-invert {
syntax: "*";
inherits: false;
}
@property --tw-opacity {
syntax: "*";
inherits: false;
}
@property --tw-saturate {
syntax: "*";
inherits: false;
}
@property --tw-sepia {
syntax: "*";
inherits: false;
}
Metadata
Metadata
Assignees
Labels
No labels