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

Content hidden when printing #86

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Content hidden when printing #86

wants to merge 2 commits into from

Conversation

robinpoort
Copy link

As I was working on a client site today I realised that Houdini content was hidden and only the Houdini buttons were displayed. Because I know you care about displaying content when JS is disabled I figured you'd want the same experience when printing the web.

As a second feature the auto-generated buttons are also hidden on print. The buttons inside [data-houdini-toggle] stay visible since they act as headings for the toggled content.

An even better approach would be to make these settings by using SCSS variables so you can easily override compiled output when compiling the styling in your own projects. Let me know if you'd be interested in that so I can create an issue for it and start working on that.

@cferdinandi
Copy link
Owner

So, two things:

  1. If JS was disabled, those elements wouldn't be hidden in the first place and would print.
  2. I think there's a strong argument to be made that if the content is hidden because the person hasn't clicked the button to show it, it shouldn't be in the print version, either.

@robinpoort
Copy link
Author

  1. Yep I know. I was trying to make a point about the page not being used as "most" devs intend it to be used. Most devs don't take into account that JS might be broken or disabled, or that people try to print pages.

  2. Fair enough, good point. My client is using an accordion markup listing an FAQ area though. They wanted the answers to be printed as well which I can get into. Might be different for each use-case though.

In that light, putting in an option, and making devs aware that people might printing their pages might still be a valid option though? If not, I'll just add the print CSS to each individual project which needs it.

Just thought I'd share and give back :)

@cferdinandi
Copy link
Owner

That's a fair point. Let me check with some a11y friends around expectations for something like this.

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants