Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2020-03-14 15:44:46

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,137
GitHub

Modernizr

Modernizr

Let’s assume I’m rusty at site building, because I really am.

Is Modernizr necessary these days, or is it a throwback to the olden days?

Offline

#2 2020-03-14 16:20:41

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,269
Website GitHub

Re: Modernizr

I don’t use it now, but then I never have.

Guess if you need cutting edge polyfills for things, then go for it. But with browser vendors releasing new versions every couple of weeks, I doubt any new spec features take long to integrate. MS Edge, perhaps notwithstanding.

Last edited by Bloke (2020-03-14 16:22:53)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#3 2020-03-14 16:23:03

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,011
Website GitHub Mastodon Twitter

Re: Modernizr

Hi Pete
I guess it depends on your target audience. I stopped using it on neme’s latest site version. If you do want backward compatibility you may also need to add css3-mediaqueries.js which reminds me that I will have to remove it from my site:)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#4 2020-03-14 16:29:59

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,137
GitHub

Re: Modernizr

Bloke wrote #322188:

But with browser vendors releasing new versions every couple of weeks, I doubt any new spec features take long to integrate. MS Edge, perhaps notwithstanding.

Good point, well made.

colak wrote #322189:

I guess it depends on your target audience. I stopped using it on neme’s latest site version.

That’s my gut feeling at the moment – the site I’m looking at has Modernizr on it, but it’s from 5+ years ago and I don’t see why it needs it.

Thanks, Modernizr – and so long.

Offline

#5 2020-03-14 17:26:10

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,595
Website

Re: Modernizr

I’d say “depends” too. It’s a trade-off between the browser feature you’re using and the browser’s you need to support.

  • Are you using specific (advanced) browser functionality?
  • Is that feature supported by all your target browsers?
  • What happens when a browser doesn’t support it? Does it break your site, or do some users not get some non-essential functionality?
  • Can you detect the browser feature easily enough using another method?
  • Do you need to detect multiple features?

Modernizr is still kept up to date, so it’s not obsolete, but many browsers can now detect css features using @supports making its use case more questionable. This feature detection article at mozilla provides plenty of detailed information, including modernizr.

Since 5 years ago, when you may have dropped in the whole modernizr library, they changed the download method so that you explicitly choose the variant you want and get a much smaller download.

I found it useful to detect touch support (e.g. to switch off rollovers and place headings beneath images) but that has been relativised since. You can detect touch event support but not really a touch device.


TXP Builders – finely-crafted code, design and txp

Offline

#6 2020-03-14 17:30:28

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,137
GitHub

Re: Modernizr

Brilliant- thanks, jakob!

Offline

Board footer

Powered by FluxBB