Last active
January 11, 2021 10:29
-
-
Save mathewtrivett/3f78db92278746743e82186110083a84 to your computer and use it in GitHub Desktop.
Testing Print CSS - app/views/layouts/application.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Testing Print CSS</title> | |
<%= csrf_meta_tags %> | |
<%= csp_meta_tag %> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<% if params[:medium] == 'print' %> | |
<!-- Load your print.css file with media attribute equal to screen --> | |
<%= stylesheet_packs_with_chunks_tag 'print', media: 'screen', 'data-turbolinks-track': 'reload', id: 'print_styles' %> | |
<% else %> | |
<!-- Load your print.css file with media attribute equal to print --> | |
<%= stylesheet_packs_with_chunks_tag 'print', media: 'print', 'data-turbolinks-track': 'reload', id: 'print_styles' %> | |
<!-- Load your other CSS files --> | |
<% end %> | |
<!-- THE REST OF YOUR HEAD CODE --> | |
</head> | |
<body> | |
<%= yield %> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment