Skip to content

Commit

Permalink
Readme and other improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Buryak committed Oct 5, 2023
1 parent 8a72db2 commit eb41b35
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# Harmony: Accessible UI Color Palette

The [Harmony palette](https://www.figma.com/community/file/1287828769207775946/harmony-accessible-ui-color-palette) is designed to elevate control over color contrast in your design system. With the OKLCH color space and the innovative APCA contrast algorithm, Harmony offers highly consistent color shades, previously unavailable P3 gamut colors, and precise control over text and UI element contrast.

## Installation

```shell
npm install @evilmartians/harmony
```

## Usage
## Usage with Tailwind

Harmony can work as drop-in replacement for the Tailwind color palette
Harmony can work as drop-in replacement for the Tailwind color palette:

```js
// tailwind.config.js
Expand All @@ -23,11 +25,9 @@ export default {
};
```

## Polyfill

⚠️ Harmony uses `oklch` colors and requires a polyfill.
> ⚠️ Harmony uses `oklch` colors and so requires a polyfill
1. Install postcss plugin that polyfills oklch colors
1. Install PostCSS plugin that polyfills oklch colors

```shell
npm install -D @csstools/postcss-oklab-function
Expand All @@ -44,3 +44,7 @@ export default {
},
}
```

## Other formats

Plain javascript object with colors without tailwind's specifics can be imported from `@evilmartians/harmony/base`
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
},
"main": "dist/index.js",
"exports": {
"./tailwind": "./dist/tailwind/index.js"
"./tailwind": "./dist/tailwind/index.js",
"./base": "./dist/base/index.js"
},
"files": [
"dist/*"
Expand Down
6 changes: 5 additions & 1 deletion scripts/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
// deno-lint-ignore-file no-explicit-any

export function makeCJS(content: any) {
return `module.exports = ${JSON.stringify(content, null, 2)};`
return `'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
module.exports = ${JSON.stringify(content, null, 2)};
`
}

0 comments on commit eb41b35

Please sign in to comment.