Skip to content

Commit d2e94c6

Browse files
committed
Fix Try CoffeeScript for mobile
1 parent d7d32cf commit d2e94c6

File tree

3 files changed

+44
-8
lines changed

3 files changed

+44
-8
lines changed

docs/v2/index.html

+23-5
Original file line numberDiff line numberDiff line change
@@ -401,18 +401,36 @@
401401

402402
.try-coffeescript .code-column {
403403
overflow: hidden;
404-
padding-bottom: 100%;
405-
margin-bottom: -100%;
406404
background-color: #2f2625;
407405
color: #2f2625;
408406
}
409407

408+
@media screen and (max-width: 767px) {
409+
.try-coffeescript .code-column {
410+
height: calc(50vh - 0.5 * 3.5rem);
411+
}
412+
}
413+
@media screen and (min-width: 768px) {
414+
.try-coffeescript .code-column {
415+
padding-bottom: 100%;
416+
margin-bottom: -100%;
417+
}
418+
}
419+
410420
.try-coffeescript button svg {
411421
height: 1em;
412422
transform: scale(1.3) translateY(0.1em);
413423
fill: #0b140f;
414424
}
415425

426+
@media screen and (max-width: 767px) {
427+
.try-coffeescript .try-buttons {
428+
position: absolute;
429+
bottom: 1em;
430+
z-index: 1002;
431+
}
432+
}
433+
416434
/* Adapted from https://github.com/FarhadG/code-mirror-themes/blob/master/themes/twilight.css */
417435

418436
.cm-s-twilight {
@@ -494,7 +512,7 @@
494512
</div>
495513
</div>
496514
<div class="row">
497-
<div class="col-xs-12 text-xs-right">
515+
<div class="col-xs-12 text-xs-right try-buttons">
498516
<button type="button" class="btn btn-primary" data-action="run-code-example" data-example="try-coffeescript" data-run="true"></button>&emsp;
499517
<button type="button" class="btn btn-primary" data-action="link" data-example="try-coffeescript"><svg aria-hidden="true" version="1.1" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg>
500518
</button>
@@ -651,7 +669,7 @@
651669
<section id="overview">
652670
<p><strong>CoffeeScript is a little language that compiles into JavaScript.</strong> Underneath that awkward Java-esque patina, JavaScript has always had a gorgeous heart. CoffeeScript is an attempt to expose the good parts of JavaScript in a simple way.</p>
653671
<p>The golden rule of CoffeeScript is: <em>“It’s just JavaScript.”</em> The code compiles one-to-one into the equivalent JS, and there is no interpretation at runtime. You can use any existing JavaScript library seamlessly from CoffeeScript (and vice-versa). The compiled output is readable, pretty-printed, and tends to run as fast or faster than the equivalent handwritten JavaScript.</p>
654-
<p><strong>Latest Version:</strong> <a href="http://github.com/jashkenas/coffeescript/tarball/2.0.0-alpha1">2.0.0-alpha1</a></p>
672+
<p><strong>Latest Version:</strong> <a href="http://github.com/jashkenas/coffeescript/tarball/2.0.0-alpha">2.0.0-alpha</a></p>
655673
<blockquote>
656674
<pre><code>npm install -g coffeescript</code></pre></blockquote>
657675

@@ -3272,7 +3290,7 @@ <h2>Web Chat (IRC)</h2><p>Quick help and advice can often be found in the Coffee
32723290

32733291
</section>
32743292
<section id="annotated-source">
3275-
<h2>Annotated Source</h2><p>You can browse the CoffeeScript 2.0.0-alpha1 source in readable, annotated form <a href="http://coffeescript.org/v2/annotated-source/">here</a>. You can also jump directly to a particular source file:</p>
3293+
<h2>Annotated Source</h2><p>You can browse the CoffeeScript 2.0.0-alpha source in readable, annotated form <a href="http://coffeescript.org/v2/annotated-source/">here</a>. You can also jump directly to a particular source file:</p>
32763294
<ul>
32773295
<li><a href="http://coffeescript.org/v2/annotated-source/grammar.html">Grammar Rules — src/grammar</a></li>
32783296
<li><a href="http://coffeescript.org/v2/annotated-source/lexer.html">Lexing Tokens — src/lexer</a></li>

documentation/v2/docs.css

+20-2
Original file line numberDiff line numberDiff line change
@@ -381,14 +381,32 @@ textarea {
381381

382382
.try-coffeescript .code-column {
383383
overflow: hidden;
384-
padding-bottom: 100%;
385-
margin-bottom: -100%;
386384
background-color: #2f2625;
387385
color: #2f2625;
388386
}
389387

388+
@media screen and (max-width: 767px) {
389+
.try-coffeescript .code-column {
390+
height: calc(50vh - 0.5 * 3.5rem);
391+
}
392+
}
393+
@media screen and (min-width: 768px) {
394+
.try-coffeescript .code-column {
395+
padding-bottom: 100%;
396+
margin-bottom: -100%;
397+
}
398+
}
399+
390400
.try-coffeescript button svg {
391401
height: 1em;
392402
transform: scale(1.3) translateY(0.1em);
393403
fill: #0b140f;
394404
}
405+
406+
@media screen and (max-width: 767px) {
407+
.try-coffeescript .try-buttons {
408+
position: absolute;
409+
bottom: 1em;
410+
z-index: 1002;
411+
}
412+
}

documentation/v2/try.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</div>
99
</div>
1010
<div class="row">
11-
<div class="col-xs-12 text-xs-right">
11+
<div class="col-xs-12 text-xs-right try-buttons">
1212
<button type="button" class="btn btn-primary" data-action="run-code-example" data-example="try-coffeescript" data-run="true"></button>&emsp;
1313
<button type="button" class="btn btn-primary" data-action="link" data-example="try-coffeescript"><%= include('documentation/images/link.svg') %></button>
1414
</div>

0 commit comments

Comments
 (0)