This ember addon is maintained by Media Pop, a software consultancy. Hire us to solve your web application challenges.
Provides a viewport
service and inserts accurate faux-viewport units into CSS variable --vh
. View the demo app on mobile.
/* Before */
.full-height {
height: 100vh; /* Inaccurate on mobile */
}
/* After */
.full-height {
height: calc(var(--vh) * 100);
}
It can also be used as a service:
export default Component.create({
viewport: service(),
someProperty: computed('viewport.height', function(){
return this.viewport.height / 2;
})
});
ember install @mediapop/ember-viewport
- Ember.js v3.16 or above
- Ember CLI v2.13 or above
- Node.js v10 or above
See the Contributing guide for details.
This project is licensed under the MIT License.