riot-md-mixin-flex
v1.1.0
Published
A flexbox attribute mixin for Riot.js components.
Downloads
4
Maintainers
Readme
riot-md-mixin-flex
A flexbox attribute mixin for Riot.js components.
Install
$ npm install --save riot-md-mixin-flex
Setup
For use with other riot-md components, this mixin must be named 'flex'
. See riot.mixin
for more information.
const riot = require('riot');
const flex = require('riot-md-mixin-flex');
riot.mixin('flex', flex);
Usage
<md-toolbar -dflex -flex />
<!-- //=> <div class="md-toolbar" dflex flex></div> -->
<my-component -flex="2" />
<!-- //=> <div flex="2"></div> -->
See md-flex-layout to make use of these new attributes.
Attributes
-dflex
Appends a dflex
attribute to the tag's firstElementChild
.
-flex [int]
Appends a flex
attribute to the tag's firstElementChild
.
Passing a value to -flex
will be forwarded to the tag child's attribute.
-flexrow
Appends a flexrow
attribute to the tag's firstElementChild
.
-acenter
Appends an acenter
attribute to the tag's firstElementChild
.
-jcenter
Appends a jcenter
attribute to the tag's firstElementChild
.
License
MIT © Luke Edwards