Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jquery: Add the js class, remove the no-js one #457

Merged
merged 1 commit into from
Apr 19, 2024
Merged

Conversation

mgol
Copy link
Member

@mgol mgol commented Apr 19, 2024

This used to be done by Modernizr until its removal in 08f27c1. Some sites apply different styling for JS-disabled environments; one such example is the jQuery UI Download Builder which expands all Themeroller knobs sections in the no-JS mode.

@mgol mgol requested a review from Krinkle April 19, 2024 13:43
@mgol mgol self-assigned this Apr 19, 2024
@Krinkle
Copy link
Member

Krinkle commented Apr 19, 2024

Could we place it outside the dom-ready handler to avoid FOUC/CSS reflow?

@timmywil
Copy link
Member

Agreed. This should as early as possible and blocking, which is how modernizr does it.

@mgol
Copy link
Member Author

mgol commented Apr 19, 2024

I guess it doesn't hurt as documentElement is always available.

This used to be done by Modernizr until its removal in
08f27c1. Some sites apply different styling for
JS-disabled environments; one such example is the jQuery UI Download Builder
which expands all Themeroller knobs sections in the no-JS mode.
@mgol
Copy link
Member Author

mgol commented Apr 19, 2024

@Krinkle @timmywil PR updated

@mgol mgol requested a review from timmywil April 19, 2024 14:45
@timmywil
Copy link
Member

Ok, I was thinking an inline script before jQuery loaded, but this works since we're not loading jQuery async.

@mgol
Copy link
Member Author

mgol commented Apr 19, 2024

I'm not a fan of inline scripts as they don't play nice with CSP if we ever introduce one and I didn't really want to introduce another file just for this.

@mgol mgol merged commit 9e69788 into jquery:main Apr 19, 2024
5 checks passed
@mgol mgol deleted the js-class branch April 19, 2024 15:02
@timmywil
Copy link
Member

ah, right, and we do plan on adding CSP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants