WordPress.org

Make WordPress Core

#24568 closed feature request (duplicate)

Modernizr a part of WordPress?

Reported by: Looimaster Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.6
Component: External Libraries Keywords:
Focuses: Cc:

Description

I think that Modernizr is currently the best and highly useful library for detecting browser features. Something as useful as jQuery or Iris Colorpicker.

Shouldn't it become a part of WordPress? Many plugins and themes add it and developers need to use "function_exists" checks to prevent conflicts.

Having:

<script>
if ( Modernizr.touch ) {

}
</script>

instead of for instance:

<?php
if ( wp_is_mobile() ) {

}
?>

would be great!

Change History (4)

comment:1 @Looimaster22 months ago

And also in case of CSS styling I can think of many advantages:

.touch .element { display: none; }

comment:2 @nofearinc22 months ago

  • Cc mario@… added

comment:3 @johnbillion22 months ago

  • Type changed from defect (bug) to feature request

Related discussion: #24541

comment:4 @ocean9022 months ago

  • Component changed from General to External Libraries
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #23739.

jQuery and Iris Colorpicker are both used in core. Modernizr not.

If Modernizr should be used in core, then there should be a discussion first, which explains the benefits of using Modernizr instead of our current feature detection.

Note: See TracTickets for help on using tickets.