diff options
author | 2021-05-21 14:02:19 -0600 | |
---|---|---|
committer | 2021-05-21 14:02:19 -0600 | |
commit | 19e20f2c54eaa8f0c2ebec54b071ffc4abd524bd (patch) | |
tree | c483e969746be30aa980a6fc8e583d59c85cb9b4 /examples/tailwindcss | |
parent | 69d693b77ce8d702a193bfcff8e5338889546ae4 (diff) | |
download | astro-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.mjs | 5 | ||||
-rw-r--r-- | examples/tailwindcss/package.json | 2 | ||||
-rw-r--r-- | examples/tailwindcss/public/global.css | 3 | ||||
-rw-r--r-- | examples/tailwindcss/src/components/Button.astro | 5 | ||||
-rw-r--r-- | examples/tailwindcss/src/pages/index.astro | 4 |
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> |