Our current project involves using tailwindcss and things were going smoothly until the clients requested a "pixel perfect" design. This meant that every element needed to be set in pixels instead of rem units. Instead of adding countless classes like h-1px, h-2px ... h-100px, I decided to switch on JIT mode and use h-[100px] instead. The issue I'm facing now is that the compiler keeps recompiling endlessly, even after making no changes, and it persists even when I stop the development server. A process continues running on port 3000, preventing me from restarting the server. So my question is, how do I halt this infinite loop of recompilation?
I am utilizing: tailwindcss 2.1.2 tailwindcss/jit 0.1.18
Here is my tailwind configuration at the moment; there may be something triggering the recompilation loop:
const colors = require("tailwindcss/colors");
const defaultTheme = require("tailwindcss/defaultTheme");
module.exports = {
important: true,
mode: "jit",
//content: ["./src/**/*.{js,ts,jsx,tsx,liquid}"],
purge: {
enabled: false,
content: [
"./src/components/**/*.{js,ts,jsx,tsx,html}",
"./src/pages/**/*.{js,ts,jsx,tsx,html}",
"./src/components/*.{js,ts,jsx,tsx,html}",
"./src/pages/*.{js,ts,jsx,tsx,html}",
"./src/**/*.{js,ts,jsx,tsx,html}",
"./src/*.{js,ts,jsx,tsx,html}",
"./**/*.{js,ts,jsx,tsx,html}",
"./*.{js,ts,jsx,tsx,html}",
],
options: {
safelist: {
deep: [/bg$/, /col$/, /row$/, /text$/],
greedy: [/bg$/, /col$/, /row$, /text$/],
},
},
},
darkMode: false, // or 'media' or 'class'
theme: {
extend: {
opacity: {13: "0.13"},
boxShadow: {
head: "0 0 6px 0 rgba(0, 0, 0, 0.36)",
search: "0 9px 34px 0 rgba(0, 0, 0, 0.19)",
},
gridTemplateRows: {
"8-em": "repeat(8, minmax(0, 5em))",
8: "repeat(8, minmax(0, 1fr))",
},
backgroundImage: {
"gradient-radial": "radial-gradient(var(--gradient-color-stops))",
},
fontFamily: {
sans: ["Stolzl", ...defaultTheme.fontFamily.sans],
},
fontSize: {
"2.5xl": "1.6rem",
0.8: "0.8rem",
xxs: "0.6rem",
micro: "0.4rem",
nano: "0.2rem",
},
zIndex: {
0: 0,
10: 10,
20: 20,
30: 30,
40: 40,
50: 50,
25: 25,
50: 50,
60: 60,
75: 75,
100: 100,
200: 200,
auto: "auto",
},
colors: {
primaryLightBlue: "#f1f7fb",
primaryBlue: process.env.NEXT_PUBLIC_PRIMARY || "#1579B9",
primaryYellow: process.env.NEXT_PUBLIC_ACCENT || "#FDC607",
},
radialGradientColors: {
"blue-blue": ["#0171BA", "#005a94"],
"lb-lb": ["#3776dd", "#215dc0"],
},
animation: {
spin3d: "spin3d 6s linear infinite ",
},
keyframes: {
spin3d: {
"0%": {
transform: "perspective(1000px) rotateY(0deg)",
filter: "brightness(100%)",
},
"25%": { filter: "brightness(60%)" },
"50%": {
filter: "brightness(100%)",
},
"75%": { filter: "brightness(60%)" },
"100% ": {
transform: "perspective(1000px) rotateY(360deg)",
filter: "brightness(100%)",
},
},
},
},
},
plugins: [
require("tailwindcss-gradients"),
require("@tailwindcss/line-clamp"),
function ({ addComponents }) {
addComponents({
".container": {
maxWidth: "100%",
"@screen sm": {
maxWidth: "640px",
},
"@screen md": {
maxWidth: "768px",
},
"@screen lg": {
maxWidth: "1024px",
},
"@screen xl": {
maxWidth: "1280px",
},
"@screen 2xl": {
maxWidth: "1280px",
},
},
".container2": {
maxWidth: "100%",
"@screen sm": {
maxWidth: "640px",
},
"@screen md": {
maxWidth: "640px",
},
"@screen lg": {
maxWidth: "768px",
},
"@screen xl": {
maxWidth: "1118px",
},
"@screen 2xl": {
maxWidth: "1118px",
},
},
});
},
],
variants: {
display: ["group-hover"],
extend: {
backgroundColor: ["odd"],
borderColor: ["odd", "even", "active"],
borderOpacity: ["odd", "even", "active"],
borderWidth: ["odd", "even", "active"],
borderStyle: ["odd", "even", "active"],
display: ["disabled", "responsive"],
opacity: ["disabled"],
cursor: ["disabled", "hover"],
backgroundColor: ["disabled"],
borderWidth: ["hover,focus"],
transform: ["hover", "focus", "group-hover"],
scale: ["hover", "focus", "group-hover"],
width: ["hover", "group-hover"],
height: ["hover", "group-hover"],
padding: ["hover", "focus"],
},
},
};