diff --git a/package.json b/package.json index 6f5f24a9..db81d84e 100644 --- a/package.json +++ b/package.json @@ -29,5 +29,8 @@ "tailwindcss-visuallyhidden": "^1.0.1", "tailwindcss-vuejs": "^1.0.0", "vue": "^2.5.17" + }, + "dependencies": { + "postcss-import": "^12.0.1" } } diff --git a/resources/css/app.css b/resources/css/app.css index a317aca1..4b2aa713 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -1,60 +1,8 @@ -@import '~highlightjs/styles/github-gist.css'; +@import 'tailwindcss/base'; +@import 'custom-base'; -@tailwind base; +@import 'tailwindcss/components'; +@import 'highlightjs/styles/github-gist'; +@import 'custom-components'; -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-600 no-underline; - - &:hover { - @apply underline - } -} - -blockquote { - @apply border-l-4 border-blue-600 pl-4 px-6 py-2 -} - -@tailwind components; - -.container { - @apply w-full max-w-5xl px-4 mx-auto -} - -p.lead { - @screen md { - @apply text-lg - } -} - -.wrap { - @apply w-full max-w-3xl mx-auto; - - &.is-wide { - @apply max-w-5xl - } -} - -@import 'components/button.css'; -@import 'components/markup.css'; -@import 'components/note.css'; -@import 'components/table.css'; -@import 'components/video.css'; -@import 'components/widget.css'; - -@tailwind utilities; +@import 'tailwindcss/utilities'; diff --git a/resources/css/components/container.css b/resources/css/components/container.css new file mode 100644 index 00000000..b2096cca --- /dev/null +++ b/resources/css/components/container.css @@ -0,0 +1,3 @@ +.container { + @apply w-full max-w-5xl px-4 mx-auto +} diff --git a/resources/css/components/lead.css b/resources/css/components/lead.css new file mode 100644 index 00000000..7805fa41 --- /dev/null +++ b/resources/css/components/lead.css @@ -0,0 +1,5 @@ +p.lead { + @screen md { + @apply text-lg + } +} diff --git a/resources/css/components/wrap.css b/resources/css/components/wrap.css new file mode 100644 index 00000000..9fe5fde9 --- /dev/null +++ b/resources/css/components/wrap.css @@ -0,0 +1,7 @@ +.wrap { + @apply w-full max-w-3xl mx-auto; + + &.is-wide { + @apply max-w-5xl + } +} diff --git a/resources/css/custom-base.css b/resources/css/custom-base.css new file mode 100644 index 00000000..0456432a --- /dev/null +++ b/resources/css/custom-base.css @@ -0,0 +1,27 @@ +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-600 no-underline; + + &:hover { + @apply underline + } +} + +blockquote { + @apply border-l-4 border-blue-600 pl-4 px-6 py-2 +} diff --git a/resources/css/custom-components.css b/resources/css/custom-components.css new file mode 100644 index 00000000..972c258e --- /dev/null +++ b/resources/css/custom-components.css @@ -0,0 +1,9 @@ +@import 'components/button'; +@import 'components/container'; +@import 'components/lead'; +@import 'components/markup'; +@import 'components/note'; +@import 'components/table'; +@import 'components/video'; +@import 'components/widget'; +@import 'components/wrap'; diff --git a/webpack.mix.js b/webpack.mix.js index c2560b43..10ab57ff 100644 --- a/webpack.mix.js +++ b/webpack.mix.js @@ -4,6 +4,7 @@ require('laravel-mix-purgecss') mix.disableNotifications() .postCss('resources/css/app.css', 'source/dist/css', [ + require('postcss-import')(), require('tailwindcss')('tailwind.config.js'), require('postcss-nested'), ]) diff --git a/yarn.lock b/yarn.lock index d98ec397..856dcbd9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5500,7 +5500,7 @@ performance-now@^2.1.0: resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= -pify@^2.0.0: +pify@^2.0.0, pify@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw= @@ -5630,6 +5630,16 @@ postcss-functions@^3.0.0: postcss "^6.0.9" postcss-value-parser "^3.3.0" +postcss-import@^12.0.1: + version "12.0.1" + resolved "https://registry.yarnpkg.com/postcss-import/-/postcss-import-12.0.1.tgz#cf8c7ab0b5ccab5649024536e565f841928b7153" + integrity sha512-3Gti33dmCjyKBgimqGxL3vcV8w9+bsHwO5UrBawp796+jdardbcFl4RP5w/76BwNL7aGzpKstIfF9I+kdE8pTw== + dependencies: + postcss "^7.0.1" + postcss-value-parser "^3.2.3" + read-cache "^1.0.0" + resolve "^1.1.7" + postcss-js@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/postcss-js/-/postcss-js-2.0.1.tgz#4154e906ff410930afab63a24210be1b831e89a9" @@ -5918,7 +5928,7 @@ postcss@^6.0.0, postcss@^6.0.1, postcss@^6.0.17, postcss@^6.0.8, postcss@^6.0.9: source-map "^0.6.1" supports-color "^5.4.0" -postcss@^7.0.11, postcss@^7.0.14, postcss@^7.0.16: +postcss@^7.0.1, postcss@^7.0.11, postcss@^7.0.14, postcss@^7.0.16: version "7.0.17" resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.17.tgz#4da1bdff5322d4a0acaab4d87f3e782436bad31f" integrity sha512-546ZowA+KZ3OasvQZHsbuEpysvwTZNGJv9EfyCQdsIDltPSWHAeTQ5fQy/Npi2ZDtLI3zs7Ps/p6wThErhm9fQ== @@ -6148,6 +6158,13 @@ rc@^1.2.7: minimist "^1.2.0" strip-json-comments "~2.0.1" +read-cache@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/read-cache/-/read-cache-1.0.0.tgz#e664ef31161166c9751cdbe8dbcf86b5fb58f774" + integrity sha1-5mTvMRYRZsl1HNvo28+GtftY93Q= + dependencies: + pify "^2.3.0" + read-pkg-up@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" @@ -6434,7 +6451,7 @@ resolve-url@^0.2.1: resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= -resolve@^1.10.0, resolve@^1.11.0, resolve@^1.4.0, resolve@^1.5.0, resolve@^1.8.1: +resolve@^1.1.7, resolve@^1.10.0, resolve@^1.11.0, resolve@^1.4.0, resolve@^1.5.0, resolve@^1.8.1: version "1.11.1" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.11.1.tgz#ea10d8110376982fef578df8fc30b9ac30a07a3e" integrity sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw==