Use tailwind cli to compile css instead of tailwind cdn (#132)
* implement feature * use npm instead of cli
This commit is contained in:
committed by
Christiaan Goossens
parent
653c716ea8
commit
9bf2372b7e
7
.gitignore
vendored
7
.gitignore
vendored
@@ -107,4 +107,9 @@ dmypy.json
|
||||
# End of https://www.gitignore.io/api/python
|
||||
config/
|
||||
|
||||
.venv
|
||||
.venv
|
||||
|
||||
.pytest_logs.log
|
||||
|
||||
|
||||
node_modules
|
||||
|
||||
@@ -24,6 +24,12 @@ Some useful scripts are in the `scripts` directory. If you run Linux (or WSL und
|
||||
|
||||
You can also run these commands manually on Windows:
|
||||
|
||||
##### Compiling css
|
||||
|
||||
To compile tailwind css styles for the pages you need the NodeJS and NPM installed.
|
||||
|
||||
You can run the `npm run css` script to generate the css once and you can run the `npm run css:watch` to recompile the css every time the templates change
|
||||
|
||||
##### Check
|
||||
```
|
||||
uv run ruff check
|
||||
|
||||
3
custom_components/auth_oidc/static/input.css
Normal file
3
custom_components/auth_oidc/static/input.css
Normal file
@@ -0,0 +1,3 @@
|
||||
@import "tailwindcss";
|
||||
|
||||
@source "../views/templates";
|
||||
2
custom_components/auth_oidc/static/style.css
Normal file
2
custom_components/auth_oidc/static/style.css
Normal file
File diff suppressed because one or more lines are too long
@@ -6,7 +6,7 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{% block title %}{% endblock %}</title>
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<link rel="stylesheet" href="/auth/oidc/static/style.css">
|
||||
{% endblock %}
|
||||
</head>
|
||||
|
||||
@@ -16,4 +16,4 @@
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
||||
1123
package-lock.json
generated
Normal file
1123
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
11
package.json
Normal file
11
package.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "hass-oidc-auth",
|
||||
"scripts": {
|
||||
"css": "tailwindcss -i ./custom_components/auth_oidc/static/input.css -o ./custom_components/auth_oidc/static/style.css --minify",
|
||||
"css:watch": "tailwindcss -i ./custom_components/auth_oidc/static/input.css -o ./custom_components/auth_oidc/static/style.css --watch --minify"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tailwindcss/cli": "^4.1.14",
|
||||
"tailwindcss": "^4.1.14"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user