-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added gem 'gravatar_image_tag' replaced .postcssrc.yml with postcss.config.js fix to babel.config.js (see rails/webpacker#2109 (comment)) add app/javascript/styles/base.css with tailwind imports add stylesheet_pack_tag 'base' to app layout add resolve_paths to config/webpacker.yml add postcss-preset-env, and remove postcss plugins it encompasses play with some example tailwind styles on app/views/pages/hello.html.slim
- Loading branch information
1 parent
1ecb021
commit d8b6b84
Showing
17 changed files
with
376 additions
and
44 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,16 @@ | ||
// Load all the controllers within this directory and all subdirectories. | ||
// Controller files must be named *_controller.js. | ||
|
||
import { Application } from "stimulus" | ||
import { definitionsFromContext } from "stimulus/webpack-helpers" | ||
import { | ||
Application | ||
} from "stimulus" | ||
import { | ||
definitionsFromContext | ||
} from "stimulus/webpack-helpers" | ||
|
||
const application = Application.start() | ||
const context = require.context("controllers", true, /_controller\.js$/) | ||
application.load(definitionsFromContext(context)) | ||
|
||
|
||
console.log("controllers/index") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,4 @@ | |
console.log('Hello World from Webpacker') | ||
|
||
import "controllers" | ||
import '../styles/base.css' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
theme: { | ||
extend: {} | ||
}, | ||
variants: {}, | ||
plugins: [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@import "tailwindcss/base"; | ||
@import "tailwindcss/components"; | ||
@import "tailwindcss/utilities"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,10 @@ | ||
h1 Hello World | ||
.bg-white.mx-auto.max-w-sm.shadow-lg.rounded-lg.border.border-orange-400.p-6.overflow-hidden class="md:flex" | ||
= gravatar_image_tag('lastobelus@mac.com', alt: 'Michael Johnston', class: "block h-16 sm:h-24 rounded-full mx-auto mb-4 sm:mb-0 sm:mr-4 sm:ml-0", gravatar: {size: 96}) | ||
.text-center.sm:text-left.sm:flex-grow | ||
.mb-4 | ||
p.text-xl.leading-tight.text-gray-700 Michael Johnston | ||
p.text-sm.leading-tight.text-gray-500 Developer at Metafeat Apps. | ||
div | ||
button.text-xs.font-semibold.text-teal-700.rounded-full.px-4.py-1.leading-normal.bg-teal-100.border.border-teal-700.shadow class="hover:bg-teal-700 hover:text-white" | ||
| Message | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
GravatarImageTag.configure do |config| | ||
config.default_image = nil # Set this to use your own default gravatar image rather then serving up Gravatar's default image [ 'http://example.com/images/default_gravitar.jpg', :identicon, :monsterid, :wavatar, 404 ]. | ||
config.filetype = nil # Set this if you require a specific image file format ['gif', 'jpg' or 'png']. Gravatar's default is png | ||
config.include_size_attributes = false # The height and width attributes of the generated img will be set to avoid page jitter as the gravatars load. Set to false to leave these attributes off. | ||
config.rating = nil # Set this if you change the rating of the images that will be returned ['G', 'PG', 'R', 'X']. Gravatar's default is G | ||
config.size = nil # Set this to globally set the size of the gravatar image returned (1..512). Gravatar's default is 80 | ||
config.secure = true # Set this to true if you require secure images on your pages. | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
let environment = { | ||
plugins: [ | ||
require('postcss-import'), | ||
require('postcss-flexbugs-fixes'), | ||
require('tailwindcss')('./app/javascript/src/tailwind.js'), | ||
require('postcss-preset-env')({ | ||
autoprefixer: { | ||
flexbox: 'no-2009' | ||
}, | ||
stage: 3 | ||
}) | ||
] | ||
} | ||
|
||
// Only run PurgeCSS in production (you can also add staging here) | ||
if (process.env.RAILS_ENV === "production") { | ||
environment.plugins.push( | ||
require('@fullhuman/postcss-purgecss')({ | ||
content: [ | ||
'./app/**/*.html.erb', | ||
'./app/**/*.html.slim', | ||
'./app/helpers/**/*.rb', | ||
'./app/javascript/**/*.js', | ||
'./app/javascript/**/*.js.erb', | ||
'./app/javascript/**/*.vue', | ||
'./app/javascript/**/*.jsx', | ||
], | ||
defaultExtractor: content => content.match(/[A-Za-z0-9-_:/]+/g) || [] | ||
}) | ||
) | ||
} | ||
module.exports = environment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.