Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#24568 closed feature request (duplicate)

Modernizr a part of WordPress?

Reported by: looimaster's profile 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)

#1 @Looimaster
11 years ago

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

.touch .element { display: none; }

#2 @nofearinc
11 years ago

  • Cc mario@… added

#3 @johnbillion
11 years ago

  • Type changed from defect (bug) to feature request

Related discussion: #24541

#4 @ocean90
11 years 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.