Skip to content

Commit

Permalink
Add support for tailwindcss
Browse files Browse the repository at this point in the history
  • Loading branch information
yatish27 committed Apr 19, 2024
1 parent 2c647b6 commit 516ab89
Show file tree
Hide file tree
Showing 11 changed files with 676 additions and 101 deletions.
1 change: 1 addition & 0 deletions app/frontend/entrypoints/application.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import "~/stylesheets/index.css";
7 changes: 5 additions & 2 deletions app/frontend/stylesheets/index.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
@import "modern-normalize";
@import "reset";
@import "tailwindcss/base";
@import "tailwindcss/components";
@import "tailwindcss/utilities";

@import "base";

36 changes: 0 additions & 36 deletions app/frontend/stylesheets/reset.css

This file was deleted.

12 changes: 10 additions & 2 deletions app/views/home/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
<% provide(:title, "Home") %>
<p>Find me in app/views/home/index.html.erb</p>
<p>Stimulus says, <i data-controller=hello></i></p>
<div class="bg-gray-100 py-8">
<div class="max-w-3xl mx-auto px-4 sm:px-6 lg:px-8">
<h1 class="text-3xl font-bold text-gray-900 mb-4">Welcome</h1>
<p class="text-lg text-gray-600 mb-6">Find me in app/views/home/index.html.erb</p>
<p class="text-lg text-gray-600">
Stimulus says,
<i class="italic text-indigo-600" data-controller="hello">Hello, World!</i>
</p>
</div>
</div>
2 changes: 2 additions & 0 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

<%= vite_client_tag %>
<%= vite_javascript_tag "application", "data-turbo-track": "reload" %>
<%= vite_stylesheet_tag "application", data: {"turbo-track": "reload"} %>

<!--
If using a TypeScript entrypoint file:
vite_typescript_tag 'application'
Expand Down
Binary file modified bun.lockb
Binary file not shown.
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@
"dependencies": {
"@hotwired/stimulus": "^3.2.2",
"@hotwired/turbo-rails": "^8.0.4",
"autoprefixer": "^10.4.14",
"autoprefixer": "^10.4.19",
"modern-normalize": "^2.0.0",
"postcss": "^8.4.24",
"postcss": "^8.4.38",
"rollup": "^4.2.0",
"stimulus-vite-helpers": "^3.1.0",
"vite": "^5.0.0",
"vite-plugin-rails": "^0.5.0"
},
"devDependencies": {
"tailwindcss": "^3.4.3"
}
}
3 changes: 0 additions & 3 deletions postcss.config.cjs

This file was deleted.

6 changes: 6 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};
18 changes: 18 additions & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/** @type {import('tailwindcss').Config} */

export default {
darkMode: ["class"],
content: [
"./app/views/**/*.{erb,haml,html,slim,rb}",
"./app/views/components/**/*.rb",
"./app/helpers/**/*.rb",
"./app/assets/stylesheets/**/*.css",
"./app/javascript/**/*.js",
"./app/frontend/**/*.css",
"./app/frontend/**/*.js",
],
theme: {
extend: {},
},
plugins: [],
};
Loading

0 comments on commit 516ab89

Please sign in to comment.