diff --git a/.gitignore b/.gitignore index 886f714..a34dab1 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,6 @@ # Ignore master key for decrypting credentials and more. /config/master.key + +/app/assets/builds/* +!/app/assets/builds/.keep diff --git a/Gemfile b/Gemfile index 1a6dc18..e8df00e 100644 --- a/Gemfile +++ b/Gemfile @@ -74,3 +74,5 @@ group :test do gem "selenium-webdriver" gem "webdrivers" end + +gem "tailwindcss-rails", "~> 2.0" diff --git a/Gemfile.lock b/Gemfile.lock index 04c97ee..b32e741 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -187,6 +187,8 @@ GEM sqlite3 (1.6.3-x86_64-linux) stimulus-rails (1.2.1) railties (>= 6.0.0) + tailwindcss-rails (2.0.29-x86_64-linux) + railties (>= 6.0.0) thor (1.2.2) timeout (0.3.2) turbo-rails (1.4.0) @@ -229,6 +231,7 @@ DEPENDENCIES sprockets-rails sqlite3 (~> 1.4) stimulus-rails + tailwindcss-rails (~> 2.0) turbo-rails tzinfo-data web-console diff --git a/Procfile.dev b/Procfile.dev new file mode 100644 index 0000000..023e98a --- /dev/null +++ b/Procfile.dev @@ -0,0 +1,2 @@ +web: bin/rails server -p 3000 +css: bin/rails tailwindcss:watch diff --git a/README.md b/README.md index 3ece999..177d02c 100644 --- a/README.md +++ b/README.md @@ -7,3 +7,12 @@ * [x] Rufo Formatter * [x] Semantic Logging (efficient for dark theme) * [x] Max duration to complete in order to prevent long action +* [x] tailwindcss-rails + +## Interesting Gems to try out + +* [ ] Devise + * [ ] **Noticed** + * [ ] CANCANCAN +* [ ] AASM - State machines +* [ ] SimpleForm diff --git a/app/assets/builds/.keep b/app/assets/builds/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js index ddd546a..b06fc42 100644 --- a/app/assets/config/manifest.js +++ b/app/assets/config/manifest.js @@ -2,3 +2,4 @@ //= link_directory ../stylesheets .css //= link_tree ../../javascript .js //= link_tree ../../../vendor/javascript .js +//= link_tree ../builds diff --git a/app/assets/stylesheets/application.tailwind.css b/app/assets/stylesheets/application.tailwind.css new file mode 100644 index 0000000..1b66ae9 --- /dev/null +++ b/app/assets/stylesheets/application.tailwind.css @@ -0,0 +1,10 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +@layer components { + .btn-primary { + @apply py-2 px-4 bg-blue-200; + } +} + diff --git a/app/controllers/main_controller.rb b/app/controllers/main_controller.rb index 2fecb2c..8bd6bbe 100644 --- a/app/controllers/main_controller.rb +++ b/app/controllers/main_controller.rb @@ -1,10 +1,11 @@ class MainController < ApplicationController def home + logger.info "efficient logging for dark theme" end def about logger.debug "some debugging info" - logger.info "efficient logging for dark theme" + logger.info "line1\nline2\nline3" logger.warn "a warning" logger.error "an error" sleep 3 diff --git a/app/javascript/application.js b/app/javascript/application.js index 0d7b494..7910a2e 100644 --- a/app/javascript/application.js +++ b/app/javascript/application.js @@ -1,3 +1,7 @@ // Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails import "@hotwired/turbo-rails" import "controllers" + +// The two following lines disable Turbo on the whole application +// import { Turbo } from "@hotwired/turbo-rails" +// Turbo.session.drive = false diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 546de3f..a20b992 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -5,6 +5,7 @@ <%= csrf_meta_tags %> <%= csp_meta_tag %> + <%= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload" %> <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %> <%= javascript_importmap_tags %> diff --git a/app/views/main/home.html.erb b/app/views/main/home.html.erb index 50f9854..f9fd17b 100644 --- a/app/views/main/home.html.erb +++ b/app/views/main/home.html.erb @@ -1,2 +1,5 @@
Find me in app/views/main/home.html.erb
+