Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>That's an interesting dilemma you have going on there. Off the top of my head, the only thing I can think of is to add a new tag to the header where your font-size is declared with !important. For example, in your head tags:</p> <pre><code>&lt;style type="text/css" media="print"&gt; .printfont { font-size: 16px !important; } &lt;/style&gt; </code></pre> <p>This will ensure that the new font-size will take precedence.</p> <p>The following is a very quick example of how you may accomplish this with javascript</p> <pre><code>&lt;script type="text/javascript"&gt; var inlineMediaStyle = null; function changeMediaStyle () { var head = document.getElementsByTagName('head')[0]; var newStyle = document.createElement('style'); newStyle.setAttribute('type', 'text/css'); newStyle.setAttribute('media', 'print'); newStyle.appendChild(document.createTextNode('.printFont { font-size: 16px !important;}')); if (inlineMediaStyle != null) { head.replaceChild(newStyle, inlineMediaStyle) } else { head.appendChild(newStyle); } inlineMediaStyle = newStyle; } &lt;/script&gt; </code></pre> <p>Just ensure that you have onchange="changeMediaStyle()" as an attribute on your dropdown. Also, as a disclaimer in my example, I am not accounting for things like memory leaks, so you will have to work out those kind of issues on your own.</p> <p>As to your alternate question, as far as I am aware, there isn't any method for declaring/using what is essentially CSS variables. However, there is currently a recommendation out there for it: <a href="http://disruptive-innovations.com/zoo/cssvariables/" rel="noreferrer">http://disruptive-innovations.com/zoo/cssvariables/</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload