Skip to content

Commit 705671c

Browse files
authored
Merge pull request tailwindlabs#187 from hacknug/next
Improve code blocks
2 parents 45acb3e + 0530f1b commit 705671c

File tree

5 files changed

+20
-12
lines changed

5 files changed

+20
-12
lines changed

source/_assets/js/components/ResponsiveCodeSample.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<template>
22
<div>
3+
34
<div class="flex items-end justify-center mb-2 bg-white">
45
<span class="inline-block text-center cursor-pointer select-none mr-8" :class="activeScreen === 'none' ? 'text-gray-800' : 'text-gray-500'" @click="activeScreen = 'none'" >
56
<svg :width="0.857142857142857 * 10" height="24" class="fill-current block mx-auto mb-1" viewBox="0 0 10 28" xmlns="http://www.w3.org/2000/svg"><path d="M1.5 12h7a1.5 1.5 0 0 1 1.5 1.5v13A1.5 1.5 0 0 1 8.5 28h-7A1.5 1.5 0 0 1 0 26.5v-13A1.5 1.5 0 0 1 1.5 12zM1 15v10h8V15H1zm4 12.5a1 1 0 1 0 0-2 1 1 0 0 0 0 2zM4 13v1h2v-1H4z" fill-rule="evenodd"/></svg>
@@ -22,10 +23,13 @@
2223
<p class="text-xs">xl</p>
2324
</span>
2425
</div>
26+
2527
<div class="overflow-hidden mb-8">
26-
<div class="rounded-t-lg p-4 bg-gray-800 border-b border-gray-300">
27-
<div class="scrollbar-none whitespace-pre font-mono text-gray-500 text-sm overflow-x-auto" v-html="highlightedCode"></div>
28+
29+
<div class="rounded-t-lg bg-gray-800 border-b border-gray-300 whitespace-pre font-mono text-gray-500 text-sm">
30+
<pre class="scrollbar-none m-0 p-0 overflow-auto scrolling-touch"><code class="inline-block p-4" v-html="highlightedCode" /></pre>
2831
</div>
32+
2933
<div class="rounded-b-lg border-l border-r border-b border-gray-400 bg-white p-4" :class="slotClass">
3034
<slot v-if="activeScreen === 'none'" name="none"></slot>
3135
<slot v-if="activeScreen === 'sm'" name="sm"></slot>
@@ -34,6 +38,7 @@
3438
<slot v-if="activeScreen === 'xl'" name="xl"></slot>
3539
</div>
3640
</div>
41+
3742
</div>
3843
</template>
3944

source/_assets/less/markdown.less

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,12 @@
196196
}
197197

198198
> pre, pre&, > ul li pre, > ol li pre {
199+
@apply flex p-0 bg-gray-800;
200+
@apply text-sm leading-normal;
201+
}
202+
203+
> pre code, pre code&, > ul li pre code, > ol li pre code {
199204
@apply p-4;
200-
@apply bg-gray-800;
201-
@apply text-sm;
202-
@apply leading-normal;
203205
}
204206

