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
Hide JS-required features if JS disabled #2912
base: main
Are you sure you want to change the base?
Conversation
It looks like code groups and last updated are rendered server-side, so this should be fine. Also - I would really like it if localnav could be modified to work without JS. I think it's possible. |
CC @brc-dd for re-review |
To be honest... wouldn't it make more sense if we create a new JS free theme if we need one 🤔 ? If we add this, anytime we add new feature to the theme, we have to be very careful. And probably end up having give up slightly complicated feature because of this limitation. I don't think majority of users uses VitePress site without JS enabled 👀 |
I agree that JavaScript-disabled users are likely to be an extreme minority of vitepress visitors. That's why I think this solution is better. The point of this is pull is just a one-off improvement that ensures that most of the stuff that is broken when JavaScript is disabled is hidden. I don't want to add any more maintenance burden onto the maintainers of this project. I know how overworked the maintainers of all major open source projects already are. If someone later notices that something doesn't work without JS, they can create pull request in that adds the js-required class themself. |
It wouldn't be one-off, since we must keep this in mind forever in the future whenever we add new feature to the theme. And also "most of the stuff" would be an issue to because if we miss 1 part, we have to fix it once this change is introduced.
This would be a bit unrealistic. Once any feature is added to the core, we can't ignore those features just because it wasn't added by the team. I still believe creating a new theme that is carefully tailored in a way that works smoothly without JS would be much simpler 👀 |
I disagree; I can't see a way to create an entirely new theme from scratch that is somehow
Yes, you absolutely can ignore them. You're a volunteer maintaining a FOSS project. Don't feel that just because you've helped make something, that you have to maintain it for all of eternity :) It's unreasonable to assume that a feature will be maintained if nobody is interested in maintaining it. |
Fork this repo then apply this change. Done. |
Sorry, brain fart. Meant less, not more. |
Things like light/dark mode and searching don't work properly when scripts are disabled. This hides those broken features when they are, well, broken.