admin管理员组文章数量:1289911
I am using Spring boot application with Java template engine and when I did the setup for version 3, a tailwind config file was present to check for the JTE files as below
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ['../jte/**/*.jte'],
theme: {
extend: {},
},
plugins: [],
}
However, With the version 4 tailwind cli there is no configuration for the content files
The script is not picking up the CSS class used in the JTE files
package.json
"scripts": {
"build": "tailwindcss -i ./style.css -o ../resources/static/main.css --minify",
"watch": "tailwindcss --watch -i ./style.css -o ../resources/static/main.css --watch"
}
style.css
@import "tailwindcss";
Version 3 style.css
@tailwind base;
@tailwind components;
@tailwind utilities;
when the build command is run npm run build
none of the tailwind CSS is working
login.jte
<form class="mt-8 space-y-6" action="/login" method="POST">
${csrfHiddenInput}
<div>
<label>User name</label>
<input name="username" type="text" required class="w-full px-4 py-2 border"/>
</div>
<div>
<label>Password</label>
<input name="password" type="password" required class="w-full px-4 py-2 border" />
</div>
<div>
<button type="submit"
class="group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
Sign in
</button>
</div>
</form>
Index.jte
@param gg.jte.Content content
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Spring Security Demo</title>
<link rel="stylesheet" href="./main.css">
</head>
<body class="bg-gray-100">
${content}
</body>
</html>
None of the CSS are working.
本文标签: How to use tailwind css 4 with spring boot and Java template EngineStack Overflow
版权声明:本文标题:How to use tailwind css 4 with spring boot and Java template Engine - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741440838a2378909.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论