Tailwind + mobile friendly
This commit is contained in:
5
.gitignore
vendored
5
.gitignore
vendored
@@ -33,3 +33,8 @@
|
||||
|
||||
# Ignore master key for decrypting credentials and more.
|
||||
/config/master.key
|
||||
|
||||
/app/assets/builds/*
|
||||
!/app/assets/builds/.keep
|
||||
|
||||
vendor/bundle
|
||||
|
||||
2
Gemfile
2
Gemfile
@@ -55,3 +55,5 @@ group :test do
|
||||
gem "capybara"
|
||||
gem "selenium-webdriver"
|
||||
end
|
||||
|
||||
gem "tailwindcss-rails", "~> 3.0"
|
||||
|
||||
@@ -247,6 +247,10 @@ GEM
|
||||
stimulus-rails (1.3.4)
|
||||
railties (>= 6.0.0)
|
||||
stringio (3.1.1)
|
||||
tailwindcss-rails (3.0.0)
|
||||
railties (>= 7.0.0)
|
||||
tailwindcss-ruby
|
||||
tailwindcss-ruby (3.4.14-x86_64-linux)
|
||||
thor (1.3.2)
|
||||
timeout (0.4.1)
|
||||
turbo-rails (2.0.11)
|
||||
@@ -286,6 +290,7 @@ DEPENDENCIES
|
||||
sprockets-rails
|
||||
sqlite3 (>= 1.4)
|
||||
stimulus-rails
|
||||
tailwindcss-rails (~> 3.0)
|
||||
turbo-rails
|
||||
tzinfo-data
|
||||
web-console
|
||||
|
||||
2
Procfile.dev
Normal file
2
Procfile.dev
Normal file
@@ -0,0 +1,2 @@
|
||||
web: bin/rails server
|
||||
css: bin/rails tailwindcss:watch
|
||||
0
app/assets/builds/.keep
Normal file
0
app/assets/builds/.keep
Normal file
@@ -1,2 +1,3 @@
|
||||
//= link_tree ../images
|
||||
//= link_directory ../stylesheets .css
|
||||
//= link_tree ../builds
|
||||
|
||||
@@ -13,44 +13,51 @@
|
||||
*= require_tree .
|
||||
*= require_self
|
||||
*/
|
||||
@import url('https://fonts.googleapis.com/css2?family=Fleur+De+Leah&display=swap');
|
||||
/* html, body { */
|
||||
/* margin: 0; */
|
||||
/* padding: 0; */
|
||||
/* height: 100%; */
|
||||
/* } */
|
||||
|
||||
html, body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
height: 100%;
|
||||
}
|
||||
/* #container { */
|
||||
/* background-color: darkseagreen; */
|
||||
/* height: 100%; */
|
||||
/* } */
|
||||
|
||||
#container {
|
||||
background-color: darkseagreen;
|
||||
height: 100%;
|
||||
}
|
||||
/* #navbar > ul { */
|
||||
/* list-style-type: none; */
|
||||
/* } */
|
||||
/* #navbar > ul > li { */
|
||||
/* float: left; */
|
||||
/* font-size: 1.25em; */
|
||||
/* margin-top: 16px; */
|
||||
/* margin-left: 30px; */
|
||||
/* color: cornsilk; */
|
||||
/* } */
|
||||
|
||||
#navbar > ul {
|
||||
list-style-type: none;
|
||||
}
|
||||
#navbar > ul > li {
|
||||
float: left;
|
||||
font-size: 1.25em;
|
||||
margin-top: 16px;
|
||||
margin-left: 30px;
|
||||
color: cornsilk;
|
||||
}
|
||||
/* #logo { */
|
||||
/* font-size: 1.5em; */
|
||||
/* padding: 12px 20px; */
|
||||
/* float: left; */
|
||||
/* color: cornsilk; */
|
||||
/* } */
|
||||
|
||||
#logo {
|
||||
font-size: 1.5em;
|
||||
padding: 12px 20px;
|
||||
float: left;
|
||||
color: cornsilk;
|
||||
}
|
||||
/* .nav-column-member { */
|
||||
/* float: left; */
|
||||
/* font-size: 1.25em; */
|
||||
/* padding: 16px 30px; */
|
||||
/* } */
|
||||
|
||||
.nav-column-member {
|
||||
float: left;
|
||||
font-size: 1.25em;
|
||||
padding: 16px 30px;
|
||||
}
|
||||
/* #main-content { */
|
||||
/* clear: left; */
|
||||
/* background-color: cornsilk; */
|
||||
/* height: 100%; */
|
||||
/* } */
|
||||
|
||||
#main-content {
|
||||
clear: left;
|
||||
background-color: cornsilk;
|
||||
height: 100%;
|
||||
|
||||
.fleur-de-leah-regular {
|
||||
font-family: "Fleur De Leah", cursive;
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
13
app/assets/stylesheets/application.tailwind.css
Normal file
13
app/assets/stylesheets/application.tailwind.css
Normal file
@@ -0,0 +1,13 @@
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
/*
|
||||
|
||||
@layer components {
|
||||
.btn-primary {
|
||||
@apply py-2 px-4 bg-blue-200;
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
@@ -1 +1 @@
|
||||
<h1>Hello, Rails!</h1>
|
||||
<h1 class="text-3xl font-bold underline">Hello, Rails!</h1>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title><%= content_for(:title) || "Weddingplan" %></title>
|
||||
<title><%= content_for(:title) || "Jillian and Adam's Wedding" %></title>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<%= csrf_meta_tags %>
|
||||
@@ -13,26 +13,40 @@
|
||||
<link rel="icon" href="/icon.png" type="image/png">
|
||||
<link rel="icon" href="/icon.svg" type="image/svg+xml">
|
||||
<link rel="apple-touch-icon" href="/icon.png">
|
||||
<%= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload" %>
|
||||
<%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="container">
|
||||
<div id="navbar">
|
||||
<div id="logo">
|
||||
A & J Wedding
|
||||
<nav class="flex items-center justify-between flex-wrap bg-[#8fbc8f]">
|
||||
<div class="text-4xl text-amber-100 fleur-de-leah-regular">
|
||||
Jillian and Adam's Wedding
|
||||
</div>
|
||||
<ul>
|
||||
<li>Order of Events</li>
|
||||
<li>Travel</li>
|
||||
<li>Accommodation</li>
|
||||
<li>Dress</li>
|
||||
<li>Gifts</li>
|
||||
</ul>
|
||||
<div id="burger-menu" class="block lg:hidden">
|
||||
<button class="flex items-center px-3 py-2 border rounded text-amber-100 border-amber-100 hover:text-white hover:border-white">
|
||||
<svg class="fill-current h-3 w-3" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><title>Menu</title><path d="M0 3h20v2H0V3zm0 6h20v2H0V9zm0 6h20v2H0v-2z"/></svg>
|
||||
</button>
|
||||
</div>
|
||||
<div class="w-full block flex-grow lg:flex lg:w-auto lg:justify-end">
|
||||
<div id="nav-links" class="text-md max-sm:hidden flex flex-col lg:flex-row lg:mr-4">
|
||||
<a href="#" class="block mt-4 lg:inline-block lg:mt-0 text-amber-100 hover:text-white mr-4">Ceremony & Reception</a>
|
||||
<a href="#" class="block mt-4 lg:inline-block lg:mt-0 text-amber-100 hover:text-white mr-4">Accommodations</a>
|
||||
<a href="#" class="block mt-4 lg:inline-block lg:mt-0 text-amber-100 hover:text-white mr-4">Dress</a>
|
||||
<a href="#" class="block mt-4 lg:inline-block lg:mt-0 text-amber-100 hover:text-white mr-4">Registry</a>
|
||||
<a href="#" class="block mt-4 lg:inline-block lg:mt-0 text-amber-100 hover:text-white">RSVP</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<div id="main-content">
|
||||
<%= yield %>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var burgerMenu = document.getElementById('burger-menu');
|
||||
var navLinks = document.getElementById('nav-links');
|
||||
burgerMenu.addEventListener('click', function() {
|
||||
navLinks.classList.toggle("max-sm:hidden");
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
16
bin/dev
Executable file
16
bin/dev
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
if ! gem list foreman -i --silent; then
|
||||
echo "Installing foreman..."
|
||||
gem install foreman
|
||||
fi
|
||||
|
||||
# Default to port 3000 if not specified
|
||||
export PORT="${PORT:-3000}"
|
||||
|
||||
# Let the debug gem allow remote connections,
|
||||
# but avoid loading until `debugger` is called
|
||||
export RUBY_DEBUG_OPEN="true"
|
||||
export RUBY_DEBUG_LAZY="true"
|
||||
|
||||
exec foreman start -f Procfile.dev "$@"
|
||||
22
config/tailwind.config.js
Normal file
22
config/tailwind.config.js
Normal file
@@ -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/typography'),
|
||||
require('@tailwindcss/container-queries'),
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user