Skip to content

Commit

Permalink
feat: typescript rewrite (catppuccin#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
nekowinston authored Jun 23, 2023
1 parent db4dbae commit 0270b7f
Show file tree
Hide file tree
Showing 11 changed files with 5,715 additions and 4,895 deletions.
13 changes: 13 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"env": {
"node": true
},
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
"ignorePatterns": ["dist", "examples"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["@typescript-eslint"]
}
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist/
*.md
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,50 +17,51 @@

## Preview

You can check out one of our deployed examples [here](https://tailwindcss.catppuccin.com)!
You can check out one of our deployed examples
[here](https://tailwindcss.catppuccin.com)!

## Usage

1. Install the plugin

```sh
$ npm install -D @catppuccin/tailwindcss
# --- or ---
$ yarn add -D @catppuccin/tailwindcss
```

2. Configure your `tailwind.config.js`

```js
module.exports = {
// ...other settings
plugins: [
require('@catppuccin/tailwindcss'),
],
}
plugins: [require("@catppuccin/tailwindcss")],
};
```

3. *Optional:* customize the plugin
3. _Optional:_ customize the plugin

```js
module.exports = {
// ...other settings
plugins: [
require('@catppuccin/tailwindcss')({
require("@catppuccin/tailwindcss")({
// prefix to use, e.g. `text-pink` becomes `text-ctp-pink`.
// default is `false`, which means no prefix
prefix: 'ctp',
prefix: "ctp",
// which flavour of colours to use by default, in the `:root`
defaultFlavour: 'latte'
defaultFlavour: "latte",
}),
],
}
};
```

4. Use it in your markup!

```html
<!-- switching the class for parent elements changes the flavour! -->
<body class="frappe">
<h1 class="bg-base text-pink">
Hello world!
</h1>
<h1 class="bg-base text-pink">Hello world!</h1>
</body>
```

Expand Down
Loading

0 comments on commit 0270b7f

Please sign in to comment.