Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lucadb/twig_static_scaffolding

Boilerplate for static site/frontend generator using twig.js, scoped css (cssmodules) and live code injection (HTML/CSS).
https://github.com/lucadb/twig_static_scaffolding

browsersync cssmodules twig

Last synced: about 13 hours ago
JSON representation

Boilerplate for static site/frontend generator using twig.js, scoped css (cssmodules) and live code injection (HTML/CSS).

Awesome Lists containing this project

README

        

## TL;DR

1. clone the repo
2. install/update [nvm](https://github.com/creationix/nvm) then type `nvm use` to setup node version
3. `npm i`
4. `npm run dev`
5. create components `npm run component -- [component_name]`

## Using scoped CSS
When you run for example `npm run component -- header` the script creates a folder in `src/html/components` like this:

```
|-- src
|-- html
|-- components
|-- header
|-- header.twig
|-- style.scss
```

In `style.scss` file you can write scoped css, for example:

```
.header {
height: 200px;
background: #fafafa;
}
```

And in `header.twig` you can reference the class name like this:


...

This compiles in:


...

For all css modules api please refer to [css modules repo](https://github.com/css-modules/css-modules).