Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eliot-akira/sass-example
Example of using Sass with compile, minify and watch tasks
https://github.com/eliot-akira/sass-example
Last synced: about 1 month ago
JSON representation
Example of using Sass with compile, minify and watch tasks
- Host: GitHub
- URL: https://github.com/eliot-akira/sass-example
- Owner: eliot-akira
- Created: 2015-09-15T12:40:25.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-09-15T18:13:00.000Z (about 9 years ago)
- Last Synced: 2023-02-26T05:09:08.969Z (over 1 year ago)
- Language: HTML
- Size: 133 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sass Example
This example shows a minimal setup for using Sass.
It provides commands to:
- compile Sass to CSS (optionally include source maps)
- minify the result
- watch files for changes to automatically compile during development
## Build
Requirement: [Node.js](https://nodejs.org/) and its included package manager, *npm*
The following commands are run from the root of the project folder.
*Install package dependencies*
```sh
npm install
```*Compile and minify the resulting file*
```sh
npm run build
```*Compile with source maps*
```sh
npm run build:dev
```*Watch for file changes and automatically compile with source maps*
```sh
npm run watch
```## Source maps
Source maps allow mapping the compiled CSS to its source Sass files when using a browser's inspector. This makes development easier by showing which file corresponds to an element's style.
An example is included in this repository. Open *index.html* in a browser, and see that the inspected style shows its source file and line number.
## Style guide
See: [Sass Guide](https://github.com/eliot-akira/sass-guide)
## References
[How to Use npm as a Build Tool](https://github.com/keithamus/npm-scripts-example)