Feature Detections

Feature detections help you apply CSS and JS logic depending on what a user supports or not. It also allows you to create custom detection to better manage your site.

Imagine you have a menu or element that's only visible to members

{% highlight js %} // add the feature head.feature("member", true); // use the feature via CSS .member .member-menu { display: block; } .no-member .member-menu { display: none; } // use the feature via JS if (head.member) { // do something } {% endhighlight %}

You can toggle a feature from one state to another, it's state will be refleted to CSS and JS automatically

In addition to being able to add your custom detections, a bunch of detections are already built in, and they are all accessible via CSS and JS

Show Comments