stylesheets: merge print rules with the application stylesheet

- Having a separate stylesheet for print rules is not a best practice
  (it makes an extra network request)
- It makes migrating to Sprockets 4 easier
This commit is contained in:
Pierre de La Morinerie 2021-02-23 14:09:01 +01:00
parent e1a450fd6f
commit e51948ab5c
4 changed files with 56 additions and 55 deletions

View file

@ -5,4 +5,3 @@
// = require ./fonts
// = require leaflet
// = require_tree .
// = stub ./print.scss

View file

@ -1,63 +1,65 @@
@import "colors";
@import "fonts";
.new-header,
.sub-header,
footer {
display: none;
}
.print-header {
display: block;
margin-top: 30px;
font-size: 30px;
line-height: 50px;
font-weight: bold;
}
body {
font-family: "Muli";
}
.subtitle {
margin-top: -20px;
color: $dark-grey;
}
th,
td {
vertical-align: top;
}
th {
text-align: left;
&.header-section {
padding-top: 1.2em;
font-size: 1.2em;
@media print {
.new-header,
.sub-header,
footer {
display: none;
}
}
.messagerie {
.messages-list {
list-style: none;
padding-left: 0;
max-height: none;
.print-header {
display: block;
margin-top: 30px;
font-size: 30px;
line-height: 50px;
font-weight: bold;
}
h2 {
font-size: 110%;
}
body {
font-family: "Muli";
}
.person-icon {
display: none;
.subtitle {
margin-top: -20px;
color: $dark-grey;
}
th,
td {
vertical-align: top;
}
th {
text-align: left;
&.header-section {
padding-top: 1.2em;
font-size: 1.2em;
}
}
}
.message {
margin-bottom: 40px;
}
.messagerie {
.messages-list {
list-style: none;
padding-left: 0;
max-height: none;
.updated-at {
display: none;
h2 {
font-size: 110%;
}
.person-icon {
display: none;
}
}
}
.message {
margin-bottom: 40px;
}
.updated-at {
display: none;
}
}

View file

@ -20,7 +20,6 @@
= preload_link_tag(asset_url("Muli-Bold.woff2"))
= stylesheet_link_tag 'application', media: 'all'
= stylesheet_link_tag 'print', media: 'print'
= Gon::Base.render_data(camel_case: true, init: true, nonce: request.content_security_policy_nonce)

View file

@ -10,5 +10,6 @@ Rails.application.config.assets.paths << Rails.root.join('node_modules', '@reach
Rails.application.config.assets.paths << Rails.root.join('node_modules', '@mapbox', 'mapbox-gl-draw', 'dist')
# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
Rails.application.config.assets.precompile += ['print.css']
# application.js, application.css, and all non-JS/CSS in the app/assets
# folder are already added.
# Rails.application.config.assets.precompile += %w( admin.js admin.css )