|
======================== |
|
CODE SNIPPETS |
|
======================== |
|
TITLE: Start Development Build Process |
|
DESCRIPTION: This command initiates the development build process, typically configured in `package.json`, to compile and serve your application with Tailwind CSS. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/using-postcss |
|
|
|
LANGUAGE: bash |
|
CODE: |
|
``` |
|
npm run dev |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Tailwind CSS Getting Started & Core Concepts |
|
DESCRIPTION: This section outlines the initial steps for setting up Tailwind CSS, including installation and editor configuration, along with fundamental concepts for styling with utility classes, responsive design, dark mode, and custom styles. |
|
|
|
SOURCE: https://tailwindcss.com/docs/visibility |
|
|
|
LANGUAGE: APIDOC |
|
CODE: |
|
``` |
|
Getting Started: |
|
- Installation: /docs/installation |
|
- Editor setup: /docs/editor-setup |
|
- Compatibility: /docs/compatibility |
|
- Upgrade guide: /docs/upgrade-guide |
|
|
|
Core Concepts: |
|
- Styling with utility classes: /docs/styling-with-utility-classes |
|
- Hover, focus, and other states: /docs/hover-focus-and-other-states |
|
- Responsive design: /docs/responsive-design |
|
- Dark mode: /docs/dark-mode |
|
- Theme variables: /docs/theme |
|
- Colors: /docs/colors |
|
- Adding custom styles: /docs/adding-custom-styles |
|
- Detecting classes in source files: /docs/detecting-classes-in-source-files |
|
- Functions and directives: /docs/functions-and-directives |
|
|
|
Base Styles: |
|
- Preflight: /docs/preflight |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Tailwind CSS Getting Started and Core Concepts |
|
DESCRIPTION: This section outlines the initial setup and fundamental principles for using Tailwind CSS. It covers installation, editor configuration, compatibility, upgrade procedures, and core concepts like utility-first styling, responsive design, dark mode, and custom styles. |
|
|
|
SOURCE: https://tailwindcss.com/docs/letter-spacing |
|
|
|
LANGUAGE: APIDOC |
|
CODE: |
|
``` |
|
Getting Started: |
|
- Installation: Steps to set up Tailwind CSS in your project. |
|
- Editor setup: Configuration for IDEs to enhance Tailwind development. |
|
- Compatibility: Information on browser and environment compatibility. |
|
- Upgrade guide: Instructions for upgrading to newer versions. |
|
|
|
Core Concepts: |
|
- Styling with utility classes: Understanding the utility-first approach. |
|
- Hover, focus, and other states: Applying styles based on element states. |
|
- Responsive design: Implementing responsive layouts with breakpoints. |
|
- Dark mode: Configuring and using dark mode styles. |
|
- Theme variables: Customizing design tokens via the theme configuration. |
|
- Colors: Managing and applying color palettes. |
|
- Adding custom styles: Extending Tailwind with custom CSS. |
|
- Detecting classes in source files: How Tailwind processes and purges unused CSS. |
|
- Functions and directives: Using Tailwind's custom CSS functions and directives. |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Start Development Server |
|
DESCRIPTION: Run the development server to begin building your application. This command typically watches for file changes, recompiles assets, and serves your application locally, allowing for live development. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/using-vite |
|
|
|
LANGUAGE: Terminal |
|
CODE: |
|
``` |
|
npm run dev |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Start Project Build Process |
|
DESCRIPTION: This command initiates the project's build process, typically defined in the `package.json` scripts. Running `npm run start` is a common way to launch a development server or compile assets for a web application. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/emberjs |
|
|
|
LANGUAGE: Terminal |
|
CODE: |
|
``` |
|
npm run start |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Start Vite development server |
|
DESCRIPTION: Executes the `npm run dev` command, which typically starts the development server configured in your `package.json`. This command allows you to preview your application in a browser and benefits from hot module reloading. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation |
|
|
|
LANGUAGE: bash |
|
CODE: |
|
``` |
|
npm run dev |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Tailwind CSS Core Concepts and Getting Started |
|
DESCRIPTION: This section outlines the foundational topics for getting started with and understanding the core principles of Tailwind CSS. It includes guides on installation, editor setup, compatibility, upgrading, and fundamental styling concepts like utility classes, states, responsive design, dark mode, and custom styles. |
|
|
|
SOURCE: https://tailwindcss.com/docs/place-content |
|
|
|
LANGUAGE: APIDOC |
|
CODE: |
|
``` |
|
Getting Started: |
|
- Installation: Guide to setting up Tailwind CSS in a project. |
|
- Editor Setup: Configuration for IDEs to enhance Tailwind CSS development. |
|
- Compatibility: Information on browser and environment compatibility. |
|
- Upgrade Guide: Instructions for migrating to newer versions of Tailwind CSS. |
|
|
|
Core Concepts: |
|
- Styling with Utility Classes: Explanation of Tailwind's utility-first approach. |
|
- Hover, Focus, and Other States: How to apply styles based on element states. |
|
- Responsive Design: Techniques for creating responsive layouts. |
|
- Dark Mode: Implementing dark themes using Tailwind utilities. |
|
- Theme Variables: Customizing design tokens like colors, fonts, and spacing. |
|
- Colors: Overview of Tailwind's default color palette and custom color definition. |
|
- Adding Custom Styles: Methods for extending Tailwind with custom CSS. |
|
- Detecting Classes in Source Files: How Tailwind scans files for utility classes. |
|
- Functions and Directives: Usage of Tailwind's custom CSS functions and directives (e.g., @apply, @tailwind). |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Start SvelteKit Development Server |
|
DESCRIPTION: Command to start the SvelteKit development server, which will compile and serve the application with Tailwind CSS integrated. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/sveltekit |
|
|
|
LANGUAGE: Shell |
|
CODE: |
|
``` |
|
npm run dev |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Start Laravel Development Server with Vite |
|
DESCRIPTION: This command initiates the development server for your Laravel project, leveraging Vite for fast compilation and hot module replacement. It's used during development to see changes instantly. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/laravel/vite |
|
|
|
LANGUAGE: Shell |
|
CODE: |
|
``` |
|
npm run dev |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Create a New Laravel Project |
|
DESCRIPTION: This command initializes a new Laravel project using the Laravel installer. It sets up the basic directory structure and necessary files for a new application. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/laravel/vite |
|
|
|
LANGUAGE: Shell |
|
CODE: |
|
``` |
|
laravel new my-project |
|
cd my-project |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Start Rspack Development Server |
|
DESCRIPTION: Runs the development build process for the Rspack project, typically starting a local server and enabling live reloading. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/rspack/react |
|
|
|
LANGUAGE: shell |
|
CODE: |
|
``` |
|
npm run dev |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Tailwind CSS Core Concepts and Setup Documentation |
|
DESCRIPTION: This section outlines the foundational documentation topics for Tailwind CSS, including installation guides, editor configurations, compatibility information, and core styling principles like utility classes, responsive design, and dark mode. |
|
|
|
SOURCE: https://tailwindcss.com/docs/object-fit |
|
|
|
LANGUAGE: APIDOC |
|
CODE: |
|
``` |
|
### Getting started |
|
- Installation |
|
- Editor setup |
|
- Compatibility |
|
- Upgrade guide |
|
|
|
### Core concepts |
|
- Styling with utility classes |
|
- Hover, focus, and other states |
|
- Responsive design |
|
- Dark mode |
|
- Theme variables |
|
- Colors |
|
- Adding custom styles |
|
- Detecting classes in source files |
|
- Functions and directives |
|
|
|
### Base styles |
|
- Preflight |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Start Rspack Build Process |
|
DESCRIPTION: Executes the development build process for your Rspack project. This command compiles your assets, including Tailwind CSS, and typically starts a development server. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/rspack/vue |
|
|
|
LANGUAGE: Terminal |
|
CODE: |
|
``` |
|
npm run dev |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Start Nuxt.js Development Server |
|
DESCRIPTION: Executes the `npm run dev` command to start the Nuxt.js development server, which compiles the application and serves it locally, allowing for real-time development. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/nuxt |
|
|
|
LANGUAGE: Terminal |
|
CODE: |
|
``` |
|
npm run dev |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Install Tailwind CSS PostCSS Dependencies |
|
DESCRIPTION: This command installs the necessary npm packages for integrating Tailwind CSS as a PostCSS plugin, including `tailwindcss`, `@tailwindcss/postcss`, and `postcss` itself. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/using-postcss |
|
|
|
LANGUAGE: bash |
|
CODE: |
|
``` |
|
npm install tailwindcss @tailwindcss/postcss postcss |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Install AdonisJS and Tailwind CSS via npm |
|
DESCRIPTION: Commands to initialize a new AdonisJS project and install Tailwind CSS with its Vite plugin dependencies using npm, followed by the command to start the development server. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/adonisjs |
|
|
|
LANGUAGE: Shell |
|
CODE: |
|
``` |
|
npm init adonisjs@latest my-project -- --kit=webcd my-project |
|
npm install tailwindcss @tailwindcss/vite |
|
npm run dev |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Install Tailwind CSS and CLI via npm |
|
DESCRIPTION: This command installs the `tailwindcss` package and the `@tailwindcss/cli` tool using npm, which are essential for setting up and building Tailwind CSS projects. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/tailwind-cli |
|
|
|
LANGUAGE: npm |
|
CODE: |
|
``` |
|
npm install tailwindcss @tailwindcss/cli |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Install Tailwind CSS in an Angular Project |
|
DESCRIPTION: This step-by-step guide outlines the process of setting up Tailwind CSS within an Angular application. It covers creating a new Angular project, installing necessary Tailwind CSS packages, configuring PostCSS, importing Tailwind's base styles, and running the development server to begin using Tailwind utility classes. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/angular |
|
|
|
LANGUAGE: bash |
|
CODE: |
|
``` |
|
ng new my-project --style css |
|
cd my-project |
|
``` |
|
|
|
LANGUAGE: bash |
|
CODE: |
|
``` |
|
npm install tailwindcss @tailwindcss/postcss postcss --force |
|
``` |
|
|
|
LANGUAGE: json |
|
CODE: |
|
``` |
|
{ |
|
"plugins": { |
|
"@tailwindcss/postcss": {} |
|
} |
|
} |
|
``` |
|
|
|
LANGUAGE: css |
|
CODE: |
|
``` |
|
@import "tailwindcss"; |
|
``` |
|
|
|
LANGUAGE: bash |
|
CODE: |
|
``` |
|
ng serve |
|
``` |
|
|
|
LANGUAGE: html |
|
CODE: |
|
``` |
|
<h1 class="text-3xl font-bold underline"> Hello world!</h1> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Install Tailwind CSS and Vite Plugin |
|
DESCRIPTION: Command to install Tailwind CSS and its Vite plugin, along with peer dependencies, using npm in a SvelteKit project. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/sveltekit |
|
|
|
LANGUAGE: Shell |
|
CODE: |
|
``` |
|
npm install tailwindcss @tailwindcss/vite |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Start Tailwind CLI Build Process with Watch Mode |
|
DESCRIPTION: This command initiates the Tailwind CSS CLI build process. It scans your source files for Tailwind classes, generates the corresponding CSS, and outputs it to a specified file. The `--watch` flag enables continuous rebuilding upon file changes. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/tailwind-cli |
|
|
|
LANGUAGE: npm |
|
CODE: |
|
``` |
|
npx @tailwindcss/cli -i ./src/input.css -o ./src/output.css --watch |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Start Meteor build process |
|
DESCRIPTION: Executes the npm start script to initiate the Meteor development server and build process, compiling the project including Tailwind CSS. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/meteor |
|
|
|
LANGUAGE: bash |
|
CODE: |
|
``` |
|
npm run start |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Start Project Build Process with Mix |
|
DESCRIPTION: This command initiates the project's build and development server process. For Phoenix applications, `mix phx.server` compiles assets, starts the server, and watches for file changes, enabling live reloading during development. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/phoenix |
|
|
|
LANGUAGE: Shell |
|
CODE: |
|
``` |
|
mix phx.server |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Create a new Vite project |
|
DESCRIPTION: Initializes a new Vite project using `npm create vite` and navigates into the newly created project directory. This is the first step to set up a modern web development environment. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation |
|
|
|
LANGUAGE: bash |
|
CODE: |
|
``` |
|
npm create vite@latest my-project |
|
cd my-project |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Install Tailwind CSS and Vite plugin |
|
DESCRIPTION: Installs the core `tailwindcss` package and the `@tailwindcss/vite` plugin using npm. These packages are essential for integrating Tailwind CSS with a Vite-based project, enabling its compilation and processing. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation |
|
|
|
LANGUAGE: bash |
|
CODE: |
|
``` |
|
npm install tailwindcss @tailwindcss/vite |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Install Tailwind CSS and Vite Plugin |
|
DESCRIPTION: This command installs Tailwind CSS and its Vite plugin, along with their peer dependencies, into the current project using npm. These packages are essential for integrating Tailwind CSS with a Vite-based build process. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/laravel/vite |
|
|
|
LANGUAGE: Shell |
|
CODE: |
|
``` |
|
npm install tailwindcss @tailwindcss/vite |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Import CSS into Ember.js Application |
|
DESCRIPTION: This snippet demonstrates how to import a CSS file (e.g., `./app.css`) into an Ember.js application's main `app.js` file. It shows the standard Ember application setup with module and pod prefixes, and initializer loading, ensuring the CSS is bundled with the application. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/emberjs |
|
|
|
LANGUAGE: JavaScript |
|
CODE: |
|
``` |
|
import Application from '@ember/application';import Resolver from 'ember-resolver';import loadInitializers from 'ember-load-initializers';import config from 'my-project/config/environment';import 'my-project/app.css';export default class App extends Application { modulePrefix = config.modulePrefix; podModulePrefix = config.podModulePrefix; Resolver = Resolver;}loadInitializers(App, config.modulePrefix); |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Install Tailwind CSS and Vite Plugin |
|
DESCRIPTION: Install the necessary npm packages for Tailwind CSS and its Vite plugin. This command adds `tailwindcss` and `@tailwindcss/vite` to your project's dependencies, enabling Tailwind CSS integration within a Vite build process. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/using-vite |
|
|
|
LANGUAGE: Terminal |
|
CODE: |
|
``` |
|
npm install tailwindcss @tailwindcss/vite |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Integrate Tailwind CSS in HTML |
|
DESCRIPTION: This HTML snippet demonstrates the basic setup for using Tailwind CSS. It shows how to include the compiled CSS file in the <head> section and apply Tailwind's utility classes, such as text-3xl, font-bold, and underline, to an <h1> element to style text. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/using-vite |
|
|
|
LANGUAGE: HTML |
|
CODE: |
|
``` |
|
<!doctype html><html><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link href="/src/style.css" rel="stylesheet"></head><body> <h1 class="text-3xl font-bold underline"> Hello world! </h1></body></html> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Integrate Tailwind CSS in HTML |
|
DESCRIPTION: This snippet demonstrates how to include Tailwind CSS in a basic HTML file and use its utility classes. It shows the necessary <link> tag for the compiled CSS and an example of applying text-3xl, font-bold, and underline classes to an <h1> element. Ensure /dist/styles.css is your compiled Tailwind CSS file. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/using-postcss |
|
|
|
LANGUAGE: HTML |
|
CODE: |
|
``` |
|
<!doctype html><html><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link href="/dist/styles.css" rel="stylesheet"></head><body> <h1 class="text-3xl font-bold underline"> Hello world! </h1></body></html> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Integrate Tailwind Play CDN into HTML |
|
DESCRIPTION: Demonstrates how to include the Tailwind CSS Play CDN script in an HTML file's head section to enable Tailwind utility classes for styling content directly in the browser. This setup is ideal for quick prototyping and development without a build step. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/play-cdn |
|
|
|
LANGUAGE: HTML |
|
CODE: |
|
``` |
|
<!doctype html><html> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script> </head> <body> <h1 class="text-3xl font-bold underline"> Hello world! </h1> </body></html> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Create a New Vite Project |
|
DESCRIPTION: Initiate a new Vite project using the `npm create vite` command. This command scaffolds a new project directory and navigates into it, preparing the environment for further development. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/using-vite |
|
|
|
LANGUAGE: Terminal |
|
CODE: |
|
``` |
|
npm create vite@latest my-project |
|
cd my-project |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Tailwind CSS Core Concepts and Setup |
|
DESCRIPTION: Documents fundamental aspects of using Tailwind CSS, including installation, editor setup, compatibility, upgrade guidance, and core styling principles like utility classes, states, responsive design, and theme customization. |
|
|
|
SOURCE: https://tailwindcss.com/docs/text-indent |
|
|
|
LANGUAGE: APIDOC |
|
CODE: |
|
``` |
|
Getting started: |
|
- Installation |
|
- Editor setup |
|
- Compatibility |
|
- Upgrade guide |
|
Core concepts: |
|
- Styling with utility classes |
|
- Hover, focus, and other states |
|
- Responsive design |
|
- Dark mode |
|
- Theme variables |
|
- Colors |
|
- Adding custom styles |
|
- Detecting classes in source files |
|
- Functions and directives |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Install Tailwind CSS and Vite Plugin for Nuxt.js |
|
DESCRIPTION: Installs the `tailwindcss` package and its Vite plugin (`@tailwindcss/vite`) along with their peer dependencies using npm, preparing the project for Tailwind CSS integration. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/nuxt |
|
|
|
LANGUAGE: Terminal |
|
CODE: |
|
``` |
|
npm install tailwindcss @tailwindcss/vite |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Tailwind CSS Core Concepts and Setup |
|
DESCRIPTION: This section outlines the fundamental concepts of using Tailwind CSS, including installation, editor setup, compatibility, and how to style elements using utility classes, manage states, implement responsive design, and handle dark mode. It also covers theme variables, custom styles, and detecting classes. |
|
|
|
SOURCE: https://tailwindcss.com/docs/background-position |
|
|
|
LANGUAGE: APIDOC |
|
CODE: |
|
``` |
|
Installation: Guide to setting up Tailwind CSS in a project. |
|
Editor setup: Configuration for IDEs to enhance Tailwind CSS development. |
|
Compatibility: Information on browser and framework compatibility. |
|
Upgrade guide: Instructions for migrating between Tailwind CSS versions. |
|
Styling with utility classes: Principles of applying styles directly in HTML using utility classes. |
|
Hover, focus, and other states: Applying styles based on element states. |
|
Responsive design: Techniques for creating responsive layouts using breakpoints. |
|
Dark mode: Implementing dark themes with Tailwind CSS. |
|
Theme variables: Customizing design tokens like colors, fonts, and spacing. |
|
Colors: Managing and using color palettes. |
|
Adding custom styles: Extending Tailwind CSS with custom CSS or utility classes. |
|
Detecting classes in source files: How Tailwind's JIT engine scans for used classes. |
|
Functions and directives: Using Tailwind's `@apply`, `@tailwind`, and `theme()` functions in CSS. |
|
Preflight: Tailwind's opinionated base styles for cross-browser consistency. |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Install Tailwind CSS and PostCSS Dependencies |
|
DESCRIPTION: Installs Tailwind CSS, its PostCSS plugin (`@tailwindcss/postcss`), PostCSS itself, and the `postcss-loader` for Webpack using npm. These packages are essential for processing Tailwind CSS with PostCSS. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/emberjs |
|
|
|
LANGUAGE: Shell |
|
CODE: |
|
``` |
|
npm install tailwindcss @tailwindcss/postcss postcss postcss-loader |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Start Qwik development server |
|
DESCRIPTION: Initiates the development server for the Qwik project, allowing real-time preview and development with Tailwind CSS enabled. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/qwik |
|
|
|
LANGUAGE: bash |
|
CODE: |
|
``` |
|
npm run dev |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Create a New Ember.js Project |
|
DESCRIPTION: Initializes a new Ember.js application using Ember CLI, with Embroider enabled and the welcome page disabled. This command sets up the basic project structure and navigates into the new project directory. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/emberjs |
|
|
|
LANGUAGE: Shell |
|
CODE: |
|
``` |
|
npx ember-cli new my-project --embroider --no-welcome |
|
cd my-project |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Create a New SvelteKit Project |
|
DESCRIPTION: Initial command to create a new SvelteKit project using `npx sv create` and navigate into the newly created project directory. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/sveltekit |
|
|
|
LANGUAGE: Shell |
|
CODE: |
|
``` |
|
npx sv create my-project |
|
cd my-project |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Create Rspack Project |
|
DESCRIPTION: Initializes a new Rspack project using the Rspack CLI, setting up the basic project structure. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/rspack/react |
|
|
|
LANGUAGE: shell |
|
CODE: |
|
``` |
|
npm create rspack@latest |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Create a New Nuxt.js Project |
|
DESCRIPTION: Initializes a new Nuxt.js project using the Nuxt Command Line Interface (CLI) and navigates into the newly created project directory. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/nuxt |
|
|
|
LANGUAGE: Terminal |
|
CODE: |
|
``` |
|
npx nuxi init my-project |
|
cd my-project |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Start Development Server |
|
DESCRIPTION: This command initiates the development server for your Vite project. It typically watches for file changes, recompiles assets, and serves your application locally, allowing for live development and testing. |
|
|
|
SOURCE: https://tailwindcss.com/docs/index |
|
|
|
LANGUAGE: Terminal |
|
CODE: |
|
``` |
|
npm run dev |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Create a new Parcel project and initialize npm |
|
DESCRIPTION: This command sequence sets up a new directory for your project, navigates into it, initializes a Node.js project with default settings, installs Parcel as a development dependency, creates a source directory, and an initial HTML file. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/parcel |
|
|
|
LANGUAGE: bash |
|
CODE: |
|
``` |
|
mkdir my-project |
|
cd my-project |
|
npm init -y |
|
npm install parcel |
|
mkdir src |
|
touch src/index.html |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Start the Parcel development server |
|
DESCRIPTION: This command initiates Parcel's development server, which bundles your project's assets, including the HTML, CSS (with Tailwind processed by PostCSS), and JavaScript. It serves the application and provides live reloading during development. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/parcel |
|
|
|
LANGUAGE: bash |
|
CODE: |
|
``` |
|
npx parcel src/index.html |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Tailwind CSS Core Concepts and Setup |
|
DESCRIPTION: This section outlines fundamental concepts and initial setup procedures for Tailwind CSS. It covers installation, editor configuration, compatibility, and upgrade guidelines, along with core styling principles like utility classes, responsive design, and dark mode. |
|
|
|
SOURCE: https://tailwindcss.com/docs/scroll-snap-stop |
|
|
|
LANGUAGE: APIDOC |
|
CODE: |
|
``` |
|
Getting started: |
|
- Installation: /docs/installation |
|
- Editor setup: /docs/editor-setup |
|
- Compatibility: /docs/compatibility |
|
- Upgrade guide: /docs/upgrade-guide |
|
|
|
Core concepts: |
|
- Styling with utility classes: /docs/styling-with-utility-classes |
|
- Hover, focus, and other states: /docs/hover-focus-and-other-states |
|
- Responsive design: /docs/responsive-design |
|
- Dark mode: /docs/dark-mode |
|
- Theme variables: /docs/theme |
|
- Colors: /docs/colors |
|
- Adding custom styles: /docs/adding-custom-styles |
|
- Detecting classes in source files: /docs/detecting-classes-in-source-files |
|
- Functions and directives: /docs/functions-and-directives |
|
|
|
Base styles: |
|
- Preflight: /docs/preflight |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Tailwind CSS Core Concepts and Setup |
|
DESCRIPTION: This section outlines the foundational aspects of using Tailwind CSS, including installation, editor configuration, compatibility, and fundamental styling principles like utility classes, responsive design, and dark mode. |
|
|
|
SOURCE: https://tailwindcss.com/docs/justify-items |
|
|
|
LANGUAGE: APIDOC |
|
CODE: |
|
``` |
|
Installation: /docs/installation |
|
Editor setup: /docs/editor-setup |
|
Compatibility: /docs/compatibility |
|
Upgrade guide: /docs/upgrade-guide |
|
Styling with utility classes: /docs/styling-with-utility-classes |
|
Hover, focus, and other states: /docs/hover-focus-and-other-states |
|
Responsive design: /docs/responsive-design |
|
Dark mode: /docs/dark-mode |
|
Theme variables: /docs/theme |
|
Colors: /docs/colors |
|
Adding custom styles: /docs/adding-custom-styles |
|
Detecting classes in source files: /docs/detecting-classes-in-source-files |
|
Functions and directives: /docs/functions-and-directives |
|
Base styles (Preflight): /docs/preflight |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Start Tailwind CSS Build Process |
|
DESCRIPTION: Initiates the development server and the Tailwind CSS build process, which watches for changes in source files and compiles the CSS. This command is essential for real-time styling updates during development. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/ruby-on-rails |
|
|
|
LANGUAGE: Ruby |
|
CODE: |
|
``` |
|
./bin/dev |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Create a new Phoenix project |
|
DESCRIPTION: Initializes a new Phoenix project and navigates into its directory. This is the first step before integrating Tailwind CSS. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/phoenix |
|
|
|
LANGUAGE: Shell |
|
CODE: |
|
``` |
|
mix phx.new myproject |
|
cd myproject |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Create a new Qwik project |
|
DESCRIPTION: Initializes a new Qwik application using the `create qwik` CLI command, setting up an empty project structure and navigating into the new project directory. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/qwik |
|
|
|
LANGUAGE: bash |
|
CODE: |
|
``` |
|
npm create qwik@latest empty my-project |
|
cd my-project |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Apply Tailwind CSS Classes in Handlebars Template |
|
DESCRIPTION: This example shows how to integrate Tailwind CSS utility classes directly into an Ember.js Handlebars template. It applies `text-3xl`, `font-bold`, and `underline` classes to an `<h1>` element, demonstrating basic styling with Tailwind CSS. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/emberjs |
|
|
|
LANGUAGE: HTML |
|
CODE: |
|
``` |
|
{{page-title "MyProject"}}<h1 class="text-3xl font-bold underline"> Hello world!</h1>{{outlet}} |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Create a New Vite Project |
|
DESCRIPTION: This command initializes a new Vite project using the `create-vite` tool. It sets up the basic project structure and dependencies, preparing it for further development. The `cd` command then navigates into the newly created project directory. |
|
|
|
SOURCE: https://tailwindcss.com/docs/index |
|
|
|
LANGUAGE: Terminal |
|
CODE: |
|
``` |
|
npm create vite@latest my-project |
|
cd my-project |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Tailwind CSS @starting-style Variant |
|
DESCRIPTION: This example uses the `starting` variant to define the initial appearance of an element when it is first rendered or transitions from `display: none` to visible. Specifically, `starting:open:opacity-0` sets the initial opacity to 0 for a popover when it opens, allowing for smooth transition effects. |
|
|
|
SOURCE: https://tailwindcss.com/docs/hover-focus-and-other-states |
|
|
|
LANGUAGE: HTML |
|
CODE: |
|
``` |
|
<div> |
|
<button popovertarget="my-popover">Check for updates</button> |
|
<div popover id="my-popover" class="opacity-0 starting:open:opacity-0 ..."> |
|
<!-- ... --> |
|
</div> |
|
</div> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Start Development Server |
|
DESCRIPTION: This command initiates the development server for the project, allowing you to preview your application in a browser and benefit from features like hot module reloading during development. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/react-router |
|
|
|
LANGUAGE: Terminal |
|
CODE: |
|
``` |
|
npm run dev |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Create a new Meteor project |
|
DESCRIPTION: Initializes a new Meteor project using the Meteor CLI and navigates into the newly created project directory. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/meteor |
|
|
|
LANGUAGE: bash |
|
CODE: |
|
``` |
|
npx meteor create my-project |
|
cd my-project |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Create React Router Project |
|
DESCRIPTION: This command initializes a new React Router project using `create-react-router` and then navigates into the newly created project directory, preparing it for further setup. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/react-router |
|
|
|
LANGUAGE: Terminal |
|
CODE: |
|
``` |
|
npx create-react-router@latest my-project |
|
cd my-project |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Start Development Server |
|
DESCRIPTION: Initiates the development server for the SolidJS project. This command compiles the application and serves it, allowing developers to see changes in real-time. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/solidjs |
|
|
|
LANGUAGE: Bash |
|
CODE: |
|
``` |
|
npm run dev |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Install Tailwind CSS and Vite Plugin |
|
DESCRIPTION: This command installs the core `tailwindcss` package and the `@tailwindcss/vite` plugin, which provides seamless integration with Vite. These packages are added as development dependencies to your project. |
|
|
|
SOURCE: https://tailwindcss.com/docs/index |
|
|
|
LANGUAGE: Terminal |
|
CODE: |
|
``` |
|
npm install tailwindcss @tailwindcss/vite |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Tailwind CSS Flexbox `flex-initial` Example |
|
DESCRIPTION: Illustrates the `flex-initial` utility, which allows a flex item to shrink but not grow, respecting its initial size. This setup shows how items maintain their base width while adapting to available space. |
|
|
|
SOURCE: https://tailwindcss.com/docs/flex |
|
|
|
LANGUAGE: HTML |
|
CODE: |
|
``` |
|
<div class="flex"> <div class="w-14 flex-none ...">01</div> <div class="w-64 flex-initial ...">02</div> <div class="w-32 flex-initial ...">03</div></div> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Tailwind CSS justify-items-start Example |
|
DESCRIPTION: Demonstrates the use of the `justify-items-start` utility class to align grid items to the start of their inline axis within a grid container. |
|
|
|
SOURCE: https://tailwindcss.com/docs/justify-items |
|
|
|
LANGUAGE: html |
|
CODE: |
|
``` |
|
<div class="grid justify-items-start ..."> |
|
<div>01</div> |
|
<div>02</div> |
|
<div>03</div> |
|
<div>04</div> |
|
<div>05</div> |
|
<div>06</div> |
|
</div> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Basic HTML Structure with Tailwind CSS Integration |
|
DESCRIPTION: This HTML snippet shows a minimal web page structure that integrates the compiled Tailwind CSS output. It includes viewport meta tags and a simple heading styled with Tailwind's utility classes. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/tailwind-cli |
|
|
|
LANGUAGE: HTML |
|
CODE: |
|
``` |
|
<!doctype html><html><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link href="./output.css" rel="stylesheet"></head><body> <h1 class="text-3xl font-bold underline"> Hello world! </h1></body></html> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Align Flex Items to Start with Tailwind CSS |
|
DESCRIPTION: Illustrates how to use the `items-start` utility class to align flex items to the beginning of the container's cross axis. |
|
|
|
SOURCE: https://tailwindcss.com/docs/align-items |
|
|
|
LANGUAGE: html |
|
CODE: |
|
``` |
|
<div class="flex items-start ..."> |
|
<div class="py-4">01</div> |
|
<div class="py-12">02</div> |
|
<div class="py-8">03</div> |
|
</div> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Use Tailwind CSS in Svelte Component with PostCSS |
|
DESCRIPTION: Example Svelte component (`+page.svelte`) demonstrating the use of Tailwind's utility classes for styling and how to integrate PostCSS for theme-based styling within `<style>` blocks. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/sveltekit |
|
|
|
LANGUAGE: HTML |
|
CODE: |
|
``` |
|
<h1 class="text-3xl font-bold underline"> |
|
Hello world! |
|
</h1> |
|
<style lang="postcss"> |
|
@reference "tailwindcss"; |
|
:global(html) { |
|
background-color: theme(--color-gray-100); |
|
} |
|
</style> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Integrate Tailwind CSS into HTML |
|
DESCRIPTION: This HTML snippet demonstrates the basic structure required to use Tailwind CSS. It shows how to link a compiled Tailwind CSS stylesheet (e.g., '/src/style.css') in the `<head>` section and apply utility classes (like 'text-3xl font-bold underline') directly to an `<h1>` element to style it. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation |
|
|
|
LANGUAGE: HTML |
|
CODE: |
|
``` |
|
<!doctype html><html><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link href="/src/style.css" rel="stylesheet"></head><body> <h1 class="text-3xl font-bold underline"> Hello world! </h1></body></html> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Install Tailwind CSS and Vite plugin |
|
DESCRIPTION: Installs the core Tailwind CSS package and the `@tailwindcss/vite` plugin, along with their peer dependencies, into the Qwik project using npm. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/qwik |
|
|
|
LANGUAGE: bash |
|
CODE: |
|
``` |
|
npm install tailwindcss @tailwindcss/vite |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Create New Ruby on Rails Project |
|
DESCRIPTION: Initializes a new Ruby on Rails application with the specified project name and then navigates into the newly created project directory. This is the foundational step before integrating Tailwind CSS. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/ruby-on-rails |
|
|
|
LANGUAGE: Ruby |
|
CODE: |
|
``` |
|
rails new my-project |
|
cd my-project |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Install Tailwind CSS standalone CLI |
|
DESCRIPTION: Executes the Phoenix mix command to download and install the standalone Tailwind CSS command-line interface, which is required for building CSS. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/phoenix |
|
|
|
LANGUAGE: Shell |
|
CODE: |
|
``` |
|
mix tailwind.install |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Create a New Rspack Project |
|
DESCRIPTION: Initializes a new Rspack project using the Rspack CLI. This command sets up the basic project structure, allowing you to integrate Tailwind CSS. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/rspack/vue |
|
|
|
LANGUAGE: Terminal |
|
CODE: |
|
``` |
|
npm create rspack@latest |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Create a new Symfony web application project |
|
DESCRIPTION: Initializes a new Symfony web application project using the Symfony Installer and navigates into the newly created project directory. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/symfony |
|
|
|
LANGUAGE: Shell |
|
CODE: |
|
``` |
|
symfony new --webapp my-project |
|
cd my-project |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Integrate Tailwind CSS in a Twig HTML Template |
|
DESCRIPTION: This snippet illustrates a foundational HTML5 document structure within a Twig template, demonstrating the inclusion of compiled CSS (likely via Webpack Encore) and the direct application of Tailwind CSS utility classes to an `<h1>` element for basic styling. It serves as a minimal example to get started with Tailwind in a templated environment. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/symfony |
|
|
|
LANGUAGE: HTML |
|
CODE: |
|
``` |
|
<!doctype html><html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> {% block stylesheets %} {{ encore_entry_link_tags('app') }} {% endblock %} </head> <body> <h1 class="text-3xl font-bold underline"> Hello world! </h1> </body></html> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Start Next.js Development Server |
|
DESCRIPTION: This command initiates the development server for the Next.js application. Running this command allows you to view your application in a web browser and enables hot-reloading for development. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/nextjs |
|
|
|
LANGUAGE: bash |
|
CODE: |
|
``` |
|
npm run dev |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Start Astro development server |
|
DESCRIPTION: Executes the `npm run dev` command to start the Astro development server. This compiles the project, watches for changes, and serves the application locally for development and testing. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/astro |
|
|
|
LANGUAGE: Terminal |
|
CODE: |
|
``` |
|
npm run dev |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Import Tailwind CSS into Application Stylesheet |
|
DESCRIPTION: CSS content for `src/app.css` to import the Tailwind CSS base styles, components, and utilities into the project's main stylesheet. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/sveltekit |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
@import "tailwindcss"; |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Install Tailwind CSS and PostCSS Dependencies |
|
DESCRIPTION: Installs Tailwind CSS, its PostCSS plugin, PostCSS itself, and the PostCSS loader as project dependencies required for integrating Tailwind CSS into a Rspack build. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/rspack/react |
|
|
|
LANGUAGE: shell |
|
CODE: |
|
``` |
|
npm install tailwindcss @tailwindcss/postcss postcss postcss-loader |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Import Tailwind CSS into Main Stylesheet |
|
DESCRIPTION: This CSS `@import` rule includes the Tailwind CSS framework into your project's main stylesheet, making its utility classes available for use. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/using-postcss |
|
|
|
LANGUAGE: css |
|
CODE: |
|
``` |
|
@import "tailwindcss"; |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Start the development build process with npm |
|
DESCRIPTION: Executes the `npm run watch` command, which typically starts a development server and continuously monitors source files for changes, automatically recompiling assets as needed. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/symfony |
|
|
|
LANGUAGE: Shell |
|
CODE: |
|
``` |
|
npm run watch |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Tailwind CSS Responsive Flex Direction Example |
|
DESCRIPTION: Demonstrates how to apply `flex-direction` utilities responsively using breakpoint variants. The example shows changing from a column layout to a row layout at medium screen sizes and above. |
|
|
|
SOURCE: https://tailwindcss.com/docs/flex-direction |
|
|
|
LANGUAGE: HTML |
|
CODE: |
|
``` |
|
<div class="flex flex-col md:flex-row ..."> <!-- ... --></div> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Configure Tailwind CSS Vite Plugin in SvelteKit |
|
DESCRIPTION: Configuration for `vite.config.ts` to integrate the `@tailwindcss/vite` plugin with SvelteKit's Vite setup, enabling Tailwind CSS processing during development and build. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/sveltekit |
|
|
|
LANGUAGE: TypeScript |
|
CODE: |
|
``` |
|
import { sveltekit } from '@sveltejs/kit/vite'; |
|
import { defineConfig } from 'vite'; |
|
import tailwindcss from '@tailwindcss/vite'; |
|
|
|
export default defineConfig({ |
|
plugins: [ |
|
tailwindcss(), |
|
sveltekit(), |
|
], |
|
}); |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Install Tailwind CSS and PostCSS integration |
|
DESCRIPTION: This command installs the core `tailwindcss` package along with `@tailwindcss/postcss`, which is necessary for integrating Tailwind CSS into a PostCSS build process, typically used with bundlers like Parcel. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/parcel |
|
|
|
LANGUAGE: bash |
|
CODE: |
|
``` |
|
npm install tailwindcss @tailwindcss/postcss |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Install Tailwind CSS and PostCSS via npm |
|
DESCRIPTION: This command installs Tailwind CSS along with its PostCSS plugin and PostCSS itself as development dependencies, which are essential for processing Tailwind's utility classes. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/laravel/mix |
|
|
|
LANGUAGE: bash |
|
CODE: |
|
``` |
|
npm install tailwindcss @tailwindcss/postcss postcss |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Update Tailwind CLI Commands for v4 |
|
DESCRIPTION: This example illustrates the necessary change when using the Tailwind CLI in v4. The CLI functionality has moved from the main `tailwindcss` package to a dedicated `@tailwindcss/cli` package, requiring an update to any build commands that invoke the CLI. |
|
|
|
SOURCE: https://tailwindcss.com/docs/upgrade-guide |
|
|
|
LANGUAGE: Terminal |
|
CODE: |
|
``` |
|
npx tailwindcss -i input.css -o output.css |
|
npx @tailwindcss/cli -i input.css -o output.css |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: HTML Example for Tailwind CSS transition-behavior Utility |
|
DESCRIPTION: Demonstrates the use of `transition-normal` and `transition-discrete` utilities in HTML. This example shows how `transition-discrete` allows properties like `display: hidden` to `display: block` to transition smoothly, while `transition-normal` results in an immediate change. |
|
|
|
SOURCE: https://tailwindcss.com/docs/transition-behavior |
|
|
|
LANGUAGE: HTML |
|
CODE: |
|
``` |
|
<label class="peer ..."> <input type="checkbox" checked /></label><button class="hidden transition-all not-peer-has-checked:opacity-0 peer-has-checked:block ..."> I hide</button><label class="peer ..."> <input type="checkbox" checked /></label><button class="hidden transition-all transition-discrete not-peer-has-checked:opacity-0 peer-has-checked:block ..."> I fade out</button> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Create a New SolidJS Project |
|
DESCRIPTION: Initializes a new SolidJS project using the official Vite template. This command sets up the basic project structure and navigates into the new directory. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/solidjs |
|
|
|
LANGUAGE: Bash |
|
CODE: |
|
``` |
|
npx degit solidjs/templates/js my-project |
|
cd my-project |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Tailwind CSS justify-self-center-safe Example |
|
DESCRIPTION: Demonstrates the `justify-self-center-safe` utility, which aligns a grid item to the center, but falls back to the start if there isn't enough space. |
|
|
|
SOURCE: https://tailwindcss.com/docs/justify-self |
|
|
|
LANGUAGE: HTML |
|
CODE: |
|
``` |
|
<div class="grid justify-items-stretch ..."> <!-- ... --> <div class="justify-self-center-safe ...">02</div> <!-- ... --></div> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Set Border Start Color to Indigo 700 |
|
DESCRIPTION: Applies the Tailwind CSS utility class `border-s-indigo-700` to set the inline start border color to a darker indigo shade (indigo-700). This class compiles to the `border-inline-start-color` CSS property, using a CSS variable for the color value. |
|
|
|
SOURCE: https://tailwindcss.com/docs/border-color |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-indigo-700 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-indigo-700); /* oklch(45.7% 0.24 277.023) */ |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Create a new Gatsby project |
|
DESCRIPTION: Initializes a new Gatsby project using the Gatsby CLI and navigates into the project directory. This is the foundational step before installing any dependencies or configuring build tools. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/gatsby |
|
|
|
LANGUAGE: bash |
|
CODE: |
|
``` |
|
gatsby new my-project |
|
cd my-project |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: HTML Example for mix-blend-mode Utilities |
|
DESCRIPTION: Demonstrates the usage of `mix-blend-overlay` and `mix-blend-soft-light` utility classes within an HTML structure to blend elements, specifically showing two divs with different background colors and `mix-blend-multiply` applied. |
|
|
|
SOURCE: https://tailwindcss.com/docs/mix-blend-mode |
|
|
|
LANGUAGE: HTML |
|
CODE: |
|
``` |
|
<div class="flex justify-center -space-x-14"> <div class="bg-blue-500 mix-blend-multiply ..."></div> <div class="bg-pink-500 mix-blend-multiply ..."></div></div> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Install Tailwind CSS Gems in Rails |
|
DESCRIPTION: Adds the necessary `tailwindcss-ruby` and `tailwindcss-rails` gems to the Ruby on Rails project's Gemfile, followed by executing the Tailwind CSS installation command to set up configuration files and dependencies. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/ruby-on-rails |
|
|
|
LANGUAGE: Ruby |
|
CODE: |
|
``` |
|
./bin/bundle add tailwindcss-ruby |
|
./bin/bundle add tailwindcss-rails |
|
./bin/rails tailwindcss:install |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Tailwind CSS justify-self-start Example |
|
DESCRIPTION: Illustrates how to use the `justify-self-start` utility to align a grid item to the beginning of its inline axis. |
|
|
|
SOURCE: https://tailwindcss.com/docs/justify-self |
|
|
|
LANGUAGE: HTML |
|
CODE: |
|
``` |
|
<div class="grid justify-items-stretch ..."> <!-- ... --> <div class="justify-self-start ...">02</div> <!-- ... --></div> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Set Border Start Color to Violet 500 |
|
DESCRIPTION: Applies the Tailwind CSS utility class `border-s-violet-500` to set the inline start border color to a standard violet shade (violet-500). This class compiles to the `border-inline-start-color` CSS property, using a CSS variable for the color value. |
|
|
|
SOURCE: https://tailwindcss.com/docs/border-color |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-violet-500 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-violet-500); /* oklch(60.6% 0.25 292.717) */ |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Set Border Start Color to Violet 800 |
|
DESCRIPTION: Applies the Tailwind CSS utility class `border-s-violet-800` to set the inline start border color to a very dark violet shade (violet-800). This class compiles to the `border-inline-start-color` CSS property, using a CSS variable for the color value. |
|
|
|
SOURCE: https://tailwindcss.com/docs/border-color |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-violet-800 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-violet-800); /* oklch(43.2% 0.232 292.759) */ |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Combine Theme, Bare, and Arbitrary Values in Tailwind CSS Utilities |
|
DESCRIPTION: These CSS snippets illustrate how to combine theme-based, bare, and arbitrary values within a single Tailwind CSS utility definition. Multiple `--value()` declarations are used, and any declarations that fail to resolve will be omitted, allowing flexible value resolution. The first example shows `tab-size` with theme, bare integer, and arbitrary integer values. The second example shows `opacity` with arbitrary percentage, bare integer (converted to percentage), and theme-based values. |
|
|
|
SOURCE: https://tailwindcss.com/docs/adding-custom-styles |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
@theme { --tab-size-github: 8;}@utility tab-* { tab-size: --value([integer]); tab-size: --value(integer); tab-size: --value(--tab-size-*);} |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
@utility opacity-* { opacity: --value([percentage]); opacity: calc(--value(integer) * 1%); opacity: --value(--opacity-*);} |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Set Border Start Color to Purple 500 |
|
DESCRIPTION: Applies the Tailwind CSS utility class `border-s-purple-500` to set the inline start border color to a standard purple shade (purple-500). This class compiles to the `border-inline-start-color` CSS property, using a CSS variable for the color value. |
|
|
|
SOURCE: https://tailwindcss.com/docs/border-color |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-purple-500 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-purple-500); /* oklch(62.7% 0.265 303.9) */ |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Install Tailwind CSS and Vite Plugin |
|
DESCRIPTION: This command installs Tailwind CSS and its official Vite plugin (`@tailwindcss/vite`) along with their necessary peer dependencies using npm, enabling Tailwind CSS integration in a Vite-based project. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/react-router |
|
|
|
LANGUAGE: Terminal |
|
CODE: |
|
``` |
|
npm install tailwindcss @tailwindcss/vite |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: HTML Examples for Tailwind CSS Backdrop Brightness Utilities |
|
DESCRIPTION: Provides HTML code examples demonstrating the application of Tailwind CSS `backdrop-brightness` utility classes. These examples show how to use predefined numeric values and custom arbitrary values to control the backdrop brightness of elements. |
|
|
|
SOURCE: https://tailwindcss.com/docs/backdrop-filter-brightness |
|
|
|
LANGUAGE: HTML |
|
CODE: |
|
``` |
|
<div class="bg-[url(/img/mountains.jpg)]"> |
|
<div class="bg-white/30 backdrop-brightness-50 ..."></div> |
|
</div> |
|
<div class="bg-[url(/img/mountains.jpg)]"> |
|
<div class="bg-white/30 backdrop-brightness-150 ..."></div> |
|
</div> |
|
``` |
|
|
|
LANGUAGE: HTML |
|
CODE: |
|
``` |
|
<div class="backdrop-brightness-[1.75] ..."> |
|
<!-- ... --> |
|
</div> |
|
``` |
|
|
|
LANGUAGE: HTML |
|
CODE: |
|
``` |
|
<div class="backdrop-brightness-(--my-backdrop-brightness) ..."> |
|
<!-- ... --> |
|
</div> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Set Border Start Color to Purple 800 |
|
DESCRIPTION: Applies the Tailwind CSS utility class `border-s-purple-800` to set the inline start border color to a very dark purple shade (purple-800). This class compiles to the `border-inline-start-color` CSS property, using a CSS variable for the color value. |
|
|
|
SOURCE: https://tailwindcss.com/docs/border-color |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-purple-800 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-purple-800); /* oklch(43.8% 0.218 303.724) */ |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Set Border Start Color to Blue 900 |
|
DESCRIPTION: Applies the Tailwind CSS utility class `border-s-blue-900` to set the inline start border color to a deep blue shade (blue-900). This class compiles to the `border-inline-start-color` CSS property, using a CSS variable for the color value. |
|
|
|
SOURCE: https://tailwindcss.com/docs/border-color |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-blue-900 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-blue-900); /* oklch(37.9% 0.146 265.522) */ |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Tailwind CSS Flexbox Basic Example |
|
DESCRIPTION: Demonstrates the use of `flex-1` to allow flex items to grow and shrink, ignoring their initial size. This example shows three flex items within a flex container, with one item having a fixed width and the other two distributing available space. |
|
|
|
SOURCE: https://tailwindcss.com/docs/flex |
|
|
|
LANGUAGE: HTML |
|
CODE: |
|
``` |
|
<div class="flex"> <div class="w-14 flex-none ...">01</div> <div class="w-64 flex-1 ...">02</div> <div class="w-32 flex-1 ...">03</div></div> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Set Border Start Color to Indigo 900 |
|
DESCRIPTION: Applies the Tailwind CSS utility class `border-s-indigo-900` to set the inline start border color to a deep indigo shade (indigo-900). This class compiles to the `border-inline-start-color` CSS property, using a CSS variable for the color value. |
|
|
|
SOURCE: https://tailwindcss.com/docs/border-color |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-indigo-900 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-indigo-900); /* oklch(35.9% 0.144 278.697) */ |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Tailwind CSS Border Inline Start Color Utilities |
|
DESCRIPTION: These snippets demonstrate the Tailwind CSS utility classes for applying specific color shades to the `border-inline-start-color` property. Each utility class directly translates to a CSS rule setting the border's start color using a CSS variable, often with an `oklch` color function comment for reference. |
|
|
|
SOURCE: https://tailwindcss.com/docs/border-color |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-emerald-800 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-emerald-800); /* oklch(43.2% 0.095 166.913) */ |
|
``` |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-emerald-900 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-emerald-900); /* oklch(37.8% 0.077 168.94) */ |
|
``` |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-emerald-950 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-emerald-950); /* oklch(26.2% 0.051 172.552) */ |
|
``` |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-teal-50 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-teal-50); /* oklch(98.4% 0.014 180.72) */ |
|
``` |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-teal-100 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-teal-100); /* oklch(95.3% 0.051 180.801) */ |
|
``` |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-teal-200 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-teal-200); /* oklch(91% 0.096 180.426) */ |
|
``` |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-teal-300 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-teal-300); /* oklch(85.5% 0.138 181.071) */ |
|
``` |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-teal-400 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-teal-400); /* oklch(77.7% 0.152 181.912) */ |
|
``` |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-teal-500 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-teal-500); /* oklch(70.4% 0.14 182.503) */ |
|
``` |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-teal-600 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-teal-600); /* oklch(60% 0.118 184.704) */ |
|
``` |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-teal-700 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-teal-700); /* oklch(51.1% 0.096 186.391) */ |
|
``` |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-teal-800 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-teal-800); /* oklch(43.7% 0.078 188.216) */ |
|
``` |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-teal-900 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-teal-900); /* oklch(38.6% 0.063 188.416) */ |
|
``` |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-teal-950 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-teal-950); /* oklch(27.7% 0.046 192.524) */ |
|
``` |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-cyan-50 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-cyan-50); /* oklch(98.4% 0.019 200.873) */ |
|
``` |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-cyan-100 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-cyan-100); /* oklch(95.6% 0.045 203.388) */ |
|
``` |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-cyan-200 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-cyan-200); /* oklch(91.7% 0.08 205.041) */ |
|
``` |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-cyan-300 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-cyan-300); /* oklch(86.5% 0.127 207.078) */ |
|
``` |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-cyan-400 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-cyan-400); /* oklch(78.9% 0.154 211.53) */ |
|
``` |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-cyan-500 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-cyan-500); /* oklch(71.5% 0.143 215.221) */ |
|
``` |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-cyan-600 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-cyan-600); /* oklch(60.9% 0.126 221.723) */ |
|
``` |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-cyan-700 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-cyan-700); /* oklch(52% 0.105 223.128) */ |
|
``` |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-cyan-800 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-cyan-800); /* oklch(45% 0.085 224.283) */ |
|
``` |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-cyan-900 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-cyan-900); /* oklch(39.8% 0.07 227.392) */ |
|
``` |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-cyan-950 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-cyan-950); /* oklch(30.2% 0.056 229.695) */ |
|
``` |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-sky-50 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-sky-50); /* oklch(97.7% 0.013 236.62) */ |
|
``` |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-sky-100 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-sky-100); /* oklch(95.1% 0.026 236.824) */ |
|
``` |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-sky-200 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-sky-200); /* oklch(90.1% 0.058 230.902) */ |
|
``` |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-sky-300 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-sky-300); /* oklch(82.8% 0.111 230.318) */ |
|
``` |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-sky-400 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-sky-400); /* oklch(74.6% 0.16 232.661) */ |
|
``` |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-sky-500 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-sky-500); /* oklch(68.5% 0.169 237.323) */ |
|
``` |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-sky-600 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-sky-600); /* oklch(58.8% 0.158 241.966) */ |
|
``` |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-sky-700 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-sky-700); /* oklch(50% 0.134 242.749) */ |
|
``` |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-sky-800 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-sky-800); /* oklch(44.3% 0.11 240.79) */ |
|
``` |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-sky-900 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-sky-900); /* oklch(39.1% 0.09 240.876) */ |
|
``` |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-sky-950 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-sky-950); /* oklch(29.3% 0.066 243.157) */ |
|
``` |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-blue-50 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-blue-50); /* oklch(97% 0.014 254.604) */ |
|
``` |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-blue-100 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-blue-100); /* oklch(93.2% 0.032 255.585) */ |
|
``` |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-blue-200 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-blue-200); /* oklch(88.2% 0.059 254.128) */ |
|
``` |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-blue-300 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-blue-300); /* oklch(80.9% 0.105 251.813) */ |
|
``` |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-blue-400 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-blue-400); /* oklch(70.7% 0.165 254.624) */ |
|
``` |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-blue-500 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-blue-500); /* oklch(62.3% 0.214 259.815) */ |
|
``` |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-blue-600 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-blue-600); /* oklch(54.6% 0.245 262.881) */ |
|
``` |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-blue-700 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-blue-700); /* oklch(48.8% 0.243 264.376) */ |
|
``` |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-blue-800 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-blue-800); /* oklch(42.4% 0.199 265.638) */ |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Set Border Start Color to Indigo 300 |
|
DESCRIPTION: Applies the Tailwind CSS utility class `border-s-indigo-300` to set the inline start border color to a medium indigo shade (indigo-300). This class compiles to the `border-inline-start-color` CSS property, using a CSS variable for the color value. |
|
|
|
SOURCE: https://tailwindcss.com/docs/border-color |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-indigo-300 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-indigo-300); /* oklch(78.5% 0.115 274.713) */ |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Tailwind CSS Core Concepts and Base Styles |
|
DESCRIPTION: Documents fundamental aspects of using Tailwind CSS, including installation, editor setup, compatibility, upgrade guidance, and core styling principles like utility classes, responsive design, dark mode, and custom style integration. It also covers the Preflight base styles. |
|
|
|
SOURCE: https://tailwindcss.com/docs/list-style-type |
|
|
|
LANGUAGE: APIDOC |
|
CODE: |
|
``` |
|
### Getting started |
|
- Installation: Guide to setting up Tailwind CSS in a project. |
|
- Editor setup: Configuration for IDEs to enhance Tailwind development. |
|
- Compatibility: Information on browser and environment compatibility. |
|
- Upgrade guide: Steps to migrate between Tailwind CSS versions. |
|
|
|
### Core concepts |
|
- Styling with utility classes: Explains the utility-first approach. |
|
- Hover, focus, and other states: How to apply styles based on element states. |
|
- Responsive design: Techniques for building responsive layouts. |
|
- Dark mode: Implementing dark themes. |
|
- Theme variables: Customizing design tokens. |
|
- Colors: Working with Tailwind's color palette. |
|
- Adding custom styles: Extending Tailwind with custom CSS. |
|
- Detecting classes in source files: How Tailwind scans for utility classes. |
|
- Functions and directives: Using Tailwind's custom CSS functions and directives. |
|
|
|
### Base styles |
|
- Preflight: Tailwind's opinionated base styles for cross-browser consistency. |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Tailwind CSS Background Blend Mode HTML Example |
|
DESCRIPTION: Demonstrates the application of Tailwind CSS `background-blend-mode` utility classes within HTML elements. This example shows how to combine a background color, a background image, and different blend modes (`bg-blend-multiply`, `bg-blend-soft-light`, `bg-blend-overlay`) to achieve various visual effects. |
|
|
|
SOURCE: https://tailwindcss.com/docs/background-blend-mode |
|
|
|
LANGUAGE: HTML |
|
CODE: |
|
``` |
|
<div class="bg-blue-500 bg-[url(/img/mountains.jpg)] bg-blend-multiply ..."></div><div class="bg-blue-500 bg-[url(/img/mountains.jpg)] bg-blend-soft-light ..."></div><div class="bg-blue-500 bg-[url(/img/mountains.jpg)] bg-blend-overlay ..."></div> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Start Laravel Mix Build Process |
|
DESCRIPTION: This terminal command initiates the Laravel Mix build process, which compiles your assets (including Tailwind CSS) and watches for changes, automatically recompiling as you develop. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/laravel/mix |
|
|
|
LANGUAGE: bash |
|
CODE: |
|
``` |
|
npm run watch |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Integrate Tailwind CSS in AdonisJS Edge Template |
|
DESCRIPTION: Example `home.edge` template demonstrating how to include compiled CSS and JavaScript assets using `@vite` and apply Tailwind CSS utility classes to HTML elements for styling. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/adonisjs |
|
|
|
LANGUAGE: HTML |
|
CODE: |
|
``` |
|
<!doctype html> |
|
<html> |
|
<head> |
|
<meta charset="utf-8" /> |
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
|
@vite(['resources/css/app.css', 'resources/js/app.js']) |
|
</head> |
|
<body> |
|
<h1 class="text-3xl font-bold underline"> |
|
Hello world! |
|
</h1> |
|
</body> |
|
</html> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Configure Tailwind CSS Vite plugin |
|
DESCRIPTION: Adds the `@tailwindcss/vite` plugin to the Vite configuration file (`vite.config.ts`). This configuration step tells Vite to process Tailwind CSS during the build and development phases, ensuring utility classes are correctly generated. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation |
|
|
|
LANGUAGE: typescript |
|
CODE: |
|
``` |
|
import { defineConfig } from 'vite' |
|
import tailwindcss from '@tailwindcss/vite' |
|
|
|
export default defineConfig({ |
|
plugins: [ |
|
tailwindcss(), |
|
], |
|
}) |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Set Border Start Color to Violet 950 |
|
DESCRIPTION: Applies the Tailwind CSS utility class `border-s-violet-950` to set the inline start border color to a very deep violet shade (violet-950). This class compiles to the `border-inline-start-color` CSS property, using a CSS variable for the color value. |
|
|
|
SOURCE: https://tailwindcss.com/docs/border-color |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-violet-950 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-violet-950); /* oklch(28.3% 0.141 291.089) */ |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Set Border Start Color to Purple 700 |
|
DESCRIPTION: Applies the Tailwind CSS utility class `border-s-purple-700` to set the inline start border color to a darker purple shade (purple-700). This class compiles to the `border-inline-start-color` CSS property, using a CSS variable for the color value. |
|
|
|
SOURCE: https://tailwindcss.com/docs/border-color |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-purple-700 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-purple-700); /* oklch(49.6% 0.265 301.924) */ |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Install Tailwind CSS and PostCSS Dependencies |
|
DESCRIPTION: This command installs the necessary npm packages for integrating Tailwind CSS into a project. It includes `tailwindcss`, `@tailwindcss/postcss`, and `postcss` as peer dependencies required for processing Tailwind CSS. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/nextjs |
|
|
|
LANGUAGE: bash |
|
CODE: |
|
``` |
|
npm install tailwindcss @tailwindcss/postcss postcss |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Tailwind CSS Interactivity Utilities |
|
DESCRIPTION: This section provides Tailwind CSS utility classes for controlling user interaction with elements, including cursor styles, pointer events, resizing behavior, scroll snapping, and user selection. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/tailwind-cli |
|
|
|
LANGUAGE: APIDOC |
|
CODE: |
|
``` |
|
accent-color: Utilities for controlling the accent color of UI controls. |
|
appearance: Utilities for controlling the native appearance of UI controls. |
|
caret-color: Utilities for controlling the color of the text input cursor. |
|
color-scheme: Utilities for controlling the color scheme of an element. |
|
cursor: Utilities for controlling the cursor style when hovering over an element. |
|
field-sizing: Utilities for controlling the field sizing property. |
|
pointer-events: Utilities for controlling whether an element reacts to pointer events. |
|
resize: Utilities for controlling whether an element can be resized by the user. |
|
scroll-behavior: Utilities for controlling the scroll behavior of an element. |
|
scroll-margin: Utilities for controlling the scroll margin of an element. |
|
scroll-padding: Utilities for controlling the scroll padding of an element. |
|
scroll-snap-align: Utilities for controlling the scroll snap align property. |
|
scroll-snap-stop: Utilities for controlling the scroll snap stop property. |
|
scroll-snap-type: Utilities for controlling the scroll snap type property. |
|
touch-action: Utilities for controlling how an element's touch events are handled. |
|
user-select: Utilities for controlling whether the user can select text. |
|
will-change: Utilities for informing the browser about expected changes to an element. |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Set Border Start Color to Violet 600 |
|
DESCRIPTION: Applies the Tailwind CSS utility class `border-s-violet-600` to set the inline start border color to a dark violet shade (violet-600). This class compiles to the `border-inline-start-color` CSS property, using a CSS variable for the color value. |
|
|
|
SOURCE: https://tailwindcss.com/docs/border-color |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-violet-600 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-violet-600); /* oklch(54.1% 0.281 293.009) */ |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Tailwind CSS Core Properties Reference |
|
DESCRIPTION: This section provides a comprehensive reference for various Tailwind CSS utility classes and their corresponding CSS properties, categorized by functionality. It details properties related to visual effects, image filters, table styling, animation and transitions, 2D/3D transformations, user interactivity, SVG elements, and accessibility features. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/using-vite |
|
|
|
LANGUAGE: APIDOC |
|
CODE: |
|
``` |
|
Effects: |
|
- box-shadow: Controls the shadow effect around an element's frame. |
|
- text-shadow: Controls the shadow effect around text. |
|
- opacity: Sets the transparency level of an element. |
|
- mix-blend-mode: Describes how an element's content should blend with its background. |
|
- background-blend-mode: Describes how an element's background images should blend with each other and with the element's background color. |
|
- mask-clip: Specifies the area which is affected by the mask. |
|
- mask-composite: Represents the compositing operation used on the current mask layer with the mask layers below it. |
|
- mask-image: Sets the image that is used as a mask layer for an element. |
|
- mask-mode: Specifies whether the mask image is treated as a luminance mask or an alpha mask. |
|
- mask-origin: Specifies the origin of the mask image. |
|
- mask-position: Sets the initial position for each background image. |
|
- mask-repeat: Sets how mask images are repeated. |
|
- mask-size: Specifies the size of the mask images. |
|
- mask-type: Specifies whether a mask element is treated as a luminance mask or an alpha mask. |
|
|
|
Filters: |
|
- filter: Applies graphical effects like blur, brightness, contrast, drop-shadow, grayscale, hue-rotate, invert, saturate, and sepia to an element. |
|
- blur: Applies a Gaussian blur to the input image. |
|
- brightness: Applies a linear multiplier to the input image, making it brighter or darker. |
|
- contrast: Adjusts the contrast of the input image. |
|
- drop-shadow: Applies a drop shadow to the input image. |
|
- grayscale: Converts the input image to grayscale. |
|
- hue-rotate: Applies a hue rotation to the input image. |
|
- invert: Inverts the colors of the input image. |
|
- saturate: Saturates or desaturates the input image. |
|
- sepia: Converts the input image to sepia. |
|
- backdrop-filter: Applies graphical effects to the area behind an element. |
|
- blur: Applies a Gaussian blur to the backdrop. |
|
- brightness: Adjusts the brightness of the backdrop. |
|
- contrast: Adjusts the contrast of the backdrop. |
|
- grayscale: Converts the backdrop to grayscale. |
|
- hue-rotate: Applies a hue rotation to the backdrop. |
|
- invert: Inverts the colors of the backdrop. |
|
- opacity: Sets the transparency level of the backdrop. |
|
- saturate: Saturates or desaturates the backdrop. |
|
- sepia: Converts the backdrop to sepia. |
|
|
|
Tables: |
|
- border-collapse: Sets whether table borders are collapsed into a single border or separated. |
|
- border-spacing: Sets the distance between the borders of adjacent cells. |
|
- table-layout: Sets the algorithm used to lay out table cells, rows, and columns. |
|
- caption-side: Specifies the placement of a table caption. |
|
|
|
Transitions & Animation: |
|
- transition-property: Specifies the CSS properties to which a transition effect should be applied. |
|
- transition-behavior: Defines whether a transition should be skipped when the element is first rendered. |
|
- transition-duration: Specifies how many seconds or milliseconds a transition effect takes to complete. |
|
- transition-timing-function: Specifies the speed curve of the transition effect. |
|
- transition-delay: Specifies when the transition effect will start. |
|
- animation: A shorthand property for all the animation properties. |
|
|
|
Transforms: |
|
- backface-visibility: Defines whether or not the back face of an element is visible when facing the user. |
|
- perspective: Specifies the distance between the user and the z=0 plane, to give a 3D-positioned element some perspective. |
|
- perspective-origin: Sets the origin for the perspective property. |
|
- rotate: Rotates an element around a fixed point. |
|
- scale: Scales an element up or down. |
|
- skew: Skews an element along the X and Y axes. |
|
- transform: Applies a 2D or 3D transformation to an element. |
|
- transform-origin: Sets the origin for transformations of an element. |
|
- transform-style: Specifies how nested elements are rendered in 3D space. |
|
- translate: Moves an element from its current position. |
|
|
|
Interactivity: |
|
- accent-color: Sets the accent color for user-interface controls generated by the element. |
|
- appearance: Controls the native appearance of UI widgets. |
|
- caret-color: Sets the color of the caret (text input cursor). |
|
- color-scheme: Allows an element to indicate which color schemes it is comfortable with. |
|
- cursor: Specifies the type of cursor to be displayed when pointing over an element. |
|
- field-sizing: Controls the sizing of form fields. |
|
- pointer-events: Sets under what circumstances (if any) a graphic element can be the target of pointer events. |
|
- resize: Specifies whether an element is resizable by the user. |
|
- scroll-behavior: Specifies the scrolling behavior for a scrolling box, when scrolling happens due to navigation or CSS scroll-snap positioning. |
|
- scroll-margin: Sets the margin of the scroll snap area around the box. |
|
- scroll-padding: Sets the padding of the scroll snap area around the box. |
|
- scroll-snap-align: Specifies the snap position for an element within its scroll container. |
|
- scroll-snap-stop: Specifies whether the scroll container must snap to a snap point or can pass over it. |
|
- scroll-snap-type: Specifies how strictly snap points are enforced on the scroll container. |
|
- touch-action: Determines how a touch event (or series of events) can be handled by the browser. |
|
- user-select: Controls whether the user can select text. |
|
- will-change: Hints to browsers how an element is expected to change. |
|
|
|
SVG: |
|
- fill: Sets the color of the interior of an SVG shape. |
|
- stroke: Sets the color of the outline of an SVG shape. |
|
- stroke-width: Sets the width of the outline of an SVG shape. |
|
|
|
Accessibility: |
|
- forced-color-adjust: Controls whether the user agent can make adjustments to colors to improve readability in forced color modes. |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Create a new Astro project |
|
DESCRIPTION: Initializes a new Astro project using the `create astro` CLI tool and navigates into the newly created project directory, setting up the basic project structure. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/astro |
|
|
|
LANGUAGE: Terminal |
|
CODE: |
|
``` |
|
npm create astro@latest my-project |
|
cd my-project |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Set Border Start Color to Purple 200 |
|
DESCRIPTION: Applies the Tailwind CSS utility class `border-s-purple-200` to set the inline start border color to a light-medium purple shade (purple-200). This class compiles to the `border-inline-start-color` CSS property, using a CSS variable for the color value. |
|
|
|
SOURCE: https://tailwindcss.com/docs/border-color |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-purple-200 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-purple-200); /* oklch(90.2% 0.063 306.703) */ |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Set Border Start Color to Violet 700 |
|
DESCRIPTION: Applies the Tailwind CSS utility class `border-s-violet-700` to set the inline start border color to a darker violet shade (violet-700). This class compiles to the `border-inline-start-color` CSS property, using a CSS variable for the color value. |
|
|
|
SOURCE: https://tailwindcss.com/docs/border-color |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-violet-700 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-violet-700); /* oklch(49.1% 0.27 292.581) */ |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Start the Gatsby development server |
|
DESCRIPTION: Executes the `gatsby develop` command to start the local development server. This command compiles your Gatsby project, including Tailwind CSS, and provides a live-reloading environment for development. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/gatsby |
|
|
|
LANGUAGE: bash |
|
CODE: |
|
``` |
|
gatsby develop |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Set Border Start Color to Indigo 500 |
|
DESCRIPTION: Applies the Tailwind CSS utility class `border-s-indigo-500` to set the inline start border color to a standard indigo shade (indigo-500). This class compiles to the `border-inline-start-color` CSS property, using a CSS variable for the color value. |
|
|
|
SOURCE: https://tailwindcss.com/docs/border-color |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-indigo-500 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-indigo-500); /* oklch(58.5% 0.233 277.117) */ |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: HTML Example: Responsive Tailwind CSS transition-delay |
|
DESCRIPTION: Demonstrates applying responsive `transition-delay` utilities using breakpoint variants like `md:` to change the delay based on screen size. |
|
|
|
SOURCE: https://tailwindcss.com/docs/transition-delay |
|
|
|
LANGUAGE: HTML |
|
CODE: |
|
``` |
|
<button class="delay-150 md:delay-300 ..."> <!-- ... --></button> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Integrate Tailwind CSS utility classes in HTML |
|
DESCRIPTION: This HTML structure demonstrates how to link the compiled CSS file and apply Tailwind CSS utility classes directly to HTML elements. The example shows styling a heading with `text-3xl`, `font-bold`, and `underline` classes. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/parcel |
|
|
|
LANGUAGE: html |
|
CODE: |
|
``` |
|
<!doctype html><html> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <link href="./index.css" type="text/css" rel="stylesheet" /> </head> <body> <h1 class="text-3xl font-bold underline"> Hello world! </h1> </body></html> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Configure PostCSS Plugin for Tailwind CSS |
|
DESCRIPTION: This JavaScript configuration snippet for `postcss.config.mjs` adds the `@tailwindcss/postcss` plugin, enabling PostCSS to process Tailwind CSS directives. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/using-postcss |
|
|
|
LANGUAGE: javascript |
|
CODE: |
|
``` |
|
export default { |
|
plugins: { |
|
"@tailwindcss/postcss": {}, |
|
} |
|
} |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Apply Responsive place-self Utilities in Tailwind CSS |
|
DESCRIPTION: This HTML example illustrates how to apply `place-self` utilities responsively using Tailwind CSS breakpoint variants. By prefixing `place-self-end` with `md:`, the item will align to the start by default and then align to the end only on medium screen sizes and above, adapting its position based on the viewport. |
|
|
|
SOURCE: https://tailwindcss.com/docs/place-self |
|
|
|
LANGUAGE: html |
|
CODE: |
|
``` |
|
<div class="place-self-start md:place-self-end ..."> <!-- ... --></div> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Set Border Start Color to Purple 900 |
|
DESCRIPTION: Applies the Tailwind CSS utility class `border-s-purple-900` to set the inline start border color to a deep purple shade (purple-900). This class compiles to the `border-inline-start-color` CSS property, using a CSS variable for the color value. |
|
|
|
SOURCE: https://tailwindcss.com/docs/border-color |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
undefined |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Apply Basic Opacity to HTML Buttons |
|
DESCRIPTION: Demonstrates how to apply different levels of opacity to HTML button elements using Tailwind CSS `opacity-<number>` utility classes. |
|
|
|
SOURCE: https://tailwindcss.com/docs/opacity |
|
|
|
LANGUAGE: HTML |
|
CODE: |
|
``` |
|
<button class="bg-indigo-500 opacity-100 ..."></button><button class="bg-indigo-500 opacity-75 ..."></button><button class="bg-indigo-500 opacity-50 ..."></button><button class="bg-indigo-500 opacity-25 ..."></button> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Set Border Start Color to Violet 50 |
|
DESCRIPTION: Applies the Tailwind CSS utility class `border-s-violet-50` to set the inline start border color to a very light violet shade (violet-50). This class compiles to the `border-inline-start-color` CSS property, using a CSS variable for the color value. |
|
|
|
SOURCE: https://tailwindcss.com/docs/border-color |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-violet-50 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-violet-50); /* oklch(96.9% 0.016 293.756) */ |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Apply Responsive Tailwind CSS background-origin |
|
DESCRIPTION: Illustrates how to use responsive design with Tailwind CSS `background-origin` utilities by applying different origin styles based on screen size using breakpoint variants like `md:`. |
|
|
|
SOURCE: https://tailwindcss.com/docs/background-origin |
|
|
|
LANGUAGE: html |
|
CODE: |
|
``` |
|
<div class="bg-origin-border md:bg-origin-padding ..."> <!-- ... --></div> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Install Webpack Encore and related Symfony UX bundles |
|
DESCRIPTION: Removes existing Symfony UX bundles (turbo, asset-mapper, stimulus-bundle) and then installs Webpack Encore, along with symfony/ux-turbo and symfony/stimulus-bundle, to manage frontend assets in the Symfony project. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/symfony |
|
|
|
LANGUAGE: Shell |
|
CODE: |
|
``` |
|
composer remove symfony/ux-turbo symfony/asset-mapper symfony/stimulus-bundle |
|
composer require symfony/webpack-encore-bundle symfony/ux-turbo symfony/stimulus-bundle |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Set Border Start Color to Violet 900 |
|
DESCRIPTION: Applies the Tailwind CSS utility class `border-s-violet-900` to set the inline start border color to a deep violet shade (violet-900). This class compiles to the `border-inline-start-color` CSS property, using a CSS variable for the color value. |
|
|
|
SOURCE: https://tailwindcss.com/docs/border-color |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-violet-900 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-violet-900); /* oklch(38% 0.189 293.745) */ |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Import Tailwind CSS into main CSS file |
|
DESCRIPTION: Adds an `@import` rule to your main CSS file to include Tailwind CSS. This line pulls in all of Tailwind's base styles, components, and utilities, making them available for use in your project. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation |
|
|
|
LANGUAGE: css |
|
CODE: |
|
``` |
|
@import "tailwindcss"; |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Apply Responsive Background Images with Tailwind CSS |
|
DESCRIPTION: This example illustrates how to make background image utilities responsive by prefixing them with breakpoint variants like `md:`. This ensures that the utility is only applied at the specified screen size and above, enabling adaptive designs. |
|
|
|
SOURCE: https://tailwindcss.com/docs/background-image |
|
|
|
LANGUAGE: html |
|
CODE: |
|
``` |
|
<div class="from-purple-400 md:from-yellow-500 ..."> <!-- ... --></div> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: HTML Example for Responsive Tailwind CSS transition-behavior |
|
DESCRIPTION: Illustrates how to apply responsive `transition-behavior` utilities using breakpoint variants like `md:`. This allows developers to conditionally control transition behavior based on different screen sizes, applying `transition-normal` from medium screens and up. |
|
|
|
SOURCE: https://tailwindcss.com/docs/transition-behavior |
|
|
|
LANGUAGE: HTML |
|
CODE: |
|
``` |
|
<button class="transition-discrete md:transition-normal ..."> <!-- ... --></button> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Create Next.js Project with TypeScript and ESLint |
|
DESCRIPTION: This command initializes a new Next.js application using `create-next-app`. It configures the project with TypeScript, ESLint, and the App Router, then navigates into the newly created project directory. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/nextjs |
|
|
|
LANGUAGE: bash |
|
CODE: |
|
``` |
|
npx create-next-app@latest my-project --typescript --eslint --app |
|
cd my-project |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Set Border Start Color to Purple 300 |
|
DESCRIPTION: Applies the Tailwind CSS utility class `border-s-purple-300` to set the inline start border color to a medium purple shade (purple-300). This class compiles to the `border-inline-start-color` CSS property, using a CSS variable for the color value. |
|
|
|
SOURCE: https://tailwindcss.com/docs/border-color |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-purple-300 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-purple-300); /* oklch(82.7% 0.119 306.383) */ |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Tailwind CSS Accessibility Utilities |
|
DESCRIPTION: This section provides Tailwind CSS utility classes related to accessibility, specifically for controlling forced color adjustments. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/tailwind-cli |
|
|
|
LANGUAGE: APIDOC |
|
CODE: |
|
``` |
|
forced-color-adjust: Utilities for controlling the forced color adjust property. |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Install Tailwind CSS and PostCSS Dependencies |
|
DESCRIPTION: Installs the necessary npm packages for Tailwind CSS, including `@tailwindcss/postcss`, `postcss`, and `postcss-loader`, which are peer dependencies required for integrating Tailwind CSS with PostCSS in a Rspack project. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/rspack/vue |
|
|
|
LANGUAGE: Terminal |
|
CODE: |
|
``` |
|
npm install tailwindcss @tailwindcss/postcss postcss postcss-loader |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Set Border Start Color to Violet 300 |
|
DESCRIPTION: Applies the Tailwind CSS utility class `border-s-violet-300` to set the inline start border color to a medium violet shade (violet-300). This class compiles to the `border-inline-start-color` CSS property, using a CSS variable for the color value. |
|
|
|
SOURCE: https://tailwindcss.com/docs/border-color |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-violet-300 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-violet-300); /* oklch(81.1% 0.111 293.571) */ |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Configure Tailwind CSS Vite Plugin |
|
DESCRIPTION: Add the `@tailwindcss/vite` plugin to your Vite configuration file (`vite.config.ts`). This step is crucial for Vite to correctly process and integrate Tailwind CSS during development and build cycles. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/using-vite |
|
|
|
LANGUAGE: TypeScript |
|
CODE: |
|
``` |
|
import { defineConfig } from 'vite' |
|
import tailwindcss from '@tailwindcss/vite' |
|
|
|
export default defineConfig({ |
|
plugins: [ |
|
tailwindcss(), |
|
], |
|
}) |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Set Border Start Color to Indigo 800 |
|
DESCRIPTION: Applies the Tailwind CSS utility class `border-s-indigo-800` to set the inline start border color to a very dark indigo shade (indigo-800). This class compiles to the `border-inline-start-color` CSS property, using a CSS variable for the color value. |
|
|
|
SOURCE: https://tailwindcss.com/docs/border-color |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-indigo-800 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-indigo-800); /* oklch(39.8% 0.195 277.366) */ |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Import Application Stylesheet in SvelteKit Layout |
|
DESCRIPTION: Svelte component code for `src/routes/+layout.svelte` to import the `app.css` file, ensuring Tailwind CSS styles are applied globally across the SvelteKit application. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/sveltekit |
|
|
|
LANGUAGE: HTML |
|
CODE: |
|
``` |
|
<script> |
|
let { children } = $props(); |
|
import "../app.css"; |
|
</script> |
|
|
|
{@render children()} |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Set Border Start Color to Indigo 100 |
|
DESCRIPTION: Applies the Tailwind CSS utility class `border-s-indigo-100` to set the inline start border color to a light indigo shade (indigo-100). This class compiles to the `border-inline-start-color` CSS property, using a CSS variable for the color value. |
|
|
|
SOURCE: https://tailwindcss.com/docs/border-color |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-indigo-100 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-indigo-100); /* oklch(93% 0.034 272.788) */ |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Import Tailwind CSS into Main CSS File |
|
DESCRIPTION: This CSS snippet demonstrates how to import Tailwind CSS into your project's main CSS file. This import statement pulls in all of Tailwind's base styles, components, and utilities. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/tailwind-cli |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
@import "tailwindcss"; |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Configure Tailwind CSS Vite Plugin |
|
DESCRIPTION: This JavaScript code snippet demonstrates how to add the `@tailwindcss/vite` plugin to your Vite configuration file. This step is crucial for Vite to correctly process and compile Tailwind CSS directives. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/laravel/vite |
|
|
|
LANGUAGE: JavaScript |
|
CODE: |
|
``` |
|
import { defineConfig } from 'vite' |
|
import tailwindcss from '@tailwindcss/vite' |
|
|
|
export default defineConfig({ |
|
plugins: [ |
|
tailwindcss(), |
|
// … |
|
], |
|
}) |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Import Tailwind CSS into Application Stylesheet |
|
DESCRIPTION: This CSS snippet shows how to import Tailwind CSS into your main application stylesheet (`app.css`). It also includes the `@source` directive to tell Tailwind CSS to scan your `resources/views` directory for utility classes, ensuring all used classes are included in the final build. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/laravel/vite |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
@import "tailwindcss"; |
|
@source "../views"; |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Set Border Start Color to Blue 950 |
|
DESCRIPTION: Applies the Tailwind CSS utility class `border-s-blue-950` to set the inline start border color to a very dark blue shade (blue-950). This class compiles to the `border-inline-start-color` CSS property, using a CSS variable for the color value. |
|
|
|
SOURCE: https://tailwindcss.com/docs/border-color |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-blue-950 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-blue-950); /* oklch(28.2% 0.091 267.935) */ |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Tailwind CSS Responsive Profile Card with Hover States |
|
DESCRIPTION: This HTML example illustrates a more advanced profile card component built with Tailwind CSS, demonstrating responsive design and interactive states. It uses responsive prefixes like `sm:flex-row` for layout changes on small screens and state variants like `hover:bg-purple-600` and `active:bg-purple-700` for button styling, showcasing how complex UIs can be constructed purely with utility classes. |
|
|
|
SOURCE: https://tailwindcss.com/docs/styling-with-utility-classes |
|
|
|
LANGUAGE: HTML |
|
CODE: |
|
``` |
|
<div class="flex flex-col gap-2 p-8 sm:flex-row sm:items-center sm:gap-6 sm:py-4 ..."> <img class="mx-auto block h-24 rounded-full sm:mx-0 sm:shrink-0" src="/img/erin-lindford.jpg" alt="" /> <div class="space-y-2 text-center sm:text-left"> <div class="space-y-0.5"> <p class="text-lg font-semibold text-black">Erin Lindford</p> <p class="font-medium text-gray-500">Product Engineer</p> </div> <button class="border-purple-200 text-purple-600 hover:border-transparent hover:bg-purple-600 hover:text-white active:bg-purple-700 ..."> Message </button> </div></div> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Set Border Start Color to Indigo 400 |
|
DESCRIPTION: Applies the Tailwind CSS utility class `border-s-indigo-400` to set the inline start border color to a medium-dark indigo shade (indigo-400). This class compiles to the `border-inline-start-color` CSS property, using a CSS variable for the color value. |
|
|
|
SOURCE: https://tailwindcss.com/docs/border-color |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-indigo-400 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-indigo-400); /* oklch(67.3% 0.182 276.935) */ |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Set Border Start Color to Violet 200 |
|
DESCRIPTION: Applies the Tailwind CSS utility class `border-s-violet-200` to set the inline start border color to a light-medium violet shade (violet-200). This class compiles to the `border-inline-start-color` CSS property, using a CSS variable for the color value. |
|
|
|
SOURCE: https://tailwindcss.com/docs/border-color |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-violet-200 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-violet-200); /* oklch(89.4% 0.057 293.283) */ |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Add Tailwind plugin to Phoenix dependencies |
|
DESCRIPTION: Adds the Tailwind plugin to the `mix.exs` file's `deps` function, allowing Phoenix to manage the Tailwind dependency. Run `mix deps.get` after this. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/phoenix |
|
|
|
LANGUAGE: Elixir |
|
CODE: |
|
``` |
|
defp deps do [ |
|
# … |
|
{:tailwind, "~> 0.3", runtime: Mix.env() == :dev}, |
|
]end |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: HTML Examples for Tailwind CSS align-content Utilities |
|
DESCRIPTION: Demonstrates the practical application of various Tailwind CSS `align-content` utility classes within HTML, showing how to position rows in grid containers using `content-start`, `content-center`, `content-end`, and `content-between`. |
|
|
|
SOURCE: https://tailwindcss.com/docs/align-content |
|
|
|
LANGUAGE: html |
|
CODE: |
|
``` |
|
<div class="grid h-56 grid-cols-3 content-start gap-4 ..."> |
|
<div>01</div> |
|
<div>02</div> |
|
<div>03</div> |
|
<div>04</div> |
|
<div>05</div> |
|
</div> |
|
``` |
|
|
|
LANGUAGE: html |
|
CODE: |
|
``` |
|
<div class="grid h-56 grid-cols-3 content-center gap-4 ..."> |
|
<div>01</div> |
|
<div>02</div> |
|
<div>03</div> |
|
<div>04</div> |
|
<div>05</div> |
|
</div> |
|
``` |
|
|
|
LANGUAGE: html |
|
CODE: |
|
``` |
|
<div class="grid h-56 grid-cols-3 content-end gap-4 ..."> |
|
<div>01</div> |
|
<div>02</div> |
|
<div>03</div> |
|
<div>04</div> |
|
<div>05</div> |
|
</div> |
|
``` |
|
|
|
LANGUAGE: html |
|
CODE: |
|
``` |
|
<div class="grid h-56 grid-cols-3 content-between gap-4 ..."> |
|
<div>01</div> |
|
<div>02</div> |
|
<div>03</div> |
|
<div>04</div> |
|
<div>05</div> |
|
</div> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Set Border Start Color to Indigo 600 |
|
DESCRIPTION: Applies the Tailwind CSS utility class `border-s-indigo-600` to set the inline start border color to a dark indigo shade (indigo-600). This class compiles to the `border-inline-start-color` CSS property, using a CSS variable for the color value. |
|
|
|
SOURCE: https://tailwindcss.com/docs/border-color |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-indigo-600 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-indigo-600); /* oklch(51.1% 0.262 276.966) */ |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Configure Tailwind CSS version and asset paths in Phoenix |
|
DESCRIPTION: Configures the Tailwind plugin in `config/config.exs`, specifying the Tailwind CSS version and defining input/output paths for asset compilation within the Phoenix project. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/phoenix |
|
|
|
LANGUAGE: Elixir |
|
CODE: |
|
``` |
|
config :tailwind, |
|
version: "4.1.10", |
|
myproject: [ |
|
args: ~w( |
|
--input=assets/css/app.css |
|
--output=priv/static/assets/app.css |
|
), |
|
cd: Path.expand("..", __DIR__) |
|
] |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Web API: window.matchMedia() and localStorage |
|
DESCRIPTION: This API documentation describes the `window.matchMedia()` method for querying media features and `localStorage` for client-side data persistence, both crucial for implementing dynamic theme switching based on user preference and system settings. |
|
|
|
SOURCE: https://tailwindcss.com/docs/dark-mode |
|
|
|
LANGUAGE: APIDOC |
|
CODE: |
|
``` |
|
window.matchMedia(mediaQueryString) |
|
- Description: Returns a new `MediaQueryList` object that can be used to determine if the document matches the passed media query string, as well as to monitor the document to see when it changes to match (or unmatch) the media query. |
|
- Parameters: |
|
- `mediaQueryString`: (string) A string representing the media query to parse. |
|
- Returns: `MediaQueryList` object. |
|
- Example Usage: |
|
`window.matchMedia("(prefers-color-scheme: dark)").matches` - Checks if the user's system prefers a dark color scheme. |
|
|
|
localStorage |
|
- Description: A read-only property that allows you to access a `Storage` object for the `Document`'s origin; the stored data is saved across browser sessions. |
|
- Methods: |
|
- `localStorage.setItem(key, value)`: Adds or updates a key-value pair. |
|
- `key`: (string) The name of the key. |
|
- `value`: (string) The value to store. |
|
- `localStorage.getItem(key)`: Retrieves the value associated with a key. |
|
- `key`: (string) The name of the key. |
|
- Returns: (string | null) The value if found, otherwise `null`. |
|
- `localStorage.removeItem(key)`: Removes a key-value pair. |
|
- `key`: (string) The name of the key to remove. |
|
- Example Usage: |
|
`localStorage.theme = "dark";` |
|
`localStorage.getItem("theme");` |
|
`localStorage.removeItem("theme");` |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Set Border Start Color to Violet 400 |
|
DESCRIPTION: Applies the Tailwind CSS utility class `border-s-violet-400` to set the inline start border color to a medium-dark violet shade (violet-400). This class compiles to the `border-inline-start-color` CSS property, using a CSS variable for the color value. |
|
|
|
SOURCE: https://tailwindcss.com/docs/border-color |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-violet-400 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-violet-400); /* oklch(70.2% 0.183 293.541) */ |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Import Tailwind CSS into Main CSS File |
|
DESCRIPTION: Add an `@import` statement for 'tailwindcss' in your main CSS file. This line ensures that all Tailwind CSS utility classes are included and available in your project's stylesheets. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/using-vite |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
@import "tailwindcss"; |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Tailwind CSS Table Layout Utilities |
|
DESCRIPTION: This section provides Tailwind CSS utility classes for controlling the layout and appearance of HTML tables, including border collapsing, spacing, table layout algorithms, and caption positioning. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/tailwind-cli |
|
|
|
LANGUAGE: APIDOC |
|
CODE: |
|
``` |
|
border-collapse: Utilities for controlling whether table borders are collapsed into a single border or separated. |
|
border-spacing: Utilities for controlling the distance between the borders of adjacent cells. |
|
table-layout: Utilities for controlling the algorithm used to lay out table cells, rows, and columns. |
|
caption-side: Utilities for controlling the placement of a table's caption. |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Tailwind CSS Transitions and Animation Utilities |
|
DESCRIPTION: This section lists Tailwind CSS utility classes for defining CSS transitions and animations. These include properties for controlling which CSS properties to transition, duration, timing functions, delay, and custom animations. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/tailwind-cli |
|
|
|
LANGUAGE: APIDOC |
|
CODE: |
|
``` |
|
transition-property: Utilities for controlling which CSS properties transition. |
|
transition-behavior: Utilities for controlling the transition behavior. |
|
transition-duration: Utilities for controlling the duration of CSS transitions. |
|
transition-timing-function: Utilities for controlling the timing function of CSS transitions. |
|
transition-delay: Utilities for controlling the delay of CSS transitions. |
|
animation: Utilities for controlling custom CSS animations. |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Set Border Start Color to Purple 600 |
|
DESCRIPTION: Applies the Tailwind CSS utility class `border-s-purple-600` to set the inline start border color to a dark purple shade (purple-600). This class compiles to the `border-inline-start-color` CSS property, using a CSS variable for the color value. |
|
|
|
SOURCE: https://tailwindcss.com/docs/border-color |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-purple-600 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-purple-600); /* oklch(55.8% 0.288 302.321) */ |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Apply Tailwind CSS Classes in HTML |
|
DESCRIPTION: Demonstrates how to apply Tailwind CSS utility classes directly within an HTML element. This example uses classes like `text-3xl` for font size, `font-bold` for weight, and `underline` for text decoration to style a heading. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/ruby-on-rails |
|
|
|
LANGUAGE: HTML |
|
CODE: |
|
``` |
|
<h1 class="text-3xl font-bold underline"> Hello world!</h1> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Basic HTML Example for Tailwind color-scheme Utilities |
|
DESCRIPTION: Demonstrates the application of `scheme-light`, `scheme-dark`, and `scheme-light-dark` utility classes to HTML div elements. This example shows how these classes influence the rendering of an input type='date' field based on the specified color scheme. |
|
|
|
SOURCE: https://tailwindcss.com/docs/color-scheme |
|
|
|
LANGUAGE: HTML |
|
CODE: |
|
``` |
|
<div class="scheme-light ..."> <input type="date" /></div><div class="scheme-dark ..."> <input type="date" /></div><div class="scheme-light-dark ..."> <input type="date" /></div> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Tailwind CSS Flex Grow Example: Proportional Growth |
|
DESCRIPTION: Illustrates the use of `grow-<number>` utilities (e.g., `grow-3`, `grow-7`) to make flex items grow proportionally based on a specified factor, distributing available space relative to each other. |
|
|
|
SOURCE: https://tailwindcss.com/docs/flex-grow |
|
|
|
LANGUAGE: HTML |
|
CODE: |
|
``` |
|
<div class="flex ..."> <div class="size-14 grow-3 ...">01</div> <div class="size-14 grow-7 ...">02</div> <div class="size-14 grow-3 ...">03</div></div> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Set Border Start Color to Indigo 50 |
|
DESCRIPTION: Applies the Tailwind CSS utility class `border-s-indigo-50` to set the inline start border color to a very light indigo shade (indigo-50). This class compiles to the `border-inline-start-color` CSS property, using a CSS variable for the color value. |
|
|
|
SOURCE: https://tailwindcss.com/docs/border-color |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-indigo-50 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-indigo-50); /* oklch(96.2% 0.018 272.314) */ |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Set Border Start Color to Purple 100 |
|
DESCRIPTION: Applies the Tailwind CSS utility class `border-s-purple-100` to set the inline start border color to a light purple shade (purple-100). This class compiles to the `border-inline-start-color` CSS property, using a CSS variable for the color value. |
|
|
|
SOURCE: https://tailwindcss.com/docs/border-color |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-purple-100 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-purple-100); /* oklch(94.6% 0.033 307.174) */ |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: HTML Example: Specifying Grid Columns with Tailwind CSS |
|
DESCRIPTION: Demonstrates how to use `grid-cols-<number>` utilities in HTML to create a grid with a specified number of equally sized columns. This example uses `grid-cols-4` to create a four-column grid. |
|
|
|
SOURCE: https://tailwindcss.com/docs/grid-template-columns |
|
|
|
LANGUAGE: HTML |
|
CODE: |
|
``` |
|
<div class="grid grid-cols-4 gap-4"> <div>01</div> <!-- ... --> <div>09</div></div> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Add Custom CSS with Tailwind Play CDN |
|
DESCRIPTION: Illustrates how to define custom CSS variables and styles within an HTML file using a `<style type="text/tailwindcss">` block. This allows leveraging Tailwind's CSS features, such as `@theme` directives, alongside the Play CDN for extended styling capabilities. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/play-cdn |
|
|
|
LANGUAGE: HTML |
|
CODE: |
|
``` |
|
<!doctype html><html> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script> <style type="text/tailwindcss"> @theme { --color-clifford: #da373d; } </style> </head> <body> <h1 class="text-3xl font-bold underline text-clifford"> Hello world! </h1> </body></html> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Set Border Start Color to Indigo 200 |
|
DESCRIPTION: Applies the Tailwind CSS utility class `border-s-indigo-200` to set the inline start border color to a light-medium indigo shade (indigo-200). This class compiles to the `border-inline-start-color` CSS property, using a CSS variable for the color value. |
|
|
|
SOURCE: https://tailwindcss.com/docs/border-color |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-indigo-200 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-indigo-200); /* oklch(87% 0.065 274.039) */ |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Tailwind CSS Flex Grow Example: Allowing Items to Grow |
|
DESCRIPTION: Demonstrates how to use the `grow` utility class in Tailwind CSS to allow a flex item to expand and fill any remaining space within a flex container. |
|
|
|
SOURCE: https://tailwindcss.com/docs/flex-grow |
|
|
|
LANGUAGE: HTML |
|
CODE: |
|
``` |
|
<div class="flex ..."> <div class="size-14 flex-none ...">01</div> <div class="size-14 grow ...">02</div> <div class="size-14 flex-none ...">03</div></div> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Set Border Start Color to Purple 50 |
|
DESCRIPTION: Applies the Tailwind CSS utility class `border-s-purple-50` to set the inline start border color to a very light purple shade (purple-50). This class compiles to the `border-inline-start-color` CSS property, using a CSS variable for the color value. |
|
|
|
SOURCE: https://tailwindcss.com/docs/border-color |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-purple-50 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-purple-50); /* oklch(97.7% 0.014 308.299) */ |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Set Border Start Color to Indigo 950 |
|
DESCRIPTION: Applies the Tailwind CSS utility class `border-s-indigo-950` to set the inline start border color to a very deep indigo shade (indigo-950). This class compiles to the `border-inline-start-color` CSS property, using a CSS variable for the color value. |
|
|
|
SOURCE: https://tailwindcss.com/docs/border-color |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-indigo-950 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-indigo-950); /* oklch(25.7% 0.09 281.288) */ |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: HTML Navigation Menu with Tailwind CSS |
|
DESCRIPTION: Demonstrates a simple navigation menu structure using Tailwind CSS utility classes. This example is particularly suitable for quick, localized class updates using multi-cursor editing. |
|
|
|
SOURCE: https://tailwindcss.com/docs/styling-with-utility-classes |
|
|
|
LANGUAGE: HTML |
|
CODE: |
|
``` |
|
<nav class="flex justify-center space-x-4"> <a href="/dashboard" class="font-medium rounded-lg px-3 py-2 text-gray-700 hover:bg-gray-100 hover:text-gray-900"> Home </a> <a href="/team" class="font-medium rounded-lg px-3 py-2 text-gray-700 hover:bg-gray-100 hover:text-gray-900"> Team </a> <a href="/projects" class="font-medium rounded-lg px-3 py-2 text-gray-700 hover:bg-gray-100 hover:text-gray-900"> Projects </a> <a href="/reports" class="font-medium rounded-lg px-3 py-2 text-gray-700 hover:bg-gray-100 hover:text-gray-900"> Reports </a></nav> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: HTML Example for Tailwind CSS Blur Utilities |
|
DESCRIPTION: Demonstrates the application of various Tailwind CSS blur utility classes to image elements within an HTML structure. This example shows how different blur levels can be applied directly using class names. |
|
|
|
SOURCE: https://tailwindcss.com/docs/filter-blur |
|
|
|
LANGUAGE: HTML |
|
CODE: |
|
``` |
|
<img class="blur-none" src="/img/mountains.jpg" /><img class="blur-sm" src="/img/mountains.jpg" /><img class="blur-lg" src="/img/mountains.jpg" /><img class="blur-2xl" src="/img/mountains.jpg" /> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Tailwind CSS SVG Utilities |
|
DESCRIPTION: This section lists Tailwind CSS utility classes specifically for styling SVG elements, including fill color, stroke color, and stroke width. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/tailwind-cli |
|
|
|
LANGUAGE: APIDOC |
|
CODE: |
|
``` |
|
fill: Utilities for controlling the fill color of an SVG element. |
|
stroke: Utilities for controlling the stroke color of an SVG element. |
|
stroke-width: Utilities for controlling the stroke width of an SVG element. |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Set Border Start Color to Violet 100 |
|
DESCRIPTION: Applies the Tailwind CSS utility class `border-s-violet-100` to set the inline start border color to a light violet shade (violet-100). This class compiles to the `border-inline-start-color` CSS property, using a CSS variable for the color value. |
|
|
|
SOURCE: https://tailwindcss.com/docs/border-color |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-violet-100 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-violet-100); /* oklch(94.3% 0.029 294.588) */ |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Tailwind CSS background-clip Responsive Design Example |
|
DESCRIPTION: Shows how to apply `background-clip` utilities conditionally based on screen size using responsive variants like `md:`. This allows for different background clipping behaviors to be applied at various breakpoints, adapting to responsive layouts. |
|
|
|
SOURCE: https://tailwindcss.com/docs/background-clip |
|
|
|
LANGUAGE: html |
|
CODE: |
|
``` |
|
<div class="bg-clip-border md:bg-clip-padding ..."> <!-- ... --></div> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Using custom utility classes in HTML |
|
DESCRIPTION: Shows how to apply a custom utility class, defined using the `@utility` directive, directly within HTML markup. This demonstrates the integration of custom utilities into the standard Tailwind workflow. |
|
|
|
SOURCE: https://tailwindcss.com/docs/adding-custom-styles |
|
|
|
LANGUAGE: HTML |
|
CODE: |
|
``` |
|
<div class="content-auto"> <!-- ... --></div> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Tailwind CSS justify-items-end-safe Example |
|
DESCRIPTION: Shows the `justify-items-end-safe` utility class, which aligns grid items to the end of their inline axis, but falls back to the start if there is insufficient space. |
|
|
|
SOURCE: https://tailwindcss.com/docs/justify-items |
|
|
|
LANGUAGE: html |
|
CODE: |
|
``` |
|
<div class="grid grid-flow-col justify-items-end-safe ..."> |
|
<div>01</div> |
|
<div>02</div> |
|
<div>03</div> |
|
</div> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Import Tailwind CSS into your main stylesheet |
|
DESCRIPTION: This CSS snippet, placed in your main stylesheet (e.g., `index.css`), imports all of Tailwind CSS's base styles, components, and utilities. This is the entry point for Tailwind CSS into your project's styling. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/parcel |
|
|
|
LANGUAGE: css |
|
CODE: |
|
``` |
|
@import "tailwindcss"; |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Set Border Start Color to Purple 400 |
|
DESCRIPTION: Applies the Tailwind CSS utility class `border-s-purple-400` to set the inline start border color to a medium-dark purple shade (purple-400). This class compiles to the `border-inline-start-color` CSS property, using a CSS variable for the color value. |
|
|
|
SOURCE: https://tailwindcss.com/docs/border-color |
|
|
|
LANGUAGE: Tailwind CSS |
|
CODE: |
|
``` |
|
border-s-purple-400 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-purple-400); /* oklch(71.4% 0.203 305.504) */ |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Apply Tailwind CSS background-origin Utilities |
|
DESCRIPTION: Demonstrates the application of `bg-origin-border`, `bg-origin-padding`, and `bg-origin-content` utilities in HTML to control where an element's background is rendered relative to its box model. |
|
|
|
SOURCE: https://tailwindcss.com/docs/background-origin |
|
|
|
LANGUAGE: html |
|
CODE: |
|
``` |
|
<div class="border-4 bg-[url(/img/mountains.jpg)] bg-origin-border p-3 ..."></div><div class="border-4 bg-[url(/img/mountains.jpg)] bg-origin-padding p-3 ..."></div><div class="border-4 bg-[url(/img/mountains.jpg)] bg-origin-content p-3 ..."></div> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Tailwind CSS Transform Utilities |
|
DESCRIPTION: This section covers Tailwind CSS utility classes for applying 2D and 3D transformations to elements, such as rotation, scaling, skewing, and translation. It also includes properties for controlling perspective and transform origins. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/tailwind-cli |
|
|
|
LANGUAGE: APIDOC |
|
CODE: |
|
``` |
|
backface-visibility: Utilities for controlling whether or not the back face of an element is visible when rotated. |
|
perspective: Utilities for controlling the perspective property. |
|
perspective-origin: Utilities for controlling the perspective origin property. |
|
rotate: Utilities for rotating elements. |
|
scale: Utilities for scaling elements. |
|
skew: Utilities for skewing elements. |
|
transform: Utilities for applying 2D or 3D transformations to an element. |
|
transform-origin: Utilities for controlling the origin of an element's transformation. |
|
transform-style: Utilities for controlling how nested elements are rendered in 3D space. |
|
translate: Utilities for translating elements. |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Tailwind CSS Opacity Utility Class Reference |
|
DESCRIPTION: Documents the `opacity` utility class in Tailwind CSS, detailing its various syntaxes for setting element opacity, including numeric values, custom properties, and arbitrary values. |
|
|
|
SOURCE: https://tailwindcss.com/docs/opacity |
|
|
|
LANGUAGE: APIDOC |
|
CODE: |
|
``` |
|
Class | Styles |
|
| --- | --- |
|
| `opacity-<number>` | `opacity: <number>%;` |
|
| `opacity-(<custom-property>)` | `opacity: var(<custom-property>);` |
|
| `opacity-[<value>]` | `opacity: <value>;` |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Install Tailwind CSS and PostCSS dependencies |
|
DESCRIPTION: Installs the required npm packages for Tailwind CSS integration, including Tailwind CSS itself, its PostCSS plugin, PostCSS, and postcss-load-config. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/meteor |
|
|
|
LANGUAGE: bash |
|
CODE: |
|
``` |
|
npm install tailwindcss @tailwindcss/postcss postcss postcss-load-config |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Tailwind CSS Border Start Color Utility Classes |
|
DESCRIPTION: A comprehensive list of Tailwind CSS utility classes used to apply specific colors to the `border-inline-start` property. Each utility class maps to a CSS `border-inline-start-color` property, referencing a CSS variable for the color value and including the Oklch color representation in comments. |
|
|
|
SOURCE: https://tailwindcss.com/docs/border-color |
|
|
|
LANGUAGE: APIDOC |
|
CODE: |
|
``` |
|
Tailwind CSS Border Start Color Utilities: |
|
|
|
border-s-fuchsia-800: border-inline-start-color: var(--color-fuchsia-800); /* oklch(45.2% 0.211 324.591) */ |
|
border-s-fuchsia-900: border-inline-start-color: var(--color-fuchsia-900); /* oklch(40.1% 0.17 325.612) */ |
|
border-s-fuchsia-950: border-inline-start-color: var(--color-fuchsia-950); /* oklch(29.3% 0.136 325.661) */ |
|
border-s-pink-50: border-inline-start-color: var(--color-pink-50); /* oklch(97.1% 0.014 343.198) */ |
|
border-s-pink-100: border-inline-start-color: var(--color-pink-100); /* oklch(94.8% 0.028 342.258) */ |
|
border-s-pink-200: border-inline-start-color: var(--color-pink-200); /* oklch(89.9% 0.061 343.231) */ |
|
border-s-pink-300: border-inline-start-color: var(--color-pink-300); /* oklch(82.3% 0.12 346.018) */ |
|
border-s-pink-400: border-inline-start-color: var(--color-pink-400); /* oklch(71.8% 0.202 349.761) */ |
|
border-s-pink-500: border-inline-start-color: var(--color-pink-500); /* oklch(65.6% 0.241 354.308) */ |
|
border-s-pink-600: border-inline-start-color: var(--color-pink-600); /* oklch(59.2% 0.249 0.584) */ |
|
border-s-pink-700: border-inline-start-color: var(--color-pink-700); /* oklch(52.5% 0.223 3.958) */ |
|
border-s-pink-800: border-inline-start-color: var(--color-pink-800); /* oklch(45.9% 0.187 3.815) */ |
|
border-s-pink-900: border-inline-start-color: var(--color-pink-900); /* oklch(40.8% 0.153 2.432) */ |
|
border-s-pink-950: border-inline-start-color: var(--color-pink-950); /* oklch(28.4% 0.109 3.907) */ |
|
border-s-rose-50: border-inline-start-color: var(--color-rose-50); /* oklch(96.9% 0.015 12.422) */ |
|
border-s-rose-100: border-inline-start-color: var(--color-rose-100); /* oklch(94.1% 0.03 12.58) */ |
|
border-s-rose-200: border-inline-start-color: var(--color-rose-200); /* oklch(89.2% 0.058 10.001) */ |
|
border-s-rose-300: border-inline-start-color: var(--color-rose-300); /* oklch(81% 0.117 11.638) */ |
|
border-s-rose-400: border-inline-start-color: var(--color-rose-400); /* oklch(71.2% 0.194 13.428) */ |
|
border-s-rose-500: border-inline-start-color: var(--color-rose-500); /* oklch(64.5% 0.246 16.439) */ |
|
border-s-rose-600: border-inline-start-color: var(--color-rose-600); /* oklch(58.6% 0.253 17.585) */ |
|
border-s-rose-700: border-inline-start-color: var(--color-rose-700); /* oklch(51.4% 0.222 16.935) */ |
|
border-s-rose-800: border-inline-start-color: var(--color-rose-800); /* oklch(45.5% 0.188 13.697) */ |
|
border-s-rose-900: border-inline-start-color: var(--color-rose-900); /* oklch(41% 0.159 10.272) */ |
|
border-s-rose-950: border-inline-start-color: var(--color-rose-950); /* oklch(27.1% 0.105 12.094) */ |
|
border-s-slate-50: border-inline-start-color: var(--color-slate-50); /* oklch(98.4% 0.003 247.858) */ |
|
border-s-slate-100: border-inline-start-color: var(--color-slate-100); /* oklch(96.8% 0.007 247.896) */ |
|
border-s-slate-200: border-inline-start-color: var(--color-slate-200); /* oklch(92.9% 0.013 255.508) */ |
|
border-s-slate-300: border-inline-start-color: var(--color-slate-300); /* oklch(86.9% 0.022 252.894) */ |
|
border-s-slate-400: border-inline-start-color: var(--color-slate-400); /* oklch(70.4% 0.04 256.788) */ |
|
border-s-slate-500: border-inline-start-color: var(--color-slate-500); /* oklch(55.4% 0.046 257.417) */ |
|
border-s-slate-600: border-inline-start-color: var(--color-slate-600); /* oklch(44.6% 0.043 257.281) */ |
|
border-s-slate-700: border-inline-start-color: var(--color-slate-700); /* oklch(37.2% 0.044 257.287) */ |
|
border-s-slate-800: border-inline-start-color: var(--color-slate-800); /* oklch(27.9% 0.041 260.031) */ |
|
border-s-slate-900: border-inline-start-color: var(--color-slate-900); /* oklch(20.8% 0.042 265.755) */ |
|
border-s-slate-950: border-inline-start-color: var(--color-slate-950); /* oklch(12.9% 0.042 264.695) */ |
|
border-s-gray-50: border-inline-start-color: var(--color-gray-50); /* oklch(98.5% 0.002 247.839) */ |
|
border-s-gray-100: border-inline-start-color: var(--color-gray-100); /* oklch(96.7% 0.003 264.542) */ |
|
border-s-gray-200: border-inline-start-color: var(--color-gray-200); /* oklch(92.8% 0.006 264.531) */ |
|
border-s-gray-300: border-inline-start-color: var(--color-gray-300); /* oklch(87.2% 0.01 258.338) */ |
|
border-s-gray-400: border-inline-start-color: var(--color-gray-400); /* oklch(70.7% 0.022 261.325) */ |
|
border-s-gray-500: border-inline-start-color: var(--color-gray-500); /* oklch(55.1% 0.027 264.364) */ |
|
border-s-gray-600: border-inline-start-color: var(--color-gray-600); /* oklch(44.6% 0.03 256.802) */ |
|
border-s-gray-700: border-inline-start-color: var(--color-gray-700); /* oklch(37.3% 0.034 259.733) */ |
|
border-s-gray-800: border-inline-start-color: var(--color-gray-800); /* oklch(27.8% 0.033 256.848) */ |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Apply place-items-start in Tailwind CSS Grid |
|
DESCRIPTION: Demonstrates the usage of the `place-items-start` utility class in Tailwind CSS to align grid items to the start of their grid areas on both axes. This snippet shows a basic grid container with six items. |
|
|
|
SOURCE: https://tailwindcss.com/docs/place-items |
|
|
|
LANGUAGE: HTML |
|
CODE: |
|
``` |
|
<div class="grid grid-cols-3 place-items-start gap-4 ..."> <div>01</div> <div>02</div> <div>03</div> <div>04</div> <div>05</div> <div>06</div></div> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Tailwind CSS Border Start Color Utility Classes and CSS Output |
|
DESCRIPTION: This snippet provides a comprehensive list of Tailwind CSS utility classes for `border-inline-start-color` and their corresponding CSS outputs. Each utility class directly sets the `border-inline-start-color` property using a CSS variable that references a specific color from the Tailwind CSS palette, along with its Oklch color representation in comments. |
|
|
|
SOURCE: https://tailwindcss.com/docs/border-color |
|
|
|
LANGUAGE: Tailwind CSS Class |
|
CODE: |
|
``` |
|
border-s-amber-800 |
|
border-s-amber-900 |
|
border-s-amber-950 |
|
border-s-yellow-50 |
|
border-s-yellow-100 |
|
border-s-yellow-200 |
|
border-s-yellow-300 |
|
border-s-yellow-400 |
|
border-s-yellow-500 |
|
border-s-yellow-600 |
|
border-s-yellow-700 |
|
border-s-yellow-800 |
|
border-s-yellow-900 |
|
border-s-yellow-950 |
|
border-s-lime-50 |
|
border-s-lime-100 |
|
border-s-lime-200 |
|
border-s-lime-300 |
|
border-s-lime-400 |
|
border-s-lime-500 |
|
border-s-lime-600 |
|
border-s-lime-700 |
|
border-s-lime-800 |
|
border-s-lime-900 |
|
border-s-lime-950 |
|
border-s-green-50 |
|
border-s-green-100 |
|
border-s-green-200 |
|
border-s-green-300 |
|
border-s-green-400 |
|
border-s-green-500 |
|
border-s-green-600 |
|
border-s-green-700 |
|
border-s-green-800 |
|
border-s-green-900 |
|
border-s-green-950 |
|
border-s-emerald-50 |
|
border-s-emerald-100 |
|
border-s-emerald-200 |
|
border-s-emerald-300 |
|
border-s-emerald-400 |
|
border-s-emerald-500 |
|
border-s-emerald-600 |
|
border-s-emerald-700 |
|
``` |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
border-inline-start-color: var(--color-amber-800); /* oklch(47.3% 0.137 46.201) */ |
|
border-inline-start-color: var(--color-amber-900); /* oklch(41.4% 0.112 45.904) */ |
|
border-inline-start-color: var(--color-amber-950); /* oklch(27.9% 0.077 45.635) */ |
|
border-inline-start-color: var(--color-yellow-50); /* oklch(98.7% 0.026 102.212) */ |
|
border-inline-start-color: var(--color-yellow-100); /* oklch(97.3% 0.071 103.193) */ |
|
border-inline-start-color: var(--color-yellow-200); /* oklch(94.5% 0.129 101.54) */ |
|
border-inline-start-color: var(--color-yellow-300); /* oklch(90.5% 0.182 98.111) */ |
|
border-inline-start-color: var(--color-yellow-400); /* oklch(85.2% 0.199 91.936) */ |
|
border-inline-start-color: var(--color-yellow-500); /* oklch(79.5% 0.184 86.047) */ |
|
border-inline-start-color: var(--color-yellow-600); /* oklch(68.1% 0.162 75.834) */ |
|
border-inline-start-color: var(--color-yellow-700); /* oklch(55.4% 0.135 66.442) */ |
|
border-inline-start-color: var(--color-yellow-800); /* oklch(47.6% 0.114 61.907) */ |
|
border-inline-start-color: var(--color-yellow-900); /* oklch(42.1% 0.095 57.708) */ |
|
border-inline-start-color: var(--color-yellow-950); /* oklch(28.6% 0.066 53.813) */ |
|
border-inline-start-color: var(--color-lime-50); /* oklch(98.6% 0.031 120.757) */ |
|
border-inline-start-color: var(--color-lime-100); /* oklch(96.7% 0.067 122.328) */ |
|
border-inline-start-color: var(--color-lime-200); /* oklch(93.8% 0.127 124.321) */ |
|
border-inline-start-color: var(--color-lime-300); /* oklch(89.7% 0.196 126.665) */ |
|
border-inline-start-color: var(--color-lime-400); /* oklch(84.1% 0.238 128.85) */ |
|
border-inline-start-color: var(--color-lime-500); /* oklch(76.8% 0.233 130.85) */ |
|
border-inline-start-color: var(--color-lime-600); /* oklch(64.8% 0.2 131.684) */ |
|
border-inline-start-color: var(--color-lime-700); /* oklch(53.2% 0.157 131.589) */ |
|
border-inline-start-color: var(--color-lime-800); /* oklch(45.3% 0.124 130.933) */ |
|
border-inline-start-color: var(--color-lime-900); /* oklch(40.5% 0.101 131.063) */ |
|
border-inline-start-color: var(--color-lime-950); /* oklch(27.4% 0.072 132.109) */ |
|
border-inline-start-color: var(--color-green-50); /* oklch(98.2% 0.018 155.826) */ |
|
border-inline-start-color: var(--color-green-100); /* oklch(96.2% 0.044 156.743) */ |
|
border-inline-start-color: var(--color-green-200); /* oklch(92.5% 0.084 155.995) */ |
|
border-inline-start-color: var(--color-green-300); /* oklch(87.1% 0.15 154.449) */ |
|
border-inline-start-color: var(--color-green-400); /* oklch(79.2% 0.209 151.711) */ |
|
border-inline-start-color: var(--color-green-500); /* oklch(72.3% 0.219 149.579) */ |
|
border-inline-start-color: var(--color-green-600); /* oklch(62.7% 0.194 149.214) */ |
|
border-inline-start-color: var(--color-green-700); /* oklch(52.7% 0.154 150.069) */ |
|
border-inline-start-color: var(--color-green-800); /* oklch(44.8% 0.119 151.328) */ |
|
border-inline-start-color: var(--color-green-900); /* oklch(39.3% 0.095 152.535) */ |
|
border-inline-start-color: var(--color-green-950); /* oklch(26.6% 0.065 152.934) */ |
|
border-inline-start-color: var(--color-emerald-50); /* oklch(97.9% 0.021 166.113) */ |
|
border-inline-start-color: var(--color-emerald-100); /* oklch(95% 0.052 163.051) */ |
|
border-inline-start-color: var(--color-emerald-200); /* oklch(90.5% 0.093 164.15) */ |
|
border-inline-start-color: var(--color-emerald-300); /* oklch(84.5% 0.143 164.978) */ |
|
border-inline-start-color: var(--color-emerald-400); /* oklch(76.5% 0.177 163.223) */ |
|
border-inline-start-color: var(--color-emerald-500); /* oklch(69.6% 0.17 162.48) */ |
|
border-inline-start-color: var(--color-emerald-600); /* oklch(59.6% 0.145 163.225) */ |
|
border-inline-start-color: var(--color-emerald-700); /* oklch(50.8% 0.118 165.612) */ |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Tailwind CSS Utility Classes Reference |
|
DESCRIPTION: A comprehensive reference of Tailwind CSS utility classes categorized by their functional areas. These classes provide direct control over various CSS properties for rapid UI development, covering visual effects, filtering, table styling, animation, transformations, user interaction, SVG properties, and accessibility features. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/laravel/vite |
|
|
|
LANGUAGE: APIDOC |
|
CODE: |
|
``` |
|
Effects: |
|
- box-shadow |
|
- text-shadow |
|
- opacity |
|
- mix-blend-mode |
|
- background-blend-mode |
|
- mask-clip |
|
- mask-composite |
|
- mask-image |
|
- mask-mode |
|
- mask-origin |
|
- mask-position |
|
- mask-repeat |
|
- mask-size |
|
- mask-type |
|
|
|
Filters: |
|
- filter |
|
- blur |
|
- brightness |
|
- contrast |
|
- drop-shadow |
|
- grayscale |
|
- hue-rotate |
|
- invert |
|
- saturate |
|
- sepia |
|
- backdrop-filter |
|
- blur |
|
- brightness |
|
- contrast |
|
- grayscale |
|
- hue-rotate |
|
- invert |
|
- opacity |
|
- saturate |
|
- sepia |
|
|
|
Tables: |
|
- border-collapse |
|
- border-spacing |
|
- table-layout |
|
- caption-side |
|
|
|
Transitions & Animation: |
|
- transition-property |
|
- transition-behavior |
|
- transition-duration |
|
- transition-timing-function |
|
- transition-delay |
|
- animation |
|
|
|
Transforms: |
|
- backface-visibility |
|
- perspective |
|
- perspective-origin |
|
- rotate |
|
- scale |
|
- skew |
|
- transform |
|
- transform-origin |
|
- transform-style |
|
- translate |
|
|
|
Interactivity: |
|
- accent-color |
|
- appearance |
|
- caret-color |
|
- color-scheme |
|
- cursor |
|
- field-sizing |
|
- pointer-events |
|
- resize |
|
- scroll-behavior |
|
- scroll-margin |
|
- scroll-padding |
|
- scroll-snap-align |
|
- scroll-snap-stop |
|
- scroll-snap-type |
|
- touch-action |
|
- user-select |
|
- will-change |
|
|
|
SVG: |
|
- fill |
|
- stroke |
|
- stroke-width |
|
|
|
Accessibility: |
|
- forced-color-adjust |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Implement responsive flex basis with Tailwind CSS breakpoints |
|
DESCRIPTION: This HTML example demonstrates how to apply responsive `flex-basis` utilities using breakpoint variants like `md:`. This allows the initial size of flex items to change based on screen size, ensuring adaptive layouts for different devices. |
|
|
|
SOURCE: https://tailwindcss.com/docs/flex-basis |
|
|
|
LANGUAGE: html |
|
CODE: |
|
``` |
|
<div class="flex flex-row"> <div class="basis-1/4 md:basis-1/3">01</div> <div class="basis-1/4 md:basis-1/3">02</div> <div class="basis-1/2 md:basis-1/3">03</div></div> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Import Tailwind CSS into Application Stylesheet |
|
DESCRIPTION: Adds an `@import` statement for Tailwind CSS within the main application stylesheet (`./app/app.css`). This directive pulls in all of Tailwind's base styles, components, and utilities. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/emberjs |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
@import "tailwindcss"; |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Tailwind CSS background-clip Basic Usage Example |
|
DESCRIPTION: Demonstrates the application of `bg-clip-border`, `bg-clip-padding`, and `bg-clip-content` utilities to control the background bounding box of div elements, showcasing how the background is clipped relative to the border, padding, or content box. |
|
|
|
SOURCE: https://tailwindcss.com/docs/background-clip |
|
|
|
LANGUAGE: html |
|
CODE: |
|
``` |
|
<div class="border-4 bg-indigo-500 bg-clip-border p-3"></div><div class="border-4 bg-indigo-500 bg-clip-padding p-3"></div><div class="border-4 bg-indigo-500 bg-clip-content p-3"></div> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: CSS Equivalent for Tailwind Arbitrary Variant |
|
DESCRIPTION: Shows the simplified CSS output for an arbitrary variant, illustrating a complex sibling selector applied via Tailwind's arbitrary variant syntax. |
|
|
|
SOURCE: https://tailwindcss.com/docs/styling-with-utility-classes |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
div > [data-active] + span { color: var(--color-blue-600);} |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: HTML Example: Resizing Image to Cover Container with object-cover |
|
DESCRIPTION: Demonstrates how to use the `object-cover` utility class in HTML to make an image cover its container while preserving its aspect ratio, potentially cropping parts of the image. |
|
|
|
SOURCE: https://tailwindcss.com/docs/object-fit |
|
|
|
LANGUAGE: HTML |
|
CODE: |
|
``` |
|
<img class="h-48 w-96 object-cover ..." src="/img/mountains.jpg" /> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Align Grid Items to Start with Tailwind CSS place-content-start |
|
DESCRIPTION: Illustrates the use of the `place-content-start` utility class in Tailwind CSS to pack grid items against the start of the block axis within a grid container. This aligns content to the top or left, depending on the writing mode. |
|
|
|
SOURCE: https://tailwindcss.com/docs/place-content |
|
|
|
LANGUAGE: HTML |
|
CODE: |
|
``` |
|
<div class="grid h-48 grid-cols-2 place-content-start gap-4 ..."> |
|
<div>01</div> |
|
<div>02</div> |
|
<div>03</div> |
|
<div>04</div> |
|
</div> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Import Tailwind CSS into application stylesheet |
|
DESCRIPTION: Adds an `@import` rule to `./assets/css/app.css` to include the Tailwind CSS framework, making its utility classes available in the project. |
|
|
|
SOURCE: https://tailwindcss.com/docs/installation/framework-guides/phoenix |
|
|
|
LANGUAGE: CSS |
|
CODE: |
|
``` |
|
@import "tailwindcss"; |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: HTML Example for Tailwind CSS mask-composite Basic Usage |
|
DESCRIPTION: Demonstrates the application of different `mask-composite` utilities (`mask-add`, `mask-subtract`, `mask-intersect`, `mask-exclude`) to HTML div elements. This example shows how multiple masks, defined using arbitrary values, interact based on the chosen composite mode. |
|
|
|
SOURCE: https://tailwindcss.com/docs/mask-composite |
|
|
|
LANGUAGE: HTML |
|
CODE: |
|
``` |
|
<div class="mask-add mask-[url(/img/circle.png),url(/img/circle.png)] mask-[position:30%_50%,70%_50%] bg-[url(/img/mountains.jpg)]"></div><div class="mask-subtract mask-[url(/img/circle.png),url(/img/circle.png)] mask-[position:30%_50%,70%_50%] bg-[url(/img/mountains.jpg)]"></div><div class="mask-intersect mask-[url(/img/circle.png),url(/img/circle.png)] mask-[position:30%_50%,70%_50%] bg-[url(/img/mountains.jpg)]"></div><div class="mask-exclude mask-[url(/img/circle.png),url(/img/circle.png)] mask-[position:30%_50%,70%_50%] bg-[url(/img/mountains.jpg)]"></div> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: HTML Example: Implementing a Subgrid with Tailwind CSS |
|
DESCRIPTION: Illustrates the use of the `grid-cols-subgrid` utility in HTML. This utility allows a nested grid to adopt the column tracks defined by its parent grid, ensuring alignment and consistency. |
|
|
|
SOURCE: https://tailwindcss.com/docs/grid-template-columns |
|
|
|
LANGUAGE: HTML |
|
CODE: |
|
``` |
|
<div class="grid grid-cols-4 gap-4"> <div>01</div> <!-- ... --> <div>05</div> <div class="col-span-3 grid grid-cols-subgrid gap-4"> <div class="col-start-2">06</div> </div></div> |
|
``` |
|
|
|
---------------------------------------- |
|
|
|
TITLE: Tailwind CSS border-s- Utility Classes for Inline Start Border Color |
|
DESCRIPTION: These Tailwind CSS utility classes set the `border-inline-start-color` property, allowing control over the logical start edge border color. They map to various predefined color palettes (gray, zinc, neutral, stone) and support custom values via arbitrary properties or square bracket notation. |
|
|
|
SOURCE: https://tailwindcss.com/docs/border-color |
|
|
|
LANGUAGE: APIDOC |
|
CODE: |
|
``` |
|
border-s-gray-900: border-inline-start-color: var(--color-gray-900); /* oklch(21% 0.034 264.665) */ |
|
border-s-gray-950: border-inline-start-color: var(--color-gray-950); /* oklch(13% 0.028 261.692) */ |
|
border-s-zinc-50: border-inline-start-color: var(--color-zinc-50); /* oklch(98.5% 0 0) */ |
|
border-s-zinc-100: border-inline-start-color: var(--color-zinc-100); /* oklch(96.7% 0.001 286.375) */ |
|
border-s-zinc-200: border-inline-start-color: var(--color-zinc-200); /* oklch(92% 0.004 286.32) */ |
|
border-s-zinc-300: border-inline-start-color: var(--color-zinc-300); /* oklch(87.1% 0.006 286.286) */ |
|
border-s-zinc-400: border-inline-start-color: var(--color-zinc-400); /* oklch(70.5% 0.015 286.067) */ |
|
border-s-zinc-500: border-inline-start-color: var(--color-zinc-500); /* oklch(55.2% 0.016 285.938) */ |
|
border-s-zinc-600: border-inline-start-color: var(--color-zinc-600); /* oklch(44.2% 0.017 285.786) */ |
|
border-s-zinc-700: border-inline-start-color: var(--color-zinc-700); /* oklch(37% 0.013 285.805) */ |
|
border-s-zinc-800: border-inline-start-color: var(--color-zinc-800); /* oklch(27.4% 0.006 286.033) */ |
|
border-s-zinc-900: border-inline-start-color: var(--color-zinc-900); /* oklch(21% 0.006 285.885) */ |
|
border-s-zinc-950: border-inline-start-color: var(--color-zinc-950); /* oklch(14.1% 0.005 285.823) */ |
|
border-s-neutral-50: border-inline-start-color: var(--color-neutral-50); /* oklch(98.5% 0 0) */ |
|
border-s-neutral-100: border-inline-start-color: var(--color-neutral-100); /* oklch(97% 0 0) */ |
|
border-s-neutral-200: border-inline-start-color: var(--color-neutral-200); /* oklch(92.2% 0 0) */ |
|
border-s-neutral-300: border-inline-start-color: var(--color-neutral-300); /* oklch(87% 0 0) */ |
|
border-s-neutral-400: border-inline-start-color: var(--color-neutral-400); /* oklch(70.8% 0 0) */ |
|
border-s-neutral-500: border-inline-start-color: var(--color-neutral-500); /* oklch(55.6% 0 0) */ |
|
border-s-neutral-600: border-inline-start-color: var(--color-neutral-600); /* oklch(43.9% 0 0) */ |
|
border-s-neutral-700: border-inline-start-color: var(--color-neutral-700); /* oklch(37.1% 0 0) */ |
|
border-s-neutral-800: border-inline-start-color: var(--color-neutral-800); /* oklch(26.9% 0 0) */ |
|
border-s-neutral-900: border-inline-start-color: var(--color-neutral-900); /* oklch(20.5% 0 0) */ |
|
border-s-neutral-950: border-inline-start-color: var(--color-neutral-950); /* oklch(14.5% 0 0) */ |
|
border-s-stone-50: border-inline-start-color: var(--color-stone-50); /* oklch(98.5% 0.001 106.423) */ |
|
border-s-stone-100: border-inline-start-color: var(--color-stone-100); /* oklch(97% 0.001 106.424) */ |
|
border-s-stone-200: border-inline-start-color: var(--color-stone-200); /* oklch(92.3% 0.003 48.717) */ |
|
border-s-stone-300: border-inline-start-color: var(--color-stone-300); /* oklch(86.9% 0.005 56.366) */ |
|
border-s-stone-400: border-inline-start-color: var(--color-stone-400); /* oklch(70.9% 0.01 56.259) */ |
|
border-s-stone-500: border-inline-start-color: var(--color-stone-500); /* oklch(55.3% 0.013 58.071) */ |
|
border-s-stone-600: border-inline-start-color: var(--color-stone-600); /* oklch(44.4% 0.011 73.639) */ |
|
border-s-stone-700: border-inline-start-color: var(--color-stone-700); /* oklch(37.4% 0.01 67.558) */ |
|
border-s-stone-800: border-inline-start-color: var(--color-stone-800); /* oklch(26.8% 0.007 34.298) */ |
|
border-s-stone-900: border-inline-start-color: var(--color-stone-900); /* oklch(21.6% 0.006 56.043) */ |
|
border-s-stone-950: border-inline-start-color: var(--color-stone-950); /* oklch(14.7% 0.004 49.25) */ |
|
border-s-(<custom-property>): border-inline-start-color: var(<custom-property>); |
|
border-s-[<value>]: border-inline-start-color: <value>; |
|
``` |