💨 Soothing pastel theme for Tailwind CSS

Overview

Logo
Catppuccin for TailwindCSS

Preview

You can check out one of our deployed examples here!

Usage

  1. Install the plugin
$ npm install -D @catppuccin/tailwindcss
# --- or ---
$ yarn add -D @catppuccin/tailwindcss
  1. Configure your tailwind.config.js
module.exports = {
  // ...other settings
  plugins: [
    require('@catppuccin/tailwindcss'),
  ],
}
  1. Optional: customize the plugin
module.exports = {
  // ...other settings
  plugins: [
    require('@catppuccin/tailwindcss')({
      // prefix to use, e.g. `text-pink` becomes `text-ctp-pink`.
      // default is `false`, which means no prefix
      prefix: 'ctp',
      // which flavour of colours to use by default, in the `:root`
      defaultFlavour: 'latte'
    }),
  ],
}
  1. Use it in your markup!
<!-- switching the class for parent elements changes the flavour! -->
<body class="frappe">
  <h1 class="bg-base text-pink">
    Hello world!
  </h1>
</body>

You can find examples for Next.js, Svelte, and Vite in the examples folder.

💝 Thanks to

 

Copyright © 2021-present Catppuccin Org

You might also like...

Logseq-craft-theme - Craft Theme for Logseq

Logseq-craft-theme - Craft Theme for Logseq

Craft for Logseq Almost all creativity requires purposeful play. A Craft insprir

Oct 26, 2022

Theme Redone is a custom WordPress theme starter/framework with its own Gutenberg blocks solution and a CLI that speeds up the block creation process.

Theme Redone is a custom WordPress theme starter/framework with its own Gutenberg blocks solution and a CLI that speeds up the block creation process.

Theme Redone The Framework for Developing Custom WordPress Themes with its own Gutenberg Blocks creation solution. Theme Redone is a custom WordPress

Dec 30, 2022

⏪ Rewinds – Remix Tailwind Starter Kit with Tailwind CSS, Headless UI, Radix UI, and more

⏪ Rewinds – Remix Tailwind Starter Kit with Tailwind CSS, Headless UI, Radix UI, and more

⏪ Rewinds – Remix Tailwind Starter Kit Rewinds is a Remix starter kit with Tailwind CSS v3 family of libraries. This is an example demo to combine the

Dec 24, 2022

A Tailwind plugin that allows to create multiple groups utilities such as group-card or group-1 and works with Tailwind 3 features and all variations.

Tailwind Labeled Groups A plugin that allows to create multiple groups utilities such as group-card or group-1 and works with Tailwind 3 features and

Nov 21, 2022

A starter project that includes theme switching functionality with Stitches CSS-in-JS and Remix SSR.

Welcome to Remix! Remix Docs Development From your terminal: npm run dev This starts your app in development mode, rebuilding assets on file changes.

Dec 22, 2022

A JavaScript library to apply light-dark theme in web pages with the help of css variables

A JavaScript  library to apply light-dark theme in web pages with the help of css variables

Theme Changer The simplest JavaScript library to apply light - dark theme in your website. First Check Out One Example How to use Files index.html sty

Dec 20, 2022

Extract CSS custom properties and a JavaScript config from Drupal's theme breakpoints

Extract CSS custom properties and a JavaScript config from Drupal's theme breakpoints

Drupal breakpoints to CSS To eliminate the need for different places for breakpoints and only maintain a single source of truth for those, this node_m

Nov 21, 2022

♦ Crowd funding project using Smart Contracts on the Ethereum. Created with Next.js and Tailwind CSS.

♦ Crowd funding project using Smart Contracts on the Ethereum. Created with Next.js and Tailwind CSS.

Crowdcoin ♦ Crowd funding project using Smart Contracts on the Ethereum. Created with Next.js and Tailwind CSS. Project from "Ethereum and Solidity: T

Dec 14, 2022

Personal developer portfolio written with NextJS and Tailwind CSS.

Developer Portfolio This is a Next.js, Tailwind CSS blogging starter template. Probably the most feature rich nextjs markdown blogging template out th

