-
-
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.
Merge pull request #8358 from renanfranca/4339-add-tailwindcss-to-thy…
…meleaf-template add tailwindcss to thymeleaf template module
- Loading branch information
Showing
17 changed files
with
480 additions
and
26 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
127 changes: 122 additions & 5 deletions
127
...generator/server/springboot/thymeleaf/template/domain/ThymeleafTemplateModuleFactory.java
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 */ |
Binary file added
BIN
+29.2 KB
...pringboot/thymeleaf/template/src/main/resources/static/images/ThymeleafLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 19 additions & 17 deletions
36
...tor/server/springboot/thymeleaf/template/src/main/resources/templates/index.html.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,19 +1,21 @@ | ||
<!DOCTYPE html> | ||
<html lang="en" | ||
xmlns:th="http://www.thymeleaf.org" | ||
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" | ||
layout:decorate="~{layout/main}"> | ||
<head> | ||
<title>Thymeleaf project</title> | ||
</head> | ||
<body> | ||
<div layout:fragment="content"> | ||
<div>Welcome to your Spring Boot with Thymeleaf project!</div> | ||
<!-- jhipster-needle-thymeleaf-index-content --> | ||
</div> | ||
<th:block layout:fragment="script-content"> | ||
<!-- Add additional scripts there that are only needed for this page (Application wide scripts should be added in layout/main.html) ---> | ||
<!-- jhipster-needle-thymeleaf-index-script --> | ||
</th:block> | ||
</body> | ||
<html | ||
lang="en" | ||
xmlns:th="http://www.thymeleaf.org" | ||
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" | ||
layout:decorate="~{layout/main}" | ||
> | ||
<head> | ||
<title>Thymeleaf project</title> | ||
</head> | ||
<body> | ||
<div layout:fragment="content"> | ||
<div>Welcome to your Spring Boot with Thymeleaf project!</div> | ||
<!-- jhipster-needle-thymeleaf-index-content --> | ||
</div> | ||
<th:block layout:fragment="script-content"> | ||
<!-- Add additional scripts there that are only needed for this page (Application wide scripts should be added in layout/main.html) ---> | ||
<!-- jhipster-needle-thymeleaf-index-script --> | ||
</th:block> | ||
</body> | ||
</html> |
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
Oops, something went wrong.