From cfb096f5d1c9d3d51dea7b6f862614a7531d0610 Mon Sep 17 00:00:00 2001 From: Torsten Date: Mon, 21 Nov 2022 12:52:39 +0200 Subject: [PATCH] add tailwind (oh the hopeful, they live in bliss) --- Gemfile | 2 ++ Gemfile.lock | 3 +++ Procfile.dev | 1 + bin/dev | 7 +++---- config/tailwind.config.js | 22 ++++++++++++++++++++++ 5 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 config/tailwind.config.js diff --git a/Gemfile b/Gemfile index 317d961..c60045c 100644 --- a/Gemfile +++ b/Gemfile @@ -55,3 +55,5 @@ gem "jsbundling-rails", "~> 1.0" gem "cssbundling-rails", "~> 1.1" gem "importmap-rails", "~> 1.1" + +gem "tailwindcss-rails", "~> 2.0" diff --git a/Gemfile.lock b/Gemfile.lock index c8de43b..d83bccd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -274,6 +274,8 @@ GEM actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) + tailwindcss-rails (2.0.21-x86_64-linux) + railties (>= 6.0.0) temple (0.9.1) thor (1.2.1) tilt (2.0.11) @@ -327,6 +329,7 @@ DEPENDENCIES sassc-rails selenium-webdriver sprockets-rails + tailwindcss-rails (~> 2.0) web-console webdrivers whenever diff --git a/Procfile.dev b/Procfile.dev index 2b0b260..b68bc21 100644 --- a/Procfile.dev +++ b/Procfile.dev @@ -1,3 +1,4 @@ web: bin/rails server -p 3000 js: yarn build --watch css: yarn build:css --watch +css: bin/rails tailwindcss:watch diff --git a/bin/dev b/bin/dev index a1104a5..74ade16 100755 --- a/bin/dev +++ b/bin/dev @@ -1,9 +1,8 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh -if ! command -v foreman &> /dev/null -then +if ! gem list foreman -i --silent; then echo "Installing foreman..." gem install foreman fi -foreman start -f Procfile.dev "$@" +exec foreman start -f Procfile.dev "$@" diff --git a/config/tailwind.config.js b/config/tailwind.config.js new file mode 100644 index 0000000..094432f --- /dev/null +++ b/config/tailwind.config.js @@ -0,0 +1,22 @@ +const defaultTheme = require('tailwindcss/defaultTheme') + +module.exports = { + content: [ + './public/*.html', + './app/helpers/**/*.rb', + './app/javascript/**/*.js', + './app/views/**/*.{erb,haml,html,slim}' + ], + theme: { + extend: { + fontFamily: { + sans: ['Inter var', ...defaultTheme.fontFamily.sans], + }, + }, + }, + plugins: [ + require('@tailwindcss/forms'), + require('@tailwindcss/aspect-ratio'), + require('@tailwindcss/typography'), + ] +}