Dec 20, 2021
Comments
  • Using other flavours inside an element that already contains a flavour seems to break the default flavour.

    Using other flavours inside an element that already contains a flavour seems to break the default flavour.

    Title may have been confusing, so I'll show an example.

    Suppose you have the defaultFlavour set to 'latte' and the class 'ctp-latte' on your body element. Now picture this theme picker:

    image

    It seems fine when the selected flavour is the default one. But when I change it to another one, Mocha for example: image

    It adopts the colors from the current flavour instead of keeping its own colors, even when its class is set to 'ctp-latte'. The code for each flavour demo is basically this:

    <div className='ctp-{flavor}'>
      // flavour name and demo colors
    </div>
    

    And I'm setting the global theme on the wrapping div on App.tsx (I'm using React). Hope you understand my explanation :)

    bug 
    opened by empsps 5
  • Themes root styles not in order

    Themes root styles not in order

    So this is some interesting behavior I found...

    I couldn't get the themes working with a defaultFlavour set (I think it was mocha or latte), so I investigated in the generated CSS and saw that my root styles were not on top of the document. CSS literally means Cascading Style Sheet, so this is a bug and shouldn't be happening.

    The problem is the variants map, which has a fixed order and doesn't put the defaultFlavour dynamically on top of the other variants (in first place/index inside the map).

    I edited the plugin myself and made a fix for this... I could enhance this and contribute later when I have some free time.

    // generates the css variables, injected in the addBase() function
    const generateColorCss = (defaultFlavour = "", prefix = false) => {
    	const result = {};
    	variants.map((variant) => {
    		// if a prefix is defined, use e.g. '.ctp-mocha' instead of '.mocha'
    		const className = prefix ? `.${prefix}-${variant}` : `.${variant}`;
    
    		// if the current variant is defaultFlavour, add to ':root'
    		const keyName = variant === defaultFlavour ? ":root" : className;
    
    		result[keyName] = {};
    		colours.map((colour) => {
    			result[keyName][`--ctp-${colour}`] = parseHexToRGB(
    				palette[variant][colour]
    			);
    		});
    	});
    	return result;
    };
    
    // generates the css variables, injected in the addBase() function
    const generateColorCss = (defaultFlavour = "", prefix = false) => {
    	const result = {};
    
    	if (variants.includes(defaultFlavour)) {
        		const defaultIndex = variants.indexOf(defaultFlavour);
        		const rootElement = variants.splice(defaultIndex, 1)[0];
        		variants.unshift(rootElement);
    	}
    
    	variants.map((variant) => {
    		// if a prefix is defined, use e.g. '.ctp-mocha' instead of '.mocha'
    		const className = prefix ? `.${prefix}-${variant}` : `.${variant}`;
    
    		// if the current variant is defaultFlavour, add to ':root'
    		const keyName = variant === defaultFlavour ? ":root" : className;
    
    		result[keyName] = {};
    		colours.map((colour) => {
    			result[keyName][`--ctp-${colour}`] = parseHexToRGB(
    				palette[variant][colour]
    			);
    		});
    	});
    	return result;
    };
    

    If someone wants a more detailed description: The variants map looks like this (if I can remember correctly):

    • latte
    • frappe
    • macchiato
    • mocha

    The classes get added to the CSS in this order. If your defaultFlavour is mocha, it gets added as root element.
    Now the Problem is this: When you want to apply the latte theme it gets overridden by the mocha root variants, which is not good.

    opened by elias-knodel 4
  • Tailwind fails to find its styles after adding the plugin

    Tailwind fails to find its styles after adding the plugin

    hey!

    I have an app running with DaisyUI and a couple of custom styles like this:

    .sumiu-gradient-rules {
      @apply bg-gradient-to-r from-pink-400 via-purple-400 to-indigo-500;
      @apply dark:from-blue-600  dark:to-purple-400;
    }
    

    as soon as I add the plugin, without any config, just require("@catppuccin/tailwindcss"), I start to see errors like this

    14:04:45 css.1  | Rebuilding...
    14:04:45 css.1  | CssSyntaxError: tailwindcss: /Users/luiz/Projects/sumiu/app/assets/stylesheets/application.tailwind.css:10:3: The `focus:ring-blue-400` class does not exist. If `focus:ring-blue-400` is a custom class, make sure it is defined within a `@layer` directive.
    14:04:45 css.1  |
    14:04:45 css.1  |    8 |   @apply text-gray-900 bg-gray-50 rounded-lg placeholder:text-slate-400;
    14:04:45 css.1  |    9 |   @apply dark:bg-[#1f2129] dark:border-gray-600 dark:text-white dark:placeholder:text-slate-500;
    14:04:45 css.1  | > 10 |   @apply focus:outline-none focus:ring-1 focus:ring-blue-400 focus:border-blue-400;
    

    ring-blue-400 is a class from tailwind and now it can't be found. It happens to a number of other classes as well, like from-pink-400, text-blue-900, etc.

    opened by luizkowalski 2
  • Are color previews supposed to work?

    Are color previews supposed to work?

    I got a bit disappointed when the little squares showing the color preview didn't work. I'm not sure if that's possible with plugins but it would be nice to have them.

    image

    enhancement help wanted 
    opened by empsps 7
Owner
Catppuccin
Soothing pastel theme for the high-spirited!
Catppuccin
Soothing pastel theme for Blink Shell

Catppuccin for Blink Shell Usage Navigate to the .js file with the theme of your choosing. Copy the URL. Open the settings panel in Blink Shell using

Catppuccin 9 Dec 23, 2022
🦉 Soothing pastel theme for Insomnia!

Catppuccin for Insomnia Usage Install In Insomnia, go to Application and select Preferences Click on Plugins Paste insomnia-plugin-catppuccin into the

Catppuccin 21 Dec 31, 2022
My XFCE dotties - The GTK theme as well as the kvantume theme used here are forks of the Matcha GTK/kvantum theme

DOTFILES OF MY XFCE SETUP The GTK theme as well as the kvantume theme used here

Mehedi Rahman Mahi 201 Dec 31, 2022
🌗 1 line of code to apply auto dark / light theme and support custom theme for your website. Super fast and lightweight theme library.

themes.js A super lightweight and fast Theme library with auto system color scheme detection in JavaScript. Features Auto detect Dark / Light mode by

SerKo 4 Nov 29, 2022
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
🍃 Create soothing focus mixes

Groovi ?? Create soothing concentration mixes Branding/Design Board · Demo ?? Quickstart Run the website locally git clone https://github.com/harshhhd

Harsh Singh 21 Nov 29, 2022
Playful and Colorful One-Page portfolio featuring Parallax effects and animations. Especially designers and/or photographers will love this theme! Built with MDX and Theme UI.

Gatsby Starter Portfolio: Cara Playful and Colorful One-Page portfolio featuring Parallax effects and animations. Using the Gatsby Theme @lekoarts/gat

prashanth s 1 Dec 24, 2021