-
-
Notifications
You must be signed in to change notification settings - Fork 216
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add tailwindcss to thymeleaf template module
See #4339
- Loading branch information
1 parent
3b7cd82
commit 4796c10
Showing
14 changed files
with
287 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
...ources/generator/server/springboot/thymeleaf/template/documentation/thymeleaf.md.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Getting Started | ||
|
||
### Reference Documentation | ||
|
||
* [Thymeleaf](https://www.thymeleaf.org) | ||
|
||
### Guides | ||
The following guides illustrate how to use some features concretely: | ||
|
||
* [Handling Form Submission](https://spring.io/guides/gs/handling-form-submission/) | ||
* [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/) | ||
* [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/) | ||
* [Building REST services with Spring](https://spring.io/guides/tutorials/rest/) | ||
|
||
# Live reload setup | ||
|
||
This project uses NPM and spring-boot-devtools module to have live reloading. | ||
|
||
Use the following steps to get it working: | ||
|
||
1. Run the Spring Boot application with the `default` profile: `./mvnw` | ||
2. From a terminal, run `npm run build && npm run watch` (You can also run `npm run --silent build && npm run --silent watch` if you want less output in the terminal) | ||
3. Your default browser will open at http://localhost:3000 | ||
|
||
You should now be able to change any HTML or CSS and have the browser reload upon saving the file. | ||
|
||
NOTE: If you use a separate authentication server (e.g. social logins, or Keycloak) then after login, | ||
you might get redirected to http://localhost:8080 as opposed to http://localhost:3000. | ||
Be sure to set the port back to `3000` in your browser to have live reload. |
19 changes: 19 additions & 0 deletions
19
src/main/resources/generator/server/springboot/thymeleaf/template/postcss.config.js.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const postcssConfig = { | ||
plugins: [ | ||
require('autoprefixer'), | ||
// jhipster-needle-thymeleaf-postcss-plugins | ||
], | ||
}; | ||
|
||
// If we are in production mode, then add cssnano | ||
if (process.env.NODE_ENV === 'production') { | ||
postcssConfig.plugins.push( | ||
require('cssnano')({ | ||
// use the safe preset so that it doesn't | ||
// mutate or remove code from our css | ||
preset: 'default', | ||
}), | ||
); | ||
} | ||
module.exports = postcssConfig; |
2 changes: 1 addition & 1 deletion
2
...rver/springboot/thymeleaf/template/src/main/resources/static/css/application.css.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<!-- jhipster-needle-thymeleaf-css --> | ||
/* jhipster-needle-thymeleaf-css */ |
8 changes: 8 additions & 0 deletions
8
...main/resources/generator/server/springboot/thymeleaf/template/tailwind.config.js.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/** @type {import('tailwindcss').Config} */ | ||
module.exports = { | ||
content: ['./src/main/resources/templates/**/*.html'], | ||
theme: { | ||
extend: {}, | ||
}, | ||
plugins: [], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/* jhipster-needle-thymeleaf-css */ |
19 changes: 19 additions & 0 deletions
19
src/test/resources/projects/thymeleaf/postcss.config.js.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const postcssConfig = { | ||
plugins: [ | ||
require('autoprefixer'), | ||
// jhipster-needle-thymeleaf-postcss-plugins | ||
], | ||
}; | ||
|
||
// If we are in production mode, then add cssnano | ||
if (process.env.NODE_ENV === 'production') { | ||
postcssConfig.plugins.push( | ||
require('cssnano')({ | ||
// use the safe preset so that it doesn't | ||
// mutate or remove code from our css | ||
preset: 'default', | ||
}), | ||
); | ||
} | ||
|
||
module.exports = postcssConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters