Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tailwind support for Geoweaver - UI Enchanment #485

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "geoweaver",
"version": "1.0.0",
"description": "[![CircleCI](https://circleci.com/gh/ZihengSun/Geoweaver/tree/master.svg?style=svg)](https://circleci.com/gh/ZihengSun/Geoweaver/tree/master) [![License](https://img.shields.io/github/license/ESIPFed/Geoweaver.svg)](https://github.com/ESIPFed/Geoweaver/blob/master/LICENSE) [![Stars](https://img.shields.io/github/stars/ESIPFed/Geoweaver.svg)](https://github.com/ESIPFed/Geoweaver/stargazers) [![Forks](https://img.shields.io/github/forks/ESIPFed/Geoweaver.svg)](https://github.com/ESIPFed/Geoweaver/network/members) [![Issues](https://img.shields.io/github/issues/ESIPFed/Geoweaver.svg)](https://github.com/ESIPFed/Geoweaver/issues) [![Coverage](https://img.shields.io/badge/coverage-100%25-success.svg)](https://codecov.io/)",
"main": "index.js",
"directories": {
"doc": "docs",
"lib": "lib"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build:css": "tailwindcss -i ./src/main/resources/static/css/style.css -o ./src/main/resources/static/css/tailwind.css --watch"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"autoprefixer": "^10.4.19",
"postcss": "^8.4.38",
"tailwindcss": "^3.4.1"
}
}
6 changes: 6 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
11 changes: 8 additions & 3 deletions src/main/resources/static/css/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
/*@import "tailwindcss/components.css";*/
/*@import "tailwindcss/utilities.css";*/

@font-face {
font-family: 'Raleway';
font-style: normal;
Expand Down Expand Up @@ -89,10 +95,9 @@ section {

.font-default {
/*font-family: "Open Sans", Helvetica, Arial;*/
font-family: "Times New Roman", Times, serif
font-family: "Times New Roman", Times, serif;
font-weight: 200;
font-size: 1.6rem,
color:
font-size: 1.6rem;
}

.font-default h1 {
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/templates/fragments/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,6 @@

<script type="text/javascript" src="../js/intro.min.js"></script>

<link rel="stylesheet" href="../css/tailwind.css">
Copy link
Collaborator

@saivivek116 saivivek116 Apr 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we have to add this in our project? can we use CDN here instead of including entire source of tailwindcss in our project?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its better to use a local version
it is same across all the lib we use in the project

Copy link
Collaborator

@saivivek116 saivivek116 Apr 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it
We need to build the tailwind.css using the command
npm install tailwindcss --save-dev
npm run build:css which will automatically build the tailwind.css for our project optimally
The tailwind functionality is working fine
Pls Add nodemodules inside .gitignore file to avoid nodemodules pushed into project mistakenly
Add the above css build step in the ci/cd
everything looks good to me


</head>
16 changes: 16 additions & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
prefix: "tw-",
content: [
"./src/main/resources/templates/**/*.html",
"./src/main/java/**/*.java",
],
theme: {
extend: {},
},
corePlugins: {
preflight: false,
},
plugins: [],
}