😎 Give your xaringan slides some style
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

343 lines
23KB

  1. <!DOCTYPE html>
  2. <!-- Generated by pkgdown: do not edit by hand --><html lang="en">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5. <meta charset="utf-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  8. <title>xaringanthemer CSS Help • xaringanthemer</title>
  9. <!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script><!-- Bootstrap --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha256-916EbMg70RQy9LHiGkXzG8hSg9EdNy97GazNG/aiY1w=" crossorigin="anonymous">
  10. <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.7.1/css/all.min.css" integrity="sha256-nAmazAk6vS34Xqo0BSrTb+abbtFlgsFK7NKSi6o7Y78=" crossorigin="anonymous">
  11. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.7.1/css/v4-shims.min.css" integrity="sha256-6qHlizsOWFskGlwVOKuns+D1nB6ssZrHQrNj1wGplHc=" crossorigin="anonymous">
  12. <!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.9.4/headroom.min.js" integrity="sha256-DJFC1kqIhelURkuza0AvYal5RxMtpzLjFhsnVIeuk+U=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.9.4/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet">
  13. <script src="../pkgdown.js"></script><link href="../extra.css" rel="stylesheet">
  14. <meta property="og:title" content="xaringanthemer CSS Help">
  15. <meta property="og:description" content="">
  16. <meta name="twitter:card" content="summary">
  17. <meta name="robots" content="noindex">
  18. <!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]>
  19. <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  20. <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  21. <![endif]-->
  22. </head>
  23. <body>
  24. <div class="container template-article">
  25. <header><div class="navbar navbar-default navbar-fixed-top" role="navigation">
  26. <div class="container">
  27. <div class="navbar-header">
  28. <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
  29. <span class="sr-only">Toggle navigation</span>
  30. <span class="icon-bar"></span>
  31. <span class="icon-bar"></span>
  32. <span class="icon-bar"></span>
  33. </button>
  34. <span class="navbar-brand">
  35. <a class="navbar-link" href="../index.html">xaringanthemer</a>
  36. <span class="version label label-danger" data-toggle="tooltip" data-placement="bottom" title="In-development version">0.2.0.9100</span>
  37. </span>
  38. </div>
  39. <div id="navbar" class="navbar-collapse collapse">
  40. <ul class="nav navbar-nav">
  41. <li>
  42. <a href="../articles/xaringanthemer.html">Get started</a>
  43. </li>
  44. <li>
  45. <a href="../reference/index.html">Reference</a>
  46. </li>
  47. <li>
  48. <a href="../articles/themes.html">Themes</a>
  49. </li>
  50. <li>
  51. <a href="../articles/fonts.html">Fonts</a>
  52. </li>
  53. <li>
  54. <a href="../articles/template-variables.html">Template Variables</a>
  55. </li>
  56. <li>
  57. <a href="../articles/css-help.html">CSS Help</a>
  58. </li>
  59. </ul>
  60. <ul class="nav navbar-nav navbar-right">
  61. <li>
  62. <a href="../news/index.html">
  63. <span class="fa fa fa fa-newspaper-o fa-lg"></span>
  64. </a>
  65. </li>
  66. <li>
  67. <a href="https://github.com/gadenbuie/xaringanthemer">
  68. <span class="fa fa-github fa-lg"></span>
  69. </a>
  70. </li>
  71. <li>
  72. <a href="https://twitter.com/grrrck">
  73. <span class="fa fa-twitter fa-lg"></span>
  74. </a>
  75. </li>
  76. <li>
  77. <a href="https://www.garrickadenbuie.com">
  78. <span class="fa fa-home fa-lg"></span>
  79. </a>
  80. </li>
  81. </ul>
  82. </div>
  83. <!--/.nav-collapse -->
  84. </div>
  85. <!--/.container -->
  86. </div>
  87. <!--/.navbar -->
  88. </header><div class="row">
  89. <div class="col-md-9 contents">
  90. <div class="page-header toc-ignore">
  91. <h1>xaringanthemer CSS Help</h1>
  92. <small class="dont-index">Source: <a href="https://github.com/gadenbuie/xaringanthemer/blob/master/vignettes/css-help.Rmd"><code>vignettes/css-help.Rmd</code></a></small>
  93. <div class="hidden name"><code>css-help.Rmd</code></div>
  94. </div>
  95. <p>Jump to: <a href="#colors">Colors</a>, <a href="#sizes">Sizes</a>, <a href="#positioning">Positioning</a></p>
  96. <div id="about-this-vignette" class="section level2">
  97. <h2 class="hasAnchor">
  98. <a href="#about-this-vignette" class="anchor"></a>About this vignette</h2>
  99. <p>This vignette cover some basic CSS, in particular to give an idea about the possible values you can use with the various arguments to the xaringan theme functions. See <code><a href="../articles/template-variables.html">vignette("template-variables", package = "xaringanthemer")</a></code> for a full list of the theme functions.</p>
  100. <p>Because we are setting the CSS properties from R, we can either give <strong>xaringanthemer</strong> function arguments a character string or we can call an R function or variable that returns a character string. For example, we can create an R variable with a specific color that is used in several places in a theme</p>
  101. <div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb1-1" data-line-number="1">firebrick &lt;-<span class="st"> "#CD2626"</span></a>
  102. <a class="sourceLine" id="cb1-2" data-line-number="2"><span class="kw"><a href="../reference/style_xaringan.html">style_xaringan</a></span>(</a>
  103. <a class="sourceLine" id="cb1-3" data-line-number="3"> <span class="dt">header_color =</span> firebrick,</a>
  104. <a class="sourceLine" id="cb1-4" data-line-number="4"> <span class="dt">link_color =</span> firebrick</a>
  105. <a class="sourceLine" id="cb1-5" data-line-number="5">)</a></code></pre></div>
  106. <p>or we can directly give the character string</p>
  107. <div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb2-1" data-line-number="1"><span class="kw"><a href="../reference/style_xaringan.html">style_xaringan</a></span>(</a>
  108. <a class="sourceLine" id="cb2-2" data-line-number="2"> <span class="dt">header_color =</span> <span class="st">"#CD2626"</span>,</a>
  109. <a class="sourceLine" id="cb2-3" data-line-number="3"> <span class="dt">link_color =</span> <span class="st">"#CD2626"</span></a>
  110. <a class="sourceLine" id="cb2-4" data-line-number="4">)</a></code></pre></div>
  111. <p>in both cases, we get CSS like the following that sets the link color</p>
  112. <div class="sourceCode" id="cb3"><pre class="sourceCode css"><code class="sourceCode css"><a class="sourceLine" id="cb3-1" data-line-number="1">a, a &gt; code {</a>
  113. <a class="sourceLine" id="cb3-2" data-line-number="2"> <span class="kw">color</span>: <span class="dv">#CD2626</span>;</a>
  114. <a class="sourceLine" id="cb3-3" data-line-number="3">}</a></code></pre></div>
  115. <p>Note that when a string is given to the theme function, the outer quotes are removed.</p>
  116. <p>In the sections below, R code is represented without quotes – like <code><a href="https://rdrr.io/r/grDevices/rgb.html">rgb(0.8, 0.15, 0.15)</a></code> – and CSS code is represented inside quotes – like <code>"rgb(205, 38, 38)"</code> – to differentiate between R and CSS functions with the same or similar names.</p>
  117. </div>
  118. <div id="colors" class="section level2">
  119. <h2 class="hasAnchor">
  120. <a href="#colors" class="anchor"></a>Colors</h2>
  121. <p>In CSS, text colors are specified with the <code>color:</code> property, background colors use <code>background-color:</code>, and border colors use <code>border-color:</code>.</p>
  122. <p>In <strong>xaringanthemer</strong>, template variables that set</p>
  123. <ul>
  124. <li>text color end with <code>_color</code>;</li>
  125. <li>background color end with <code>_background_color</code>;</li>
  126. <li>border color end with <code>_border_color</code>;</li>
  127. </ul>
  128. <div id="setting-colors" class="section level3">
  129. <h3 class="hasAnchor">
  130. <a href="#setting-colors" class="anchor"></a>Setting colors</h3>
  131. <p>In CSS, there are a number of ways to specify a color:</p>
  132. <ul>
  133. <li><p>You can use a <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#Color_keywords">color keyword</a>, such as <code>"darkslategray"</code> or <code>"red"</code>.</p></li>
  134. <li>
  135. <p>You can use the <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#rgb()_and_rgba()">RGB color specification</a> either via</p>
  136. <ul>
  137. <li>the hexadecimal representation
  138. <ul>
  139. <li>
  140. <code>"#CD2626"</code> or</li>
  141. <li>
  142. <code>"#CD262680"</code> (50% transparency)</li>
  143. </ul>
  144. </li>
  145. <li>or the rgb function notation
  146. <ul>
  147. <li>
  148. <code>"rgb(255, 38, 38)"</code> or</li>
  149. <li>
  150. <code>"rgba(255, 38, 28, 0.5)"</code> (50% transparency).</li>
  151. </ul>
  152. </li>
  153. </ul>
  154. </li>
  155. <li>
  156. <p>You can use the <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#hsl()_and_hsla()">HSL color specification</a> via the functions</p>
  157. <ul>
  158. <li>
  159. <code>"hsl(270,60%,70%)"</code> or</li>
  160. <li>
  161. <code>"hsl(270, 60%, 50%, .15)"</code> (15% transparency).</li>
  162. </ul>
  163. </li>
  164. </ul>
  165. <p>In R, there are a number of ways to specify a color:</p>
  166. <ul>
  167. <li>
  168. <p>Use <code><a href="https://rdrr.io/r/grDevices/rgb.html">rgb(205, 38, 38, maxColorValue = 255)</a></code> as an equivalent to the CSS <code>"rgb()"</code> function.</p>
  169. <ul>
  170. <li>Without the <code>maxColorValue</code> argument, the <code><a href="https://rdrr.io/r/grDevices/rgb.html">rgb()</a></code> function expects decimal numbers in the range [0, 1], like <code><a href="https://rdrr.io/r/grDevices/rgb.html">rgb(0.8039, 0.1490, 0.1490)</a></code>.</li>
  171. <li>The <code><a href="https://rdrr.io/r/grDevices/rgb.html">rgb()</a></code> function also sets transparency via the <code>alpha</code> argument (in the [0, 1] range).</li>
  172. </ul>
  173. </li>
  174. <li>
  175. <p>You can get the hexadecimal representation of a built-in R color using the <code><a href="https://rdrr.io/r/grDevices/col2rgb.html">col2rgb()</a></code> function together with the <code><a href="https://rdrr.io/r/grDevices/rgb.html">rgb()</a></code> function:</p>
  176. <div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb4-1" data-line-number="1"><span class="kw"><a href="https://rdrr.io/r/grDevices/rgb.html">rgb</a></span>(<span class="kw"><a href="https://rdrr.io/r/base/t.html">t</a></span>(<span class="kw"><a href="https://rdrr.io/r/grDevices/col2rgb.html">col2rgb</a></span>(<span class="st">"red"</span>)), <span class="dt">maxColorValue =</span> <span class="dv">255</span>)</a>
  177. <a class="sourceLine" id="cb4-2" data-line-number="2"><span class="co">#&gt; [1] "#FF0000"</span></a></code></pre></div>
  178. </li>
  179. </ul>
  180. </div>
  181. </div>
  182. <div id="sizes" class="section level2">
  183. <h2 class="hasAnchor">
  184. <a href="#sizes" class="anchor"></a>Sizes</h2>
  185. <p>In <strong>xaringanthemer</strong>, any template variable that accepts a CSS size (or length unit) ends with <code>_size</code>. Sizes are also used for positioning and those template variables end include <code>position</code> in their name.</p>
  186. <p>There are many units available in CSS sizes, but the three most common and easiest to use are pixels (<code>"px"</code>), percentage (<code>"%"</code>), and em units (<code>"em"</code>). Mozilla’s devloper portal has a <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/length">full list of CSS length units</a>.</p>
  187. <p>These sizes are either <em>absolute</em> or <em>relative</em> values. Relative values are set relative to the size of the parent element, but absolute values ignore the parent element.</p>
  188. <dl>
  189. <dt>Pixels <code>"px"</code>
  190. </dt>
  191. <dd>Pixels are an <em>absolute</em> size unit, traditionally representing one device pixel. E.g. <code>"16px"</code> or <code>"23px"</code>.
  192. </dd>
  193. <dt>Percentage <code>"%"</code>
  194. </dt>
  195. <dd>Percentages are relative to the size of the parent element, scaled linearly. E.g. <code>"75%"</code> or <code>"150%"</code>.
  196. </dd>
  197. <dt>em Units <code>"em"</code>
  198. </dt>
  199. <dd>em Units are just like percentages, except expressed as decimals. E.g. <code>"0.75em"</code> or <code>"1.5em"</code>.
  200. </dd>
  201. </dl>
  202. <p>To make this more concrete, here is a simple “page” containing a section header and two paragraphs.</p>
  203. <div class="sourceCode" id="cb5"><pre class="sourceCode html"><code class="sourceCode html"><a class="sourceLine" id="cb5-1" data-line-number="1"><span class="kw">&lt;div</span><span class="ot"> class=</span><span class="st">"page"</span><span class="kw"><a href="https://rdrr.io/r/base/Comparison.html">&gt;</a></span></a>
  204. <a class="sourceLine" id="cb5-2" data-line-number="2"> <span class="kw">&lt;h1&gt;</span>Section 1<span class="kw">&lt;/h1&gt;</span></a>
  205. <a class="sourceLine" id="cb5-3" data-line-number="3"> <span class="kw">&lt;p&gt;</span>This is paragraph 1...<span class="kw">&lt;/p&gt;</span></a>
  206. <a class="sourceLine" id="cb5-4" data-line-number="4"> <span class="kw">&lt;p&gt;</span>This is paragraph 2...<span class="kw">&lt;/p&gt;</span></a>
  207. <a class="sourceLine" id="cb5-5" data-line-number="5"><span class="kw">&lt;/div&gt;</span></a></code></pre></div>
  208. <p>Intuitively, you might want the section header to have a somewhat bigger font size than the paragraph text, but you don’t want to have to set the text size for each and every paragraph or header.</p>
  209. <p>To do this, we can set the base size of any element inside the <code>&lt;div class="page"&gt;</code>, and adjust the header size relatively.</p>
  210. <div class="sourceCode" id="cb6"><pre class="sourceCode css"><code class="sourceCode css"><a class="sourceLine" id="cb6-1" data-line-number="1"><span class="fu">.page</span> {</a>
  211. <a class="sourceLine" id="cb6-2" data-line-number="2"> <span class="kw">font-size</span>: <span class="dv">16px</span>;</a>
  212. <a class="sourceLine" id="cb6-3" data-line-number="3">}</a>
  213. <a class="sourceLine" id="cb6-4" data-line-number="4">h1 {</a>
  214. <a class="sourceLine" id="cb6-5" data-line-number="5"> <span class="kw">font-size</span>: <span class="dv">2em</span>;</a>
  215. <a class="sourceLine" id="cb6-6" data-line-number="6">}</a></code></pre></div>
  216. <p>Now our paragraph font will be 16 pixels tall, and the level 1 headers will be twice as big. If we later decide to change the base font size, say to <code>"15px"</code>, the header text will still be twice as big as the paragraph text.</p>
  217. </div>
  218. <div id="positioning" class="section level2">
  219. <h2 class="hasAnchor">
  220. <a href="#positioning" class="anchor"></a>Positioning</h2>
  221. <p>If you’re reading this, you’re probably wondering how you make an element be <em>where you want it to be</em>.</p>
  222. <p>There are 3 items that <strong>xaringanthemer</strong> can help you position:</p>
  223. <ul>
  224. <li>
  225. <code>background_position</code> (background image position)</li>
  226. <li>
  227. <code>title_slide_background_position</code> (title slide background image position)</li>
  228. <li>
  229. <code>footnote_position_bottom</code> (footnote location from bottom of screen)</li>
  230. </ul>
  231. <div id="footnote-position" class="section level3">
  232. <h3 class="hasAnchor">
  233. <a href="#footnote-position" class="anchor"></a>Footnote Position</h3>
  234. <p><strong>xaringanthemer</strong> provides one template variable to adjust the position of the footnote element. Footnotes can be insterted into a slide using the <code>.footnote[Here's my quick footnote]</code> syntax.</p>
  235. <p>The <code>footnote_position_bottom</code> argument adjust how far from the bottom of the slide the footnote appears. The default value is <code>"60px"</code>, but you can adjust this value up or down to get the footnote where you want.</p>
  236. </div>
  237. <div id="background-position" class="section level3">
  238. <h3 class="hasAnchor">
  239. <a href="#background-position" class="anchor"></a>Background Position</h3>
  240. <p>The background position is set using the theme function arguments that end with <code>background_position</code>. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/background-position#Syntax">this article on background-position</a> from Mozilla for more information.</p>
  241. <p>Try any of the following values to get started:</p>
  242. <div class="sourceCode" id="cb7"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb7-1" data-line-number="1">background_position =<span class="st"> "center"</span></a>
  243. <a class="sourceLine" id="cb7-2" data-line-number="2">background_position =<span class="st"> "top"</span></a>
  244. <a class="sourceLine" id="cb7-3" data-line-number="3">background_position =<span class="st"> "left"</span></a>
  245. <a class="sourceLine" id="cb7-4" data-line-number="4">background_position =<span class="st"> "bottom"</span></a>
  246. <a class="sourceLine" id="cb7-5" data-line-number="5">background_position =<span class="st"> "25% 75%"</span> <span class="co"># X-value (from left) Y-value (from top)</span></a>
  247. <a class="sourceLine" id="cb7-6" data-line-number="6">background_position =<span class="st"> "bottom 10px right 20px"</span> <span class="co"># 10px from bottom, 20px from right</span></a>
  248. <a class="sourceLine" id="cb7-7" data-line-number="7">background_position =<span class="st"> "top left 10px"</span> <span class="co"># at top but adjusted left 10px</span></a></code></pre></div>
  249. </div>
  250. <div id="general-positioning" class="section level3">
  251. <h3 class="hasAnchor">
  252. <a href="#general-positioning" class="anchor"></a>General Positioning</h3>
  253. <p>Read this section if you want to put a slide element at a specific spot on your slide.</p>
  254. <p>The <code>position</code> CSS element is used to specify where an element is located on the screen. Mozilla provides a <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/position">very good reference on positioning</a> that I’ve summarized here.</p>
  255. <p>An element can be <code>"relative"</code>-ly positioned, <code>"absolute"</code>-ly positioned, <code>"fixed"</code>, <code>"sticky"</code> or <code>"static"</code> (default). For an element with a computed position (i.e. not <code>"static"</code>), you can also specify the <code>top</code>, <code>right</code>, <code>bottom</code>, and <code>left</code> CSS properties for that element. The <code>top</code>/<code>bottom</code> parameters specify vertical displacement, and the <code>right</code>/<code>left</code> specify horizontal displacement.</p>
  256. <dl>
  257. <dt>Relatively positioned <code>position: relative</code>
  258. </dt>
  259. <dd>For relatively positioned elements, the element position is adjusted relative to where it <em>would have been</em> if it were <code>static</code>.
  260. </dd>
  261. <dt>Absolutely positioned <code>position: absolute</code> or <code>position: fixed</code>
  262. </dt>
  263. <dd>Absolutely positioned elements are positioned relative to the block that contains the element (called a containing block). A <code>fixed</code> element won’t move with scrolling (but <code>fixed</code> is not recommended for remarkjs slides).
  264. </dd>
  265. </dl>
  266. <p>If you want something to appear in a specific position on your slide, you’ll need to use the <code>extra_css</code> argument of the <strong>xaringanthemer</strong> functions. For example, lets say you want a 300px by 300px box to appear on the right side of your slide, you’ll need to create a special css class:</p>
  267. <div class="sourceCode" id="cb8"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb8-1" data-line-number="1"><span class="kw"><a href="../reference/style_xaringan.html">style_xaringan</a></span>(</a>
  268. <a class="sourceLine" id="cb8-2" data-line-number="2"> <span class="dt">extra_css =</span> <span class="kw"><a href="https://rdrr.io/r/base/list.html">list</a></span>(</a>
  269. <a class="sourceLine" id="cb8-3" data-line-number="3"> <span class="st">".box-right"</span> =<span class="st"> </span><span class="kw"><a href="https://rdrr.io/r/base/list.html">list</a></span>(</a>
  270. <a class="sourceLine" id="cb8-4" data-line-number="4"> <span class="st">"height"</span> =<span class="st"> "300px"</span>,</a>
  271. <a class="sourceLine" id="cb8-5" data-line-number="5"> <span class="st">"width"</span> =<span class="st"> "300px"</span>,</a>
  272. <a class="sourceLine" id="cb8-6" data-line-number="6"> <span class="st">"position"</span> =<span class="st"> "absolute"</span>,</a>
  273. <a class="sourceLine" id="cb8-7" data-line-number="7"> <span class="st">"top"</span> =<span class="st"> "33%"</span>,</a>
  274. <a class="sourceLine" id="cb8-8" data-line-number="8"> <span class="st">"left"</span> =<span class="st"> "65%"</span></a>
  275. <a class="sourceLine" id="cb8-9" data-line-number="9"> )</a>
  276. <a class="sourceLine" id="cb8-10" data-line-number="10"> )</a>
  277. <a class="sourceLine" id="cb8-11" data-line-number="11">)</a></code></pre></div>
  278. <p>This creates CSS like this:</p>
  279. <div class="sourceCode" id="cb9"><pre class="sourceCode css"><code class="sourceCode css"><a class="sourceLine" id="cb9-1" data-line-number="1"><span class="fu">.box-right</span> {</a>
  280. <a class="sourceLine" id="cb9-2" data-line-number="2"> <span class="kw">height</span>: <span class="dv">300px</span>;</a>
  281. <a class="sourceLine" id="cb9-3" data-line-number="3"> <span class="kw">width</span>: <span class="dv">300px</span>;</a>
  282. <a class="sourceLine" id="cb9-4" data-line-number="4"> <span class="kw">position</span>: <span class="dv">absolute</span>;</a>
  283. <a class="sourceLine" id="cb9-5" data-line-number="5"> <span class="kw">top</span>: <span class="dv">33%</span>;</a>
  284. <a class="sourceLine" id="cb9-6" data-line-number="6"> <span class="kw">left</span>: <span class="dv">65%</span>;</a>
  285. <a class="sourceLine" id="cb9-7" data-line-number="7">}</a></code></pre></div>
  286. <p>which you can then use in your slides by wrapping the slide content in <code>.box-right[]</code>.</p>
  287. <pre><code>.box-right[
  288. Stuff inside the box
  289. ]</code></pre>
  290. </div>
  291. </div>
  292. </div>
  293. <div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
  294. <div id="tocnav">
  295. <h2 class="hasAnchor">
  296. <a href="#tocnav" class="anchor"></a>Contents</h2>
  297. <ul class="nav nav-pills nav-stacked">
  298. <li><a href="#about-this-vignette">About this vignette</a></li>
  299. <li><a href="#colors">Colors</a></li>
  300. <li><a href="#sizes">Sizes</a></li>
  301. <li><a href="#positioning">Positioning</a></li>
  302. </ul>
  303. </div>
  304. </div>
  305. </div>
  306. <footer><div class="copyright">
  307. <p>Developed by <a href="https://www.garrickadenbuie.com">Garrick Aden-Buie</a>.</p>
  308. </div>
  309. <div class="pkgdown">
  310. <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.4.1.</p>
  311. </div>
  312. </footer>
  313. </div>
  314. </body>
  315. </html>