A Menu Button component with open/closed state made with:
- Web Components
- CSS Modules
- SCSS
- Webpack
Live demo here
<menu-button>
<span slot="label">
Menu
</span>
</menu-button>
- Clone the repo locally
- From the local folder, run
npm install
to install dependencies
- Run
npm run build-dev
to initialise awebpack-dev-server
, which will hot-reload if the contents of/src/
are changed.
- Run
npm run build-prod
to bundle the app withwebpack
- the generatedbundle.js
will be placed in/dist/
.
NOTE: the index.html will be copied from
/src/
to/dist/
whenbuild-prod
orbuild-dev
are initially run, but changes toindex.html
will not trigger a hot-reload from the dev-server.