Skip to content

Commit

Permalink
adding css for horizontal navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
oceanbluesky committed Nov 14, 2024
1 parent 5734855 commit 88900f1
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 13 deletions.
8 changes: 8 additions & 0 deletions __about_these_files.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ run this to build tailwind.css and dx serve index.html:
npm run serve


It will be necessary to handcode this css link in the dist/assets/index.html file:
<link rel="stylesheet" href="assets/styles/tailwind.css">



_____


the 'npm commands' are in package.json (if files are moved update the package.json file as well):

{
Expand Down
19 changes: 11 additions & 8 deletions dist/assets/styles/tailwind.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* Tailwind base styles */

*, ::before, ::after {
--tw-border-spacing-x: 0;
--tw-border-spacing-y: 0;
Expand Down Expand Up @@ -106,9 +108,7 @@
--tw-contain-style: ;
}

/*
! tailwindcss v3.4.14 | MIT License | https://tailwindcss.com
*/
/* ! tailwindcss v3.4.14 | MIT License | https://tailwindcss.com */

/*
1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
Expand Down Expand Up @@ -152,7 +152,7 @@ html,
-moz-tab-size: 4;
/* 3 */
-o-tab-size: 4;
tab-size: 4;
tab-size: 4;
/* 3 */
font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
/* 4 */
Expand Down Expand Up @@ -197,7 +197,7 @@ Add the correct text decoration in Chrome, Edge, and Safari.

abbr:where([title]) {
-webkit-text-decoration: underline dotted;
text-decoration: underline dotted;
text-decoration: underline dotted;
}

/*
Expand Down Expand Up @@ -554,6 +554,8 @@ video {
display: none;
}

/* Import custom styles */

*, ::before, ::after {
--tw-border-spacing-x: 0;
--tw-border-spacing-y: 0;
Expand Down Expand Up @@ -708,7 +710,7 @@ html,
-moz-tab-size: 4;
/* 3 */
-o-tab-size: 4;
tab-size: 4;
tab-size: 4;
/* 3 */
font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
/* 4 */
Expand Down Expand Up @@ -753,7 +755,7 @@ Add the correct text decoration in Chrome, Edge, and Safari.

abbr:where([title]) {
-webkit-text-decoration: underline dotted;
text-decoration: underline dotted;
text-decoration: underline dotted;
}

/*
Expand Down Expand Up @@ -1108,4 +1110,5 @@ video {

[hidden]:where(:not([hidden="until-found"])) {
display: none;
}
}

2 changes: 2 additions & 0 deletions dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
<meta content="text/html;charset=utf-8" http-equiv="Content-Type" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="UTF-8" />
<link rel="stylesheet" href="assets/styles/tailwind.css">


</head>
<body>
Expand Down
25 changes: 25 additions & 0 deletions src/styles/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/* Set nav-list to display items in a row */
.navbar-list {
list-style: none;
/* Remove bullet points */
padding: 0;
margin: 0;
display: flex;
gap: 1rem;
/* Space between items */
}

/* Style each navigation item */
.navbar-item a {
text-decoration: none;
color: inherit;
/* Use the default text color */
padding: 0.5rem 1rem;
}

/* Optional: Add some styling for hover effect */
.navbar-item a:hover {
background-color: #ddd;
/* Light background on hover */
border-radius: 4px;
}
11 changes: 8 additions & 3 deletions src/styles/tailwind.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/* Tailwind base styles */
@tailwind base;
@tailwind components;
@tailwind utilities;

/* Import custom styles */
@import './styles.css';

*, ::before, ::after {
--tw-border-spacing-x: 0;
--tw-border-spacing-y: 0;
Expand Down Expand Up @@ -554,6 +562,3 @@ video {
display: none;
}

@tailwind base;
@tailwind components;
@tailwind utilities;
2 changes: 0 additions & 2 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
/** @type {import('tailwindcss').Config} */

module.exports = {
content: [
"./src/**/*.{rs,html}", // Includes Rust and HTML files in src
"./public/**/*.html", // Includes HTML files in public directory
],
theme: {
extend: {},
Expand Down

0 comments on commit 88900f1

Please sign in to comment.