summaryrefslogtreecommitdiff
path: root/examples/tailwindcss
diff options
context:
space:
mode:
authorGravatar Drew Powers <1369770+drwpow@users.noreply.github.com> 2021-05-21 14:02:19 -0600
committerGravatar GitHub <noreply@github.com> 2021-05-21 14:02:19 -0600
commit19e20f2c54eaa8f0c2ebec54b071ffc4abd524bd (patch)
treec483e969746be30aa980a6fc8e583d59c85cb9b4 /examples/tailwindcss
parent69d693b77ce8d702a193bfcff8e5338889546ae4 (diff)
downloadastro-19e20f2c54eaa8f0c2ebec54b071ffc4abd524bd.tar.gz
astro-19e20f2c54eaa8f0c2ebec54b071ffc4abd524bd.tar.zst
astro-19e20f2c54eaa8f0c2ebec54b071ffc4abd524bd.zip
Add Tailwind support to Astro Dev Server (#222)
* Improve PostCSS and Tailwind support * Update styling docs * Changelog * Fix test hanging
Diffstat (limited to 'examples/tailwindcss')
-rw-r--r--examples/tailwindcss/astro.config.mjs5
-rw-r--r--examples/tailwindcss/package.json2
-rw-r--r--examples/tailwindcss/public/global.css3
-rw-r--r--examples/tailwindcss/src/components/Button.astro5
-rw-r--r--examples/tailwindcss/src/pages/index.astro4
5 files changed, 10 insertions, 9 deletions
diff --git a/examples/tailwindcss/astro.config.mjs b/examples/tailwindcss/astro.config.mjs
new file mode 100644
index 000000000..7e6aaa3fd
--- /dev/null
+++ b/examples/tailwindcss/astro.config.mjs
@@ -0,0 +1,5 @@
+export default {
+ devOptions: {
+ tailwindConfig: './tailwind.config.js',
+ },
+};
diff --git a/examples/tailwindcss/package.json b/examples/tailwindcss/package.json
index a6a481ff1..4794d6d4c 100644
--- a/examples/tailwindcss/package.json
+++ b/examples/tailwindcss/package.json
@@ -9,7 +9,7 @@
},
"devDependencies": {
"astro": "^0.10.0",
- "tailwindcss": "^2.1.1"
+ "tailwindcss": "^2.1.2"
},
"snowpack": {
"workspaceRoot": "../.."
diff --git a/examples/tailwindcss/public/global.css b/examples/tailwindcss/public/global.css
new file mode 100644
index 000000000..b5c61c956
--- /dev/null
+++ b/examples/tailwindcss/public/global.css
@@ -0,0 +1,3 @@
+@tailwind base;
+@tailwind components;
+@tailwind utilities;
diff --git a/examples/tailwindcss/src/components/Button.astro b/examples/tailwindcss/src/components/Button.astro
index ac13d7a49..64baa50ae 100644
--- a/examples/tailwindcss/src/components/Button.astro
+++ b/examples/tailwindcss/src/components/Button.astro
@@ -1,8 +1,3 @@
-<style>
- @tailwind components;
- @tailwind utilities;
-</style>
-
<button class="py-2 px-4 bg-green-500 text-white font-semibold rounded-lg shadow-md hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-green-400 focus:ring-opacity-75">
<slot />
</button>
diff --git a/examples/tailwindcss/src/pages/index.astro b/examples/tailwindcss/src/pages/index.astro
index e062f1f5b..00ac41dac 100644
--- a/examples/tailwindcss/src/pages/index.astro
+++ b/examples/tailwindcss/src/pages/index.astro
@@ -6,9 +6,7 @@ import Button from '../components/Button.astro';
<head>
<meta charset="UTF-8" />
<title>Astro + TailwindCSS</title>
- <style>
- @tailwind base;
- </style>
+ <link rel="stylesheet" type="text/css" href="/global.css">
</head>
<body>