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

Issues with "noscript" admonition #12

Open
nikita-kun opened this issue Dec 31, 2024 · 1 comment
Open

Issues with "noscript" admonition #12

nikita-kun opened this issue Dec 31, 2024 · 1 comment

Comments

@nikita-kun
Copy link

The "JS disabled" admonition shows up as a block of bleak graey text on white background when the dark mode is active.
The contrast ratio is 1.06 rgb(241, 241, 241) vs rgb(248, 248, 248), way below the WCAG distinguishability criterion.
1 noscript gwern


The admonition continues to obstruct the page as the page is scrolled, worsening user experience.
3 noscript gwern


There is some padding for the admonition of 160px at the top of the page, but on mobile devices, the admonition does not fit into that space.
2 noscript gwern


The admonition is not dismissable. In noscript environment one can still make an interactive modal by using :target CSS pseudo-class.

I enjoy reading the articles on my desktop with JS enabled, while looking through the references and related articles in the same tab, but in the case of the phone, these features do not scale well and the floater is quite repelling.
A full-width, dismissable, or at least non-floating admonition would be more appreciable.


The existing template suggests that the admonition should respect the light/dark mode, but the background color is hardcoded, while the font color is not:

#markdownBody #noscript-warning-header {
  position: fixed;
  /* sticky */
  top: 6px;
  /* at top */
  width: 58%;
  z-index: 99;
  /* Make sure it is on top */
  background-color: #f8f8f8;
  /* Set a solid background color so legible while positioned over text */
  border-color: var(--GW-abstract-border-color);
  /* Make look like theme-toggle/admonitions a bit more */
  border-width: 6px 6px 6px 6px;
  border-style: double;
}

A side-by-side view of an article with/without js:
https://nikita-kun.github.io/order/#viewMode=horizontal&viewStart=1&gallerySize=2&contentOnly=0&input=https%3A%2F%2Fgwern.net%2Fnote%2Ffaster%60noscript%0Ahttps%3A%2F%2Fgwern.net%2Fnote%2Ffaster%60script

@nikita-kun
Copy link
Author

Pull request #13, fixes color and location, not dismissible.

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

No branches or pull requests

1 participant