dalphyx / vue-headroom

Headroom for Vuejs
128 stars 16 forks source link

remove styles #13

Open samburgers opened 6 years ago

samburgers commented 6 years ago

Hi there, any chance for the option to remove any inline styles, and just use the classes for CSS changes.

Cheers!

jdvivar commented 5 years ago

Yes, you can do that yourself. You need to redefine the style function from this line: https://github.com/dalphyx/vue-headroom/blob/master/src/headroom.vue#L123

That computed function is only used in the style property: https://github.com/dalphyx/vue-headroom/blob/master/src/headroom.vue#L2

When importing, just redefine the function to return an empty string instead:

import headroom from 'vue-headroom'
headroom.computed.style = () => ''

I hope it helps!

missmatsuko commented 4 years ago

Can this be documented? I thought this plugin would be more like the original headroom.js, but the inline styles have been getting in my way.

jesuismaxime commented 3 years ago

I think that this need to be a prop to wether or not use the inline-style (and I guess that most of the time that will be turn off). ie. :inline="false" or something else.