Skip to content

Commit 038ef18

Browse files
committed
variables.css setup with footer and header.css
1 parent 14105c4 commit 038ef18

File tree

4 files changed

+78
-52
lines changed

4 files changed

+78
-52
lines changed

assets/css/footer.css

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1+
@import url('./global/variables.css'); /* Import CSS variables */
2+
13
/* Footer container styling */
24
footer {
3-
background-color: var(--footer-bg-color, #8f7e73); /* Blue background */
4-
color: var(--footer-text-color, #000000); /* Use CSS variable with fallback */
5+
background-color: var(--footer-bg-color); /* Use CSS variable */
6+
color: var(--footer-text-color); /* Use CSS variable */
57
text-align: center; /* Center-align text */
6-
padding: 20px 10px; /* Add spacing: 20px vertical, 10px horizontal */
7-
font-size: 14px; /* Set a smaller font size */
8-
font-family: 'Comic Sans MS', 'Comic Sans', cursive; /* Add Comic Sans font family */
9-
border-top: 1px solid var(--footer-border-color, #eaeaea); /* Add a subtle border at the top using a CSS variable */
8+
padding: var(--footer-padding-vertical) var(--footer-padding-horizontal); /* Use CSS variables for padding */
9+
font-size: var(--footer-font-size); /* Use CSS variable for font size */
10+
font-family: var(--footer-font-family); /* Use CSS variable for font family */
11+
border-top: 1px solid var(--footer-border-color); /* Use CSS variable for border color */
1012
}
1113

1214
/* Footer text styling */
@@ -17,11 +19,11 @@ footer p {
1719

1820
/* Add hover effect for links in the footer */
1921
footer a {
20-
color: var(--footer-link-color, #5a7fa3); /* Use CSS variable with fallback */
22+
color: var(--footer-link-color); /* Use CSS variable for link color */
2123
text-decoration: none; /* Remove underline */
2224
}
2325

2426
footer a:hover {
2527
text-decoration: underline; /* Add underline on hover */
26-
color: var(--footer-link-hover-color, #0056b3); /* Add slight color change for better feedback */
28+
color: var(--footer-link-hover-color); /* Use CSS variable for hover color */
2729
}

assets/css/global/variables.css

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/* Colors */
2+
:root { /* Why use :root? It ensures the variables are globally scoped and available throughout the entire document. */
3+
/* General Colors */
4+
--primary-color: #007bff;
5+
--primary-color-hover: #0056b3;
6+
--secondary-color: #f8f9fa;
7+
--body-text-color: #333;
8+
--link-color: #00e;
9+
--link-hover-color: #0056b3;
10+
11+
/* Fonts */
12+
--font-family-sans: 'Arial', sans-serif;
13+
--font-family-serif: 'Georgia', serif;
14+
--font-size-base: 16px;
15+
--font-size-large: 1.5rem;
16+
--font-size-small: 0.875rem;
17+
18+
/* Spacing */
19+
--spacing-small: 8px;
20+
--spacing-medium: 16px;
21+
--spacing-large: 24px;
22+
23+
/* Borders */
24+
--border-radius: 4px; /* Default border radius */
25+
--border-color: #ddd;
26+
27+
/* Footer Variables */
28+
--footer-bg-color: #8f62d8; /* Default background color */
29+
--footer-text-color: #000000; /* Default text color */
30+
--footer-border-color: #eaeaea; /* Default border color */
31+
--footer-link-color: #5a7fa3; /* Default link color */
32+
--footer-link-hover-color: #004080; /* Unique link hover color for better distinction */
33+
--footer-font-family: 'Arial', sans-serif; /* Default font family */
34+
--footer-font-size: 14px; /* Default font size */
35+
--footer-padding-vertical: 20px; /* Vertical padding */
36+
--footer-padding-horizontal: 10px; /* Horizontal padding */
37+
38+
/* Header Variables */
39+
--header-bg-color: #0a3d70; /* Light gray background */
40+
--header-text-color: #333; /* Dark text color */
41+
--header-logo-color: #007bff; /* Logo color */
42+
--header-logo-hover-color: #0056b3; /* Logo hover color */
43+
--header-font-family: 'Arial', sans-serif; /* Default font family */
44+
--header-font-size: 1.5rem; /* Font size for header logo */
45+
--header-padding: 20px; /* Padding around the header */
46+
--header-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
47+
--header-nav-gap: 15px; /* Spacing between navigation items */
48+
--header-nav-link-color: #333; /* Navigation link color */
49+
--header-nav-link-hover-bg: #007bff; /* Navigation link hover background */
50+
--header-nav-link-hover-color: #fff; /* Navigation link hover text color */
51+
}

assets/css/header.css

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@import url('./global/variables.css'); /* Import CSS variables */
2+
13
/* ============================
24
Header Stylesheet
35
============================
@@ -7,26 +9,27 @@
79

810
/* General Header Styles */
911
header {
10-
background-color: #f8f9fa; /* Light gray background */
11-
color: #333; /* Dark text color */
12-
padding: 20px; /* Spacing around the header */
13-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
12+
background-color: var(--header-bg-color);
13+
color: var(--header-text-color);
14+
padding: var(--header-padding);
15+
box-shadow: var(--header-shadow);
1416
position: relative;
1517
z-index: 1000; /* Ensure header is above other elements */
1618
width: 100%; /* Make the header span the full width of the page */
1719
margin: 0; /* Remove any default margins */
20+
font-family: var(--header-font-family);
1821
}
1922

2023
/* Logo Styles */
2124
header .logo {
22-
font-size: 1.5rem; /* Larger font size for logo */
25+
font-size: var(--header-font-size);
2326
font-weight: bold; /* Bold text for emphasis */
2427
text-decoration: none; /* Remove underline */
25-
color: #007bff; /* Primary color for logo */
28+
color: var(--header-logo-color);
2629
}
2730

2831
header .logo:hover {
29-
color: #0056b3; /* Darker shade on hover */
32+
color: var(--header-logo-hover-color);
3033
}
3134

3235
/* Navigation Styles */
@@ -37,14 +40,15 @@ header nav {
3740
max-width: 1200px; /* Limit the content width */
3841
margin: 0 auto; /* Center the content horizontally */
3942
width: 100%; /* Ensure the nav spans the full width of the header */
43+
gap: var(--header-nav-gap);
4044
}
4145

4246
header nav ul {
4347
list-style: none; /* Remove default list styling */
4448
margin: 0; /* Reset margin */
4549
padding: 0; /* Reset padding */
4650
display: flex; /* Flexbox for horizontal layout */
47-
gap: 15px; /* Spacing between nav items */
51+
gap: var(--header-nav-gap);
4852
}
4953

5054
header nav ul li {
@@ -53,16 +57,16 @@ header nav ul li {
5357

5458
header nav ul li a {
5559
text-decoration: none; /* Remove underline */
56-
color: #333; /* Dark text color */
60+
color: var(--header-nav-link-color);
5761
font-size: 1rem; /* Standard font size */
58-
padding: 5px 10px; /* Padding for clickable area */
59-
border-radius: 4px; /* Rounded corners */
62+
padding: var(--spacing-small) var(--spacing-medium); /* Padding for clickable area */
63+
border-radius: var(--border-radius); /* Rounded corners */
6064
transition: background-color 0.3s, color 0.3s; /* Smooth hover effect */
6165
}
6266

6367
header nav ul li a:hover {
64-
background-color: #007bff; /* Primary color background */
65-
color: #fff; /* White text on hover */
68+
background-color: var(--header-nav-link-hover-bg); /* Primary color background */
69+
color: var(--header-nav-link-hover-color); /* White text on hover */
6670
}
6771

6872
/* Responsive Design */

assets/css/variables.css

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)