205207
> table {

source/_assets/less/prism-atom-dark.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ pre[class*="language-"] {
172172
code[class*="language-"], pre[class*="language-"] {
173173
@apply subpixel-antialiased !important;
174174
@apply text-code-white !important;
175+
@apply scrolling-touch !important;
175176
}
176177
.token.comment {
177178
@apply text-gray-500 !important;

source/_partials/code-sample.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div v-pre class="bg-white rounded-t-lg overflow-hidden border-t border-l border-r border-gray-400 p-4 {{ $class ?? '' }}">
33
{{ $slot }}
44
</div>
5-
<div v-pre class="scollbar-none rounded-b-lg p-4 bg-gray-800">
6-
<pre class="scrollbar-none language-{{ $lang ?? 'html' }}" style="margin: 0; padding: 0;"><code>{{ e($code ?? $slot) }}</code></pre>
5+
<div v-pre class="rounded-b-lg bg-gray-800">
6+
<pre class="scrollbar-none m-0 p-0 language-{{ $lang ?? 'html' }}"><code class="inline-block p-4 scrolling-touch">{{ e($code ?? $slot) }}</code></pre>
77
</div>
88
</div>

source/docs/installation.blade.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ titleBorder: true
88
<div class="heading mt-0">
99
<h2 class="flex markdown mt-0">
1010
<span class="text-lg bg-gray-200 text-gray-700 h-6 w-6 rounded-full inline-flex justify-center items-center mt-px mr-3">1</span>
11-
Install Tailwind via npm
11+
Install Tailwind via npm
1212
</h2>
1313
</div>
1414

@@ -259,19 +259,19 @@ Before using the CDN build please note, many of the features that make Tailwind
259259

260260
<ul class="list-none pl-0">
261261
<li class="flex items-center">
262-
<svg class="h-6 w-6 mr-2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="icon-close-circle"><circle cx="12" cy="12" r="10" fill="#fed7d7"/><path fill="#f56565" d="M13.41 12l2.83 2.83a1 1 0 0 1-1.41 1.41L12 13.41l-2.83 2.83a1 1 0 1 1-1.41-1.41L10.59 12 7.76 9.17a1 1 0 0 1 1.41-1.41L12 10.59l2.83-2.83a1 1 0 0 1 1.41 1.41L13.41 12z"/></svg>
262+
<svg class="h-6 w-6 mr-2 flex-shrink-0" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="icon-close-circle"><circle cx="12" cy="12" r="10" fill="#fed7d7"/><path fill="#f56565" d="M13.41 12l2.83 2.83a1 1 0 0 1-1.41 1.41L12 13.41l-2.83 2.83a1 1 0 1 1-1.41-1.41L10.59 12 7.76 9.17a1 1 0 0 1 1.41-1.41L12 10.59l2.83-2.83a1 1 0 0 1 1.41 1.41L13.41 12z"/></svg>
263263
<span>You can't customize Tailwind's default theme</span>
264264
</li>
265265
<li class="flex items-center">
266-
<svg class="h-6 w-6 mr-2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="icon-close-circle"><circle cx="12" cy="12" r="10" fill="#fed7d7"/><path fill="#f56565" d="M13.41 12l2.83 2.83a1 1 0 0 1-1.41 1.41L12 13.41l-2.83 2.83a1 1 0 1 1-1.41-1.41L10.59 12 7.76 9.17a1 1 0 0 1 1.41-1.41L12 10.59l2.83-2.83a1 1 0 0 1 1.41 1.41L13.41 12z"/></svg>
266+
<svg class="h-6 w-6 mr-2 flex-shrink-0" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="icon-close-circle"><circle cx="12" cy="12" r="10" fill="#fed7d7"/><path fill="#f56565" d="M13.41 12l2.83 2.83a1 1 0 0 1-1.41 1.41L12 13.41l-2.83 2.83a1 1 0 1 1-1.41-1.41L10.59 12 7.76 9.17a1 1 0 0 1 1.41-1.41L12 10.59l2.83-2.83a1 1 0 0 1 1.41 1.41L13.41 12z"/></svg>
267267
<span>You can't use any <a href="/docs/functions-and-directives">directives</a> like <code>@apply</code>, <code>@variants</code>, etc.</span>
268268
</li>
269269
<li class="flex items-center">
270-
<svg class="h-6 w-6 mr-2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="icon-close-circle"><circle cx="12" cy="12" r="10" fill="#fed7d7"/><path fill="#f56565" d="M13.41 12l2.83 2.83a1 1 0 0 1-1.41 1.41L12 13.41l-2.83 2.83a1 1 0 1 1-1.41-1.41L10.59 12 7.76 9.17a1 1 0 0 1 1.41-1.41L12 10.59l2.83-2.83a1 1 0 0 1 1.41 1.41L13.41 12z"/></svg>
270+
<svg class="h-6 w-6 mr-2 flex-shrink-0" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="icon-close-circle"><circle cx="12" cy="12" r="10" fill="#fed7d7"/><path fill="#f56565" d="M13.41 12l2.83 2.83a1 1 0 0 1-1.41 1.41L12 13.41l-2.83 2.83a1 1 0 1 1-1.41-1.41L10.59 12 7.76 9.17a1 1 0 0 1 1.41-1.41L12 10.59l2.83-2.83a1 1 0 0 1 1.41 1.41L13.41 12z"/></svg>
271271
<span>You can't enable features like <a href="/docs/pseudo-class-variants#group-hover"><code>group-hover</code></a></span>
272272
</li>
273273
<li class="flex items-center">
274-
<svg class="h-6 w-6 mr-2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="icon-close-circle"><circle cx="12" cy="12" r="10" fill="#fed7d7"/><path fill="#f56565" d="M13.41 12l2.83 2.83a1 1 0 0 1-1.41 1.41L12 13.41l-2.83 2.83a1 1 0 1 1-1.41-1.41L10.59 12 7.76 9.17a1 1 0 0 1 1.41-1.41L12 10.59l2.83-2.83a1 1 0 0 1 1.41 1.41L13.41 12z"/></svg>
274+
<svg class="h-6 w-6 mr-2 flex-shrink-0" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="icon-close-circle"><circle cx="12" cy="12" r="10" fill="#fed7d7"/><path fill="#f56565" d="M13.41 12l2.83 2.83a1 1 0 0 1-1.41 1.41L12 13.41l-2.83 2.83a1 1 0 1 1-1.41-1.41L10.59 12 7.76 9.17a1 1 0 0 1 1.41-1.41L12 10.59l2.83-2.83a1 1 0 0 1 1.41 1.41L13.41 12z"/></svg>
275275
<span>You can't install third-party plugins</span>
276276
</li>
277277
</ul>

0 commit comments

Comments
 (0)