# fastred-bem

> Web development bootstrap with extendable BEM blocks, Fastred modules and Webpack configuration.

Latest version **0.1.1** (published 2019-02-10) · ISC license · 0 weekly downloads

## Install

```sh
npm install fastred-bem
pnpm add fastred-bem
yarn add fastred-bem
bun add fastred-bem
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2019-02-10 |
| First published | 2019-02-10 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 31 |
| Unpacked size | 130.1 KB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| Author | Dehero |
| Maintainers | dehero |

## Links

- npm: https://www.npmjs.com/package/fastred-bem
- npm.io page: https://npm.io/package/fastred-bem

## Dependencies (31)

- [pug](https://npm.io/package/pug.md) ^2.0.0-rc.2
- [temp](https://npm.io/package/temp.md) ^0.8.3
- [brace](https://npm.io/package/brace.md) ^0.10.0
- [jquery](https://npm.io/package/jquery.md) ^3.2.1
- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.1
- [stylus](https://npm.io/package/stylus.md) ^0.54.5
- [fastred](https://npm.io/package/fastred.md) ^0.1.0
- [mark.js](https://npm.io/package/mark.js.md) ^8.11.1
- [webpack](https://npm.io/package/webpack.md) ^3.4.1
- [autosize](https://npm.io/package/autosize.md) ^4.0.0
- [rev-hash](https://npm.io/package/rev-hash.md) ^2.0.0
- [css-loader](https://npm.io/package/css-loader.md) ^0.28.4
- [pug-loader](https://npm.io/package/pug-loader.md) ^2.3.0
- [svg-sprite](https://npm.io/package/svg-sprite.md) ^1.3.7
- [url-loader](https://npm.io/package/url-loader.md) ^0.5.9
- [file-loader](https://npm.io/package/file-loader.md) ^0.11.2
- [autoprefixer](https://npm.io/package/autoprefixer.md) ^7.1.2
- [style-loader](https://npm.io/package/style-loader.md) ^0.19.0
- [jquery-inview](https://npm.io/package/jquery-inview.md) ^1.1.2
- [stylus-loader](https://npm.io/package/stylus-loader.md) ^3.0.1
- [jquery-taphold](https://npm.io/package/jquery-taphold.md) ^1.0.0
- [postcss-loader](https://npm.io/package/postcss-loader.md) ^1.3.3
- [postcss-sprites](https://npm.io/package/postcss-sprites.md) ^4.2.1
- [postcss-iconfont](https://npm.io/package/postcss-iconfont.md) ^1.0.0
- [config-merge-loader](https://npm.io/package/config-merge-loader.md) ^1.0.0-beta.6
- [clean-webpack-plugin](https://npm.io/package/clean-webpack-plugin.md) ^0.1.16
- [merge-webpack-plugin](https://npm.io/package/merge-webpack-plugin.md) ^0.2.1
- [iconfont-webpack-plugin](https://npm.io/package/iconfont-webpack-plugin.md) ^3.0.1
- [webpack-livereload-plugin](https://npm.io/package/webpack-livereload-plugin.md) ^0.11.0
- [extract-text-webpack-plugin](https://npm.io/package/extract-text-webpack-plugin.md) ^3.0.0
- [directory-named-webpack-plugin](https://npm.io/package/directory-named-webpack-plugin.md) ^2.2.3

## Recent versions

- 0.1.1 (latest) — 2019-02-10
- 0.1.0 — 2019-02-10

## README

# Fastred-BEM

> Web development bootstrap with extendable BEM blocks, Fastred modules and Webpack configuration.

Based on:

- BEM
- Fastred
- Webpack

Languages:

- Pug
- Stylus
- JavaScript
- PHP

Components:

- pug-php
- Fastred

## JavaScript

### Requirements

* Webpack

### Installation

    npm install fastred-bem
    
## PHP

### Requirements

* [PHP 5.3+](http://www.php.net/downloads.php)

### Installation

    composer require dehero/fastred-bem
## File structure of block

Common block file structure looks like this:
```
block
|---block.pug
|---block__item.pug
|---block.styl
|---block.js
|---block.json
|---block.css.styl
```

### block.js

```javascript
require('block/block.css.styl');
template('block', require('block/block.pug'));
template('block__item', require('block/block__item.pug'));
```

### block.styl

Here you declare global stylus variables and mixins and load json with `json` function:

```stylus
$json = json('./block.json', {hash: true})

$block__variable_1 = $json.block__variable_1
$block__variable_2 = #fff

block__mixin()
    color $block__variable_2
```

The file is loaded when you call `@require block` in Stylus files of other blocks. 

> Don't put classes inside `block.styl`. 
> If you do this and use `@require block` more than once in your project, these classes will double in the output CSS.
> `block.css.styl` should be used for defining classes, as it's required only once by `block.js`.

### block.css.styl

Here you declare classes and other stuff that goes to output CSS:

```stylus
@require 'block/block.styl'
@require block1
@require block2

.block
  color $block1__color
  background #fff
  
  &_dark
    background #000
  
.block__item
  color $block2__color
  
  &_size
  
    &_l
      font-size 1.5rem
  
    &_xl
      font-size 2rem
```

---
_Source: https://npm.io/package/fastred-bem · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
