-
-
Notifications
You must be signed in to change notification settings - Fork 255
docs(docs): add comprehensive tailwind css playground documentation #998
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,95 @@ | ||
| # Tailwind CSS | ||
|
|
||
| TODO... | ||
| import LiveCodes from '../../src/components/LiveCodes.tsx'; | ||
| import RunInLiveCodes from '../../src/components/RunInLiveCodes.tsx'; | ||
|
|
||
| export const basicDemo = { | ||
| activeEditor: 'markup', | ||
| markup: { | ||
| language: 'html', | ||
| content: `<div class="flex items-center justify-center h-screen bg-gray-100">\n <h1 class="text-4xl font-bold text-blue-500">Hello, Tailwind!</h1>\n</div>\n`, | ||
| }, | ||
| processors: ['tailwindcss'], | ||
| }; | ||
|
|
||
| export const tailwindcssDemo = { | ||
| activeEditor: 'script', | ||
| script: { | ||
| language: 'react', | ||
| content: `export default function() {\n return <h1 className="text-3xl font-bold text-gray-500 text-center m-4">Hello, Tailwind CSS!</h1>;\n}\n`, | ||
| }, | ||
| processors: ['tailwindcss'], | ||
| }; | ||
|
|
||
| [Tailwind CSS](https://tailwindcss.com/) is an open-source CSS framework that provides utility CSS classes that can be composed to build any design, directly in the markup. | ||
|
|
||
| ## Demo | ||
|
|
||
| <LiveCodes template="tailwindcss" height="60vh"></LiveCodes> | ||
|
|
||
| ## Usage | ||
|
|
||
| Tailwind CSS is enabled as a [CSS processor](../features/css.mdx#css-processors). Once enabled from the style editor menu or in [`processors`](../configuration/configuration-object.mdx#processors) property of the [configuration object](../configuration/configuration-object.mdx), all Tailwind utility classes are available immediately in your markup. | ||
|
|
||
| <RunInLiveCodes | ||
| params={basicDemo} | ||
| code={basicDemo.markup.content} | ||
| language="html" | ||
| formatCode={false} | ||
| /> | ||
|
|
||
| :::info note | ||
|
|
||
| Tailwind CSS is imported using `@import "tailwindcss";` directive in the [style editor](../features/projects.mdx#style-editor). | ||
|
|
||
| If no `@import` is added to the style editor, LiveCodes automatically injects it when the Tailwind CSS processor is enabled. | ||
|
|
||
| ::: | ||
|
|
||
| ### Usage with CSS Frameworks in JSX/SFCs | ||
|
|
||
| CSS Frameworks supported in LiveCodes (e.g. Tailwind CSS, [UnoCSS](./unocss.mdx), [WindiCSS](./windicss.mdx)) can detect class names added in JSX and framework SFCs such as [React](./react.mdx), [Vue](./vue.mdx) and [Svelte](./svelte.mdx). Make sure that the Tailwind CSS processor is enabled. | ||
|
|
||
| <RunInLiveCodes | ||
| params={tailwindcssDemo} | ||
| code={tailwindcssDemo.script.content} | ||
| language="jsx" | ||
| /> | ||
|
|
||
| ### Tailwind CSS Plugins | ||
|
|
||
| Tailwind CSS plugins can be imported in the [style editor](../features/projects.mdx#style-editor). | ||
|
|
||
| ```css | ||
| @import "@tailwindcss/forms"; | ||
| @import "@tailwindcss/typography"; | ||
| @import "@tailwindcss/aspect-ratio"; | ||
| @import "@tailwindcss/line-clamp"; | ||
| ``` | ||
|
|
||
|
|
||
| ## Processor Info | ||
|
|
||
| ### Name | ||
|
|
||
| `tailwindcss` | ||
|
|
||
| ## Compiler | ||
|
|
||
| Tailwind CSS official compiler, running client-side in the browser. The compiler generates styles on-demand, so only the classes used in your markup are included in the output. | ||
|
|
||
| ### Version | ||
|
|
||
| `tailwindcss`: v4.1.16 | ||
|
Comment on lines
+81
to
+83
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. π― Functional Correctness | π‘ Minor π§© Analysis chainπ Script executed: #!/bin/bash
set -euo pipefail
# Inspect the documented Tailwind version and nearby context.
git ls-files docs/docs/languages/tailwindcss.mdx
printf '\n--- file excerpt ---\n'
cat -n docs/docs/languages/tailwindcss.mdx | sed -n '70,95p'
printf '\n--- search for tailwind version references ---\n'
rg -n "tailwindcss.*v4\.1\.16|v4\.1\.16|tailwindcss" docs -g '*.mdx' -g '*.md' -g '*.json' -g '*.ts' -g '*.js'Repository: live-codes/livecodes Length of output: 6182 π Script executed: #!/bin/bash
set -euo pipefail
# Inspect the documented Tailwind version and nearby context.
git ls-files docs/docs/languages/tailwindcss.mdx
printf '\n--- file excerpt ---\n'
cat -n docs/docs/languages/tailwindcss.mdx | sed -n '70,95p'
printf '\n--- search for tailwind version references ---\n'
rg -n "tailwindcss.*v4\.1\.16|v4\.1\.16|tailwindcss" docs -g '*.mdx' -g '*.md' -g '*.json' -g '*.ts' -g '*.js'Repository: live-codes/livecodes Length of output: 6182 π Web query:
π‘ Result: Tailwind CSS version 4.3.1 was released on June 12, 2026 [1][2]. This release included several updates and fixes across the framework and its tooling, including: - New Features: Added a --silent option to the Citations:
π Web query:
π‘ Result: Tailwind CSS version 4.3.1 was released on June 12, 2026 [1][2][3]. This release included several new features, improvements, and bug fixes: New Features and Improvements - Added a --silent option to the Citations:
Update the documented Tailwind version. π€ Prompt for AI Agents |
||
|
|
||
| ## Starter Template | ||
|
|
||
| https://livecodes.io/?template=tailwindcss | ||
|
|
||
| ## Links | ||
|
|
||
| - [Tailwind CSS](https://tailwindcss.com/) | ||
| - [Tailwind CSS Documentation](https://tailwindcss.com/docs) | ||
| - [LiveCodes CSS Processors](../features/css.mdx#css-processors) | ||
| - [UnoCSS](./unocss.mdx) | ||
| - [WindiCSS](./windicss.mdx) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π― Functional Correctness | π Major
π§© Analysis chain
π Script executed:
Repository: live-codes/livecodes
Length of output: 18758
π Script executed:
Repository: live-codes/livecodes
Length of output: 18758
π Script executed:
Repository: live-codes/livecodes
Length of output: 239
Use
@pluginhere, not@import.These are Tailwind plugin packages, so the snippet should show plugin registration instead of CSS imports.
Suggested change
π Committable suggestion
π€ Prompt for AI Agents