This example demonstrates how to use Stylescape with npm and Sass compilation.
- Sass Compilation: Import Stylescape's source Sass files for customization
- Auto-initialization: Components with
data-ssattributes initialize automatically - Live Reload: Development server with automatic CSS recompilation
git clone https://github.com/stylescape/example-npm.git
cd example-npm
npm installStart the development server with live reload:
npm startThis runs the server at http://localhost:3000 and watches for Sass changes.
Compile Sass to CSS:
npm run build├── src/
│ ├── index.html # Main HTML file
│ ├── js/
│ │ └── main.js # JavaScript entry point
│ └── scss/
│ └── main.scss # Sass entry point (imports Stylescape)
├── css/ # Compiled CSS output
└── package.json
Use data-ss attributes for auto-initialization:
<!-- Sidebar -->
<aside data-ss="aside">...</aside>
<!-- Accordion -->
<div data-ss="accordion">...</div>
<!-- Theme Toggle -->
<button data-ss="theme-toggle">...</button>Made with ❤️ by Scape Agency
Contributions are welcome! Please fork the repository and submit a pull request with your changes.
This project is licensed under the MIT license. See the LICENSE file for details.
