A stylish webpage modelled after an app for discovering nature tours. Features advanced CSS techniques such as animations, pseudo-classes, clip-paths, SASS mixins and variables, and more! Demonstrates the use of the block-element-modifier naming convention in HTML markup. Also demonstrates the structure of modern SASS architecture.
Part of the "Advanced CSS and Sass: Flexbox, Grid, Animations and More!" course by Jonas Schmedtmann (link below).
- Open index.html in browser
- HTML5, CSS3
- Make sure to type in npm run compile:sass when editing SASS files.
- Auto-reload pages by using "live-server"
-
Install node-sass
npm install node-sass --save-dev
-
Update package.json with script:
"scripts": { "compile:sass": "node-sass sass/main.scss css/style.css -w" },
-
Run script using:
npm run compile:sass
-
Listen for changes using live-server:
npm install live-server -g live-server
-
OPTIONAL: Combine dev scripts into one as follows: (make sure to install npm-run-all package, as demonstrated below)
"watch:sass": "node-sass sass/main.scss css/style.css -w", "devserver": "live-server", "start": "npm-run-all --parallel devserver watch:sass",
This build script is for compiling SASS, concatenating CSS files, prefixing, and compressing
-
Create the following task in package.json:
"compile:sass": "node-sass sass/main.scss css/style.comp.css",
-
Install npm packages:
npm install concat --save-dev npm install autoprefixer --save-dev npm install postcss-cli --save-dev npm install npm-run-all -save-dev
-
and add the following scripts:
"compile:sass": "node-sass sass/main.scss css/style.comp.css", "concat:css": "concat -o css/style.concat.css css/icon-font.css css/style.comp.css", "prefix:css": "postcss --use autoprefixer -b 'last 10 versions' css/style.concat.css -o css/style.prefix.css", "compress:css": "node-sass css/style.prefix.css css/style.css --output-style compressed", "build:css": "npm-run-all compile:sass concat:css prefix:css compress:css"