Newer
Older
dmpopidor / app / views / shared / export / _plan_styling.erb
@Brian Riley Brian Riley on 2 Mar 2018 1 KB centered plan title
<% font_size = is_integer?(@formatting[:font_size]) ? Integer(@formatting[:font_size]) : 10 %>

<style>
  html {
    font-family: <%= @formatting[:font_face].tr('"', '') -%>; 
    font-size: <%= font_size -%>pt; 
    margin: <%= @formatting[:margin][:top] %>px <%= @formatting[:margin][:right] %>px <%= @formatting[:margin][:bottom] %>px <%= @formatting[:margin][:left] %>px;
  }
  h1 {
    font-size: <%= font_size + 8 -%>pt; 
    font-face:bold; 
    padding: 0;
  }
  h2 {
    font-size: <%= font_size + 3 -%>pt; 
    font-face:bold; 
    padding: 0; 
    margin: 1em 0 0 0;
  }
  h3 {
    font-size: <%= font_size + 2 -%>pt; 
    font-face:bold; 
    padding: 0; 
    margin: 1em 0 0 0;
  }
  h2 + div.question > h3 {
    margin: 0; 
  }
  table, tr, td, th, tbody, thead, tfoot {
    page-break-inside: avoid !important; 
  }
  table { 
    border-collapse: collapse; 
  }
  th, td { 
    border: 1px solid black !important; 
    padding: 2px;
  }
  p { 
    margin: 0.25em 0;
  }
  .title {
    width: 70%;
    margin-left: auto;
    margin-right: auto;
  }
  .cover-page {
    font-size: <%= font_size + 1 -%>pt; 
  }
  .question {
    margin-top: 15px;
    margin-bottom: 10px;
  }
  .question:first-child {
    margin-top: 0;
  }
  .annotations {
    margin-left: 15px;
    margin-bottom: 10px;
  }
  hr.bottom {
    position: absolute;
    bottom: 0;
  }
</style>