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
- Host: GitHub
- URL: https://github.com/gwendall/meteor-iron-router-body-attribute
- Owner: gwendall
- Created: 2015-08-06T14:42:39.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-08-10T13:32:22.000Z (almost 10 years ago)
- Last Synced: 2025-03-18T05:56:56.118Z (2 months ago)
- Language: JavaScript
- Size: 109 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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;
}
```