Skip to content

Commit 2477219

Browse files
➕ Add Tailwind for CSS
1 parent c67f67e commit 2477219

File tree

11 files changed

+80
-1
lines changed

11 files changed

+80
-1
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,6 @@
3333

3434
# Ignore master key for decrypting credentials and more.
3535
/config/master.key
36+
37+
/app/assets/builds/*
38+
!/app/assets/builds/.keep

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,5 @@ group :test do
5555
gem "capybara"
5656
gem "selenium-webdriver"
5757
end
58+
59+
gem "tailwindcss-rails", "~> 2.7"

Gemfile.lock

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,18 @@ GEM
268268
railties (>= 6.0.0)
269269
stringio (3.1.1)
270270
strscan (3.1.0)
271+
tailwindcss-rails (2.7.3)
272+
railties (>= 7.0.0)
273+
tailwindcss-rails (2.7.3-aarch64-linux)
274+
railties (>= 7.0.0)
275+
tailwindcss-rails (2.7.3-arm-linux)
276+
railties (>= 7.0.0)
277+
tailwindcss-rails (2.7.3-arm64-darwin)
278+
railties (>= 7.0.0)
279+
tailwindcss-rails (2.7.3-x86_64-darwin)
280+
railties (>= 7.0.0)
281+
tailwindcss-rails (2.7.3-x86_64-linux)
282+
railties (>= 7.0.0)
271283
thor (1.3.2)
272284
timeout (0.4.1)
273285
turbo-rails (2.0.6)
@@ -321,6 +333,7 @@ DEPENDENCIES
321333
sprockets-rails
322334
sqlite3 (>= 1.4)
323335
stimulus-rails
336+
tailwindcss-rails (~> 2.7)
324337
turbo-rails
325338
tzinfo-data
326339
web-console

Procfile.dev

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
web: bin/rails server
2+
css: bin/rails tailwindcss:watch

app/assets/builds/.keep

Whitespace-only changes.

app/assets/config/manifest.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
//= link_directory ../stylesheets .css
33
//= link_tree ../../javascript .js
44
//= link_tree ../../../vendor/javascript .js
5+
//= link_tree ../builds

app/assets/stylesheets/application.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,7 @@
1313
*= require_tree .
1414
*= require_self
1515
*/
16+
17+
@tailwind base;
18+
@tailwind components;
19+
@tailwind utilities;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;
4+
5+
/*
6+
7+
@layer components {
8+
.btn-primary {
9+
@apply py-2 px-4 bg-blue-200;
10+
}
11+
}
12+
13+
*/

app/views/layouts/application.html.erb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,14 @@
1313
<link rel="icon" href="/icon.png" type="image/png">
1414
<link rel="icon" href="/icon.svg" type="image/svg+xml">
1515
<link rel="apple-touch-icon" href="/icon.png">
16+
<%= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload" %>
1617
<%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
1718
<%= javascript_importmap_tags %>
1819
</head>
1920

2021
<body>
21-
<%= yield %>
22+
<main class="container mx-auto mt-28 px-5 flex">
23+
<%= yield %>
24+
</main>
2225
</body>
2326
</html>

bin/dev

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env sh
2+
3+
if ! gem list foreman -i --silent; then
4+
echo "Installing foreman..."
5+
gem install foreman
6+
fi
7+
8+
# Default to port 3000 if not specified
9+
export PORT="${PORT:-3000}"
10+
11+
# Let the debug gem allow remote connections,
12+
# but avoid loading until `debugger` is called
13+
export RUBY_DEBUG_OPEN="true"
14+
export RUBY_DEBUG_LAZY="true"
15+
16+
exec foreman start -f Procfile.dev "$@"

0 commit comments

Comments
 (0)