Move CSS and JS into assets

This commit is contained in:
Oliver Davies 2020-06-16 00:03:58 +01:00
parent fec0feff36
commit 0215e31154
16 changed files with 1 additions and 1 deletions

View file

@ -0,0 +1,14 @@
.button {
@apply py-2 px-3 inline-block border border-blue-600;
@apply text-sm text-white no-underline bg-blue-600 rounded;
&:focus {
@apply py-2 px-3 m-0
}
&:active,
&:focus,
&:hover {
@apply bg-white text-blue-600
}
}

View file

@ -0,0 +1,3 @@
.container {
@apply w-full max-w-5xl px-4 mx-auto
}

View file

@ -0,0 +1,5 @@
p.lead {
@screen md {
@apply text-lg
}
}

View file

@ -0,0 +1,115 @@
.markup {
a {
@apply underline;
&:hover {
@apply no-underline
}
&:focus {
@apply p-px -m-px bg-blue-700 text-white outline-none
}
}
p {
@apply leading-relaxed;
+ p {
@apply mt-4
}
}
ol {
@apply list-decimal
}
ul {
@apply list-disc;
}
ol,
ul {
@apply pl-5;
+ * {
@apply mt-4
}
li + li {
@apply mt-2
}
}
p {
+ blockquote,
+ ol,
+ ul,
+ div[v-pre] {
@apply mt-4
}
}
blockquote + * {
@apply mt-4
}
code {
@apply -my-px px-1 py-px border border-gray-400 text-sm bg-gray-200
}
pre {
@apply border-l-3 border-gray-400 text-sm bg-gray-200;
code {
@apply p-6 block border-none leading-loose text-sm overflow-x-scroll
}
}
* + pre,
* + div[v-pre] {
@apply my-4
}
img,
figure {
@apply my-8
}
figure {
img {
@apply m-0
}
figcaption {
@apply mt-3
}
}
h2 {
@apply leading-tight
}
* + h2 {
@apply mt-8
}
h2 + * {
@apply mt-4
}
h3 {
@apply text-xl font-bold leading-tight
}
* + h3 {
@apply mt-6
}
h3 + * {
@apply mt-2
}
h2 + h3 {
@apply mt-4
}
}

View file

@ -0,0 +1,15 @@
.note {
@apply bg-blue-200 border-blue-600 border-l-4 mb-4 p-4 rounded;
> *:not(:first-child) {
@apply mt-6
}
p a {
@apply text-black underline;
&:hover {
@apply no-underline
}
}
}

View file

@ -0,0 +1,18 @@
.table {
@apply w-full;
th {
@apply bg-gray-200 text-left
}
th,
td {
@apply px-4 py-2 border border-solid border-gray-300
}
}
table.is-striped {
tbody > tr:not(:nth-child(odd)) td {
@apply bg-gray-100
}
}

View file

@ -0,0 +1,9 @@
.video-full {
@apply w-full relative;
padding-top: 56.25%;
iframe,
embed {
@apply absolute h-full left-0 top-0 w-full
}
}

View file

@ -0,0 +1,3 @@
.widget {
@apply block mb-6
}

View file

@ -0,0 +1,7 @@
.wrap {
@apply w-full max-w-3xl mx-auto;
&.is-wide {
@apply max-w-5xl
}
}

View file

@ -0,0 +1,31 @@
h1, h2, h3 {
@apply font-bold
}
h1 {
@apply text-3xl
}
h2 {
@apply text-2xl
}
img {
@apply max-w-full h-auto
}
a {
@apply text-blue-700 no-underline;
&:hover {
@apply underline
}
}
blockquote {
@apply pl-5 border-l-4 border-gray-300 italic
}
iframe {
@apply max-w-full
}

View file

@ -0,0 +1,9 @@
@import './components/button.pcss';
@import './components/container.pcss';
@import './components/lead.pcss';
@import './components/markup.pcss';
@import './components/note.pcss';
@import './components/table.pcss';
@import './components/video.pcss';
@import './components/widget.pcss';
@import './components/wrap.pcss';

View file

@ -0,0 +1,3 @@
.no-js .js-hidden {
display: none
}

View file

@ -0,0 +1,3 @@
.hljs {
@apply p-0 bg-inherit
}

View file

@ -0,0 +1,11 @@
@import 'tailwindcss/base';
@import './custom-base.pcss';
@import 'tailwindcss/components';
@import './custom-components.pcss';
@import 'highlightjs/styles/github-gist';
@import './libraries/hljs.pcss';
@import 'tailwindcss/utilities';
@import './custom-utilities.pcss';

View file

@ -0,0 +1,9 @@
import '../css/tailwind.pcss'
import 'alpinejs'
import hljs from 'highlightjs'
document.addEventListener('DOMContentLoaded', event => {
document.querySelectorAll('pre code').forEach(block => {
hljs.highlightBlock(block)
})
})