Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-01-28 11:44:17

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Add class="no-js" to HTML tag in admin side

It would be really helpful to have class="no-js" added to the <html> tag on the admin side pages. It could then give admin theme authors the option of harnessing modernizr in their themes if they wish. Also a good precursor to the admin side eventually moving to html5.

Offline

#2 2012-01-31 22:46:14

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: Add class="no-js" to HTML tag in admin side

Example of code here – as you can see it’s a pretty trivial change but could be a huge benefit to admin themers.

Offline

#3 2012-02-01 05:32:21

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,323
Website Mastodon

Re: Add class="no-js" to HTML tag in admin side

Phil, please enlighten me ;)

From my (limited) understanding of Modernizr, it will replace all instances of no-js with js on JavaScript-enabled browsers.

That’s nice for public-facing websites, but the Textpattern admin side won’t work on browsers without JS anyhow, making the presence of JS a safe assumption.

So why wouldn’t we just add a js class to <body> in the first place?

Offline

#4 2012-02-01 07:42:01

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: Add class="no-js" to HTML tag in admin side

wet wrote:

…the Textpattern admin side won’t work on browsers without JS anyhow, making the presence of JS a safe assumption.

Ah, OK. If JavaScript is a requirement this change is not needed then. I’ve also checked whether the class=“no-js” is needed as a placeholder for the other tests (such as .no-svg, .no-rgba) to be filled into, and it isn’t, so that’s good. I can now safely bundle Modernizr with my next theme I’m building.

Offline

Board footer

Powered by FluxBB