Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = false
insert_final_newline = false
insert_final_newline = false
3 changes: 0 additions & 3 deletions .eslintrc

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 18
cache: "pnpm"
cache: pnpm
- run: pnpm install
- run: pnpm typecheck
- run: pnpm build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Release
on:
push:
tags:
- 'v*'
- "v*"

jobs:
release:
Expand All @@ -23,7 +23,7 @@ jobs:
with:
node-version: 18
cache: pnpm
registry-url: 'https://registry.npmjs.org'
registry-url: "https://registry.npmjs.org"

- run: npx changelogithub
env:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ node_modules
dist
temp
coverage
.eslintcache
51 changes: 24 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,45 +62,44 @@ export default defineConfig({

```


### Type Declarations

```ts
export type ThemeColors = Record<string, string | (string | number)[] | Record<string, string | (string | number)[]>>;

export interface CssVarName {
(name: string): string
prefix?: string
suffix?: string
(name: string): string;
prefix?: string;
suffix?: string;
}

export interface PaletteOptions {

/**
* define theme colors
*/
themeColors?: ThemeColors
themeColors?: ThemeColors;
/**
* @deprecated
*/
colors?: ThemeColors
* @deprecated
*/
colors?: ThemeColors;
/**
* @see "@vueuse/core/useColorMode"
*/
* @see "@vueuse/core/useColorMode"
*/
colorMode?: {
/**
* @default ':root'
*/
selector?: string
* @default ':root'
*/
selector?: string;
/**
* @default 'class'
*/
attribute?: string
* @default 'class'
*/
attribute?: string;
/**
* @default 'light'
*/
defaultValue?: string
}
* @default 'light'
*/
defaultValue?: string;
};

/**
* use opacity variable
Expand All @@ -113,19 +112,17 @@ export interface PaletteOptions {
* ```
* @default true
*/
useOpacityVariable?: boolean
useOpacityVariable?: boolean;

/**
* @default --un-palette-[name]-color
*/
cssVarName?: CssVarName
* @default --un-palette-[name]-color
*/
cssVarName?: CssVarName;

colorFormat?: "rgb" | "hsl"
colorFormat?: "rgb" | "hsl";
}

```


### License

MIT License © 2022-PRESENT [Chizukicn](https://github.com/chizukicn)
3 changes: 3 additions & 0 deletions eslint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { curev } from "@curev/eslint-config";

export default curev();
46 changes: 23 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "unocss-preset-palette",
"type": "module",
"version": "0.3.6",
"packageManager": "pnpm@8.15.6",
"packageManager": "pnpm@9.15.4",
"description": "Palette Preset for UnoCSS",
"author": "chizukicn",
"license": "MIT",
Expand All @@ -24,8 +24,8 @@
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.cjs",
"import": "./dist/index.mjs"
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
}
},
"main": "./dist/index.cjs",
Expand All @@ -41,7 +41,7 @@
"build": "unbuild",
"build:playground": "vite build playground",
"release": "bumpp package.json --commit \"release: v\" --push --tag",
"lint": "eslint --ext .ts,.tsx .",
"lint": "eslint --cache",
"prepare": "npx simple-git-hooks",
"typecheck": "tsc --noEmit --skipLibCheck",
"test": "vitest",
Expand All @@ -50,39 +50,39 @@
"up:polyfill": "nolyfill install"
},
"peerDependencies": {
"@unocss/core": "<1",
"@unocss/preset-mini": "<1"
"@unocss/core": ">=65",
"@unocss/preset-mini": ">=65"
},
"dependencies": {
"csstype": "^3.1.3"
},
"devDependencies": {
"@curev/eslint-config": "^0.3.7",
"@vitejs/plugin-vue-jsx": "^3.1.0",
"@vitest/coverage-v8": "^1.4.0",
"@vueuse/core": "^10.9.0",
"bumpp": "^9.4.0",
"eslint": "^8.57.0",
"lint-staged": "^15.2.2",
"nolyfill": "^1.0.30",
"prettier": "^3.2.5",
"@curev/eslint-config": "^0.4.0",
"@vitejs/plugin-vue-jsx": "^4.1.1",
"@vitest/coverage-v8": "^2.1.8",
"@vueuse/core": "^12.4.0",
"bumpp": "^9.10.1",
"eslint": "^9.18.0",
"lint-staged": "^15.3.0",
"nolyfill": "^1.0.43",
"prettier": "^3.4.2",
"simple-git-hooks": "^2.11.1",
"taze": "^0.13.3",
"taze": "^18.2.0",
"typescript": "5.3.2",
"unbuild": "^2.0.0",
"unocss": "0.59.0",
"vite": "^5.2.8",
"vitest": "^1.4.0",
"vue": "^3.4.21"
"unbuild": "^3.3.1",
"unocss": "65.4.0",
"vite": "^6.0.7",
"vitest": "^2.1.8",
"vue": "^3.5.13"
},
"pnpm": {
"overrides": {
"array-includes": "npm:@nolyfill/array-includes@latest",
"array.prototype.flat": "npm:@nolyfill/array.prototype.flat@latest",
"array.prototype.flatmap": "npm:@nolyfill/array.prototype.flatmap@latest",
"has": "npm:@nolyfill/has@latest",
"object.values": "npm:@nolyfill/object.values@latest",
"hasown": "npm:@nolyfill/hasown@latest"
"hasown": "npm:@nolyfill/hasown@latest",
"object.values": "npm:@nolyfill/object.values@latest"
}
},
"simple-git-hooks": {
Expand Down
2 changes: 1 addition & 1 deletion playground/main.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createApp, ref } from "vue";
import { useColorMode } from "@vueuse/core";
import { createApp, ref } from "vue";
import "uno.css";

type ModeType = "light" | "dark" | "cafe";
Expand Down
5 changes: 2 additions & 3 deletions playground/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { resolve } from "node:path";
import { defineConfig } from "vite";

import jsx from "@vitejs/plugin-vue-jsx";
import uno from "unocss/vite";

import uno from "unocss/vite";
import { defineConfig } from "vite";

// https://vitejs.dev/config/
export default defineConfig(() => ({
Expand Down
Loading
Loading