Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

L4: Style with Tailwind CSS #6

Draft
wants to merge 3 commits into
base: style-with-route-css
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lesson-04/remix-site/app/tailwind.css
15 changes: 11 additions & 4 deletions lesson-04/remix-site/app/root.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import { Link, Outlet, LiveReload, Links, Meta, Scripts } from "remix";
import globalStylesUrl from "~/styles/global.css";
import styles from "~/tailwind.css";

export const links = () => [
{
rel: "stylesheet",
href: styles,
},
{
rel: "stylesheet",
href: globalStylesUrl,
Expand Down Expand Up @@ -45,12 +50,14 @@ function Document({ children, title }) {
function Layout({ children }) {
return (
<>
<nav className="navbar">
<Link to="/" className="logo">
<nav className="flex justify-between py-5 px-7">
<Link to="/" className="font-extrabold text-2xl text-white">
Remixed Recipes
</Link>
<div className="nav">
<Link to="/recipes">Recipes</Link>
<div>
<Link to="/recipes" className="font-bold text-lg text-gray-400">
Recipes
</Link>
</div>
</nav>
<div className="container">{children}</div>
Expand Down
6 changes: 3 additions & 3 deletions lesson-04/remix-site/app/routes/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ export default function Home() {
return (
<section>
<h1>
Focused on cooking <span class="fundamentals">fundamentals</span> and{" "}
<span className="modern">modern</span> techniques, you are simply going
to <span className="create">create better dishes</span>
Focused on cooking <span className="fundamentals">fundamentals</span>{" "}
and <span className="modern">modern</span> techniques, you are simply
going to <span className="create">create better dishes</span>
</h1>
<Button to="/recipes">Get Started</Button>
</section>
Expand Down
18 changes: 0 additions & 18 deletions lesson-04/remix-site/app/styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,6 @@ a {
margin: 0 auto;
}

.navbar {
display: flex;
justify-content: space-between;
padding: var(--size-5);
}

.logo {
color: white;
font-size: var(--font-size-4);
font-weight: var(--font-weight-8);
}

.nav a {
color: var(--gray-4);
font-weight: var(--font-weight-7);
font-size: var(--font-size-2);
}

/* Content -------------------------------------------------------- */

.page-content {
Expand Down
Loading