posthtml-use
Use Plugin for PostHTML
Last updated 6 years ago by michael-ciniawsky .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install posthtml-use 
SYNC missed versions from official npm registry.

NPM Node Dependencies DevDependencies Standard Code Style

PostHTML Use

Install

$ npm i -D posthtml-use

Status

Branch Build Coverage
Master travis cover
Develop travis-dev cover-dev
Release/v1.0.0 travis-rel cover-rel

Usage

Add all plugins with @-rule syntax at the top of the file. Options set within the use plugin or loaded directly from package.json or any file.(js|json). Option keys named without the posthtml-prefix and hyphenated names must use quotes.


@use posthtml-bem
// add another...

<!DOCTYPE html>

Options

posthtml([ use({bem: {elemPrefix: '__', modPrefix: '--', modDlmtr: '-'}) ])
posthtml([ use('./package.json') ])
posthtml([ use('./path/to/[file].(js|json)') ])

package.json

{
  "posthtml": {
    "bem": {
      "elemPrefix": "__",
      "modPrefix": "--",
      "modDlmtr": "-"
    }
  }
}

file.(js|json)

module.exports = {
  bem: {
    elemPrefix: '__',
    modPrefix: '--',
    modDlmtr: '-'
  }
}
{
  "bem": {
    "elemPrefix": "__",
    "modPrefix": "--",
    "modDlmtr": "-"
  }
}

Example


@use posthtml-bem

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>PostHTML Use</title>
  </head>
  <body>
    <div block="use">
      <section elem="bem"></section>
      <section elem="bem" mod="awesome"></section>
    </div>
  </body>
</html>

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>PostHTML Use</title>
  </head>
  <body>
    <div class="use">
      <section class="use__bem"></section>
      <section class="use__bem use__bem--awesome"></section>
    </div>
  </body>
</html>

LICENSE MIT

MIT License (MIT)

Copyright (c) 2016 Michael Ciniawsky

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Current Tags

  • 1.0.2                                ...           latest (6 years ago)

3 Versions

  • 1.0.2                                ...           6 years ago
  • 1.0.1                                ...           6 years ago
  • 1.0.0                                ...           6 years ago
Maintainers (2)
Downloads
Total 207
Today 0
This Week 3
This Month 5
Last Day 0
Last Week 1
Last Month 3
Dependencies (2)
Dev Dependencies (8)
Dependents (0)
None

Copyright 2014 - 2021 © npmmirror.com |