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

https://github.com/gwendall/meteor-iron-router-body-attribute

Adds a [data-route] attribute with the route name to the body
https://github.com/gwendall/meteor-iron-router-body-attribute

Last synced: 2 months ago
JSON representation

Adds a [data-route] attribute with the route name to the body

Awesome Lists containing this project

README

        

Installation
------------

``` sh
meteor add gwendall:iron-router-body-attribute
```

What is does
============

This package simply uses an ```onAfterAction``` hook to reactively set a ```[data-route]``` attribute to the body with the current route name.
It is particularly handy to scope CSS rules based on routes.

Example
=======

``` javascript
Router.route('/', {
name: 'landing'
});
```

``` css
body[data-route="landing"] {
background-color: red;
}
```