filamentgroup/fixed-sticky — pull request #33 by pixelthing (2014-12-10 11:45:18+00:00)
Title: Styling for no/native/polyfilled position:sticky

Hi, this is a modification specifically to allow the stylesheet to make layout decisions depending on the capability of the browser and outcome of the polyfill.

It allows devs to style elements for three eventualities:
- No `position:sticky`support is possible (results in no CSS class added to document)
- Native `position:sticky`support is available (results in `fixedsticky-native` class added to document)
- Polyfilled `position:sticky`support is available - or is chosen over native support (results in `fixedsticky-polyfilled` class added to document)

This is done by adding one class if native support is detected, and a second if the polyfill *activates*(1) an implementation of fixedsticky. If the dev chooses to substitute native implementation with the polyfill (by *fixing* the test and re-initialising), both the native and the polyfill classes are added.

I've tried to add and remove classes in a way consistent with how the existing code deals with `fixedsticky-withoutfixedfixed`, and to remove the class in `destroy()`.

Lastly, telling the stylesheets that native support is available also means a dev might not need Modernizr (or at least a custom build - or grunt-modernizr - to compile a sticky test in). Bonus!

Notes:
(1) Note that just initialising the polyfill is not enough to add `fixedsticky-polyfilled`, the implementation *does require* the sticky element has a `top:X` or `bottom:X` that determines if it is activated or not. This meant packaging the top/bottom position test into a method, where it was a one liner before.