Welcome to Natours
Natours is a modern landing page for an adventure tour company, built with advanced CSS and Sass techniques. This quickstart guide will help you get the project running on your local machine in just a few minutes.Natours is a static website built with HTML, CSS/Sass, and vanilla JavaScript. No complex build tools or frameworks required - just compile the Sass and open the HTML file in your browser!
Prerequisites
Before you begin, make sure you have the following installed on your machine:- Node.js (v14 or higher) - Required for the Sass compiler
- npm - Comes bundled with Node.js
- A modern web browser (Chrome, Firefox, Safari, or Edge)
Getting Started
Clone the Repository
First, clone the Natours repository to your local machine:This creates a
natours directory with all the project files.Install Dependencies
Install the required npm packages, which includes the Sass compiler:This installs:
- sass (^1.92.1) - The Sass compiler for compiling
.scssfiles to CSS
The project uses Sass (Dart Sass) to compile stylesheets. This is the only build dependency you need.
Compile Sass to CSS
Compile the Sass files to CSS using the build script:This command:
- Compiles
sass/main.scssintocss/style.css - Watches for file changes with the
-wflag - Automatically recompiles when you save changes to any
.scssfile
Project Structure
Understanding the project structure will help you navigate and modify the codebase:Key Files Explained
index.html
The main HTML file containing all the page content and structure. Located at the project root.
sass/main.scss
The Sass entry point that imports all other stylesheets using the modern
@use syntax.sass/abstracts/_variables.scss
Global variables including the color palette, font sizes, and grid settings.
css/style.css
Auto-generated compiled CSS. Never edit this file directly - modify the Sass files instead.
Understanding the Sass Architecture
Natours uses a modular Sass architecture based on the 7-1 pattern. Thesass/main.scss file imports all modules:
sass/main.scss
Design System
The project uses a consistent design system defined insass/abstracts/_variables.scss:
sass/abstracts/_variables.scss
Viewing the Website
Once you’ve completed the setup steps, you should see:- Hero Header - Stunning hero section with animated text and CTA button
- About Section - Information about tours with image composition
- Features Section - Four key benefits with icons on a skewed background
- Tours Section - Three flip cards showcasing popular tours
- Stories Section - Customer testimonials with background video
- Booking Section - Contact form with custom styled inputs
- Footer - Links and copyright information
- Navigation Menu - Animated hamburger menu with smooth transitions
Development Workflow
Here’s a typical development workflow:Make changes
Edit Sass files in the
sass/ directory. The compiler will automatically regenerate css/style.css.Common Issues
Next Steps
Now that you have Natours running locally, here’s what to explore next:Customize Colors
Learn how to modify the color scheme and create your own brand palette
Sass Architecture
Deep dive into the modular Sass structure and BEM naming conventions
Components Guide
Explore each component: buttons, cards, forms, and more
Animations
Understand the CSS animations and how to create your own effects
Additional Resources
- Repository: github.com/marcosprofile/natours
- Original Course: Advanced CSS and Sass on Udemy
- Sass Documentation: sass-lang.com
This project was created as part of Jonas Schmedtmann’s Advanced CSS and Sass course. It demonstrates modern CSS techniques including Flexbox, CSS Grid, animations, Sass architecture, and responsive design.