Skip to content

Commit 8562ad1

Browse files
authored
Fork Martijn's repo (#2)
* Alter package.json * add typescript * Add CI stuff * Typescript migration * Add prettier * Bump deps * Add types * Fix types * Alter example project * Fix CI * Use pnpm 9 * Force corepack * Prepare initial publish * Alter links
1 parent 41a3202 commit 8562ad1

34 files changed

+4111
-2279
lines changed

.editorconfig

+11
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,14 @@ indent_style = space
88
insert_final_newline = true
99
tab_width = 2
1010
trim_trailing_whitespace = true
11+
quote_type = single
12+
13+
[*.md]
14+
trim_trailing_whitespace = false
15+
max_line_length = 0
16+
17+
[{*.yaml,*.yml}]
18+
quote_type = single
19+
20+
[{*.json}]
21+
quote_type = double

.gitattributes

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# https://www.aleksandrhovhannisyan.com/blog/crlf-vs-lf-normalizing-line-endings-in-git/#a-simple-gitattributes-config
2+
# We'll let Git's auto-detection algorithm infer if a file is text. If it is,
3+
# enforce LF line endings regardless of OS or git configurations.
4+
* text=auto eol=lf
5+
6+
# Isolate binary files in case the auto-detection algorithm fails and
7+
# marks them as text files (which could brick them).
8+
*.{png,jpg,jpeg,gif,webp,woff,woff2} binary

.github/CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @MartijnCuppens
1+
* @alexaka1

.github/CODE_OF_CONDUCT.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,21 @@ appearance, race, religion, or sexual identity and orientation.
1414
Examples of behavior that contributes to creating a positive environment
1515
include:
1616

17-
* Using welcoming and inclusive language
18-
* Being respectful of differing viewpoints and experiences
19-
* Gracefully accepting constructive criticism
20-
* Focusing on what is best for the community
21-
* Showing empathy towards other community members
17+
- Using welcoming and inclusive language
18+
- Being respectful of differing viewpoints and experiences
19+
- Gracefully accepting constructive criticism
20+
- Focusing on what is best for the community
21+
- Showing empathy towards other community members
2222

2323
Examples of unacceptable behavior by participants include:
2424

25-
* The use of sexualized language or imagery and unwelcome sexual attention or
25+
- The use of sexualized language or imagery and unwelcome sexual attention or
2626
advances
27-
* Trolling, insulting/derogatory comments, and personal or political attacks
28-
* Public or private harassment
29-
* Publishing others' private information, such as a physical or electronic
27+
- Trolling, insulting/derogatory comments, and personal or political attacks
28+
- Public or private harassment
29+
- Publishing others' private information, such as a physical or electronic
3030
address, without explicit permission
31-
* Other conduct which could reasonably be considered inappropriate in a
31+
- Other conduct which could reasonably be considered inappropriate in a
3232
professional setting
3333

3434
## Our Responsibilities
@@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
5555
## Enforcement
5656

5757
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58-
reported by contacting the project team at [email protected]. All
58+
reported by contacting the project team at [email protected]. All
5959
complaints will be reviewed and investigated and will result in a response that
6060
is deemed necessary and appropriate to the circumstances. The project team is
6161
obligated to maintain confidentiality with regard to the reporter of an incident.

.github/FUNDING.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
github: [MartijnCuppens]
1+
github: [alexaka1]

.github/dependabot.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
version: 2
22
updates:
3-
- package-ecosystem: "github-actions"
4-
directory: "/"
3+
- package-ecosystem: 'github-actions'
4+
directory: '/'
55
schedule:
66
interval: monthly
7-
- package-ecosystem: "github-actions"
8-
directory: "/examples/"
7+
- package-ecosystem: 'github-actions'
8+
directory: '/examples/'
99
schedule:
1010
interval: monthly

.github/workflows/main.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- '**'
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: pnpm/action-setup@v3
13+
with:
14+
version: 9
15+
- uses: actions/setup-node@v4
16+
with:
17+
node-version: 20.x
18+
cache: 'pnpm'
19+
20+
- run: corepack enable
21+
- run: pnpm install --frozen-lockfile
22+
- run: pnpm run lint && pnpm run build

.github/workflows/publish.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Publish
2+
on:
3+
workflow_run:
4+
workflows: [CI]
5+
branches: [main]
6+
types: [completed]
7+
8+
concurrency: ${{ github.workflow }}-${{ github.ref }}
9+
10+
permissions:
11+
contents: write
12+
pull-requests: write
13+
14+
jobs:
15+
publish:
16+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: pnpm/action-setup@v3
21+
with:
22+
version: 9
23+
- uses: actions/setup-node@v4
24+
with:
25+
node-version: 20.x
26+
cache: 'pnpm'
27+
28+
- run: corepack enable
29+
- run: pnpm install --frozen-lockfile
30+
- name: Create Release Pull Request or Publish
31+
id: changesets
32+
uses: changesets/action@v1
33+
with:
34+
publish: pnpm run release
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/test.yml

+9-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Tests
33
on:
44
push:
55
branches-ignore:
6-
- "dependabot/**"
6+
- 'dependabot/**'
77
pull_request:
88
workflow_dispatch:
99

@@ -18,20 +18,23 @@ jobs:
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
node: [16, 18, 20]
21+
node: [18, 20, 22]
2222

2323
steps:
2424
- name: Clone repository
2525
uses: actions/checkout@v4
26-
26+
- uses: pnpm/action-setup@v3
27+
with:
28+
version: 9
2729
- name: Set up Node.js
2830
uses: actions/setup-node@v4
2931
with:
3032
node-version: ${{ matrix.node }}
31-
cache: npm
33+
cache: 'pnpm'
3234

33-
- name: Install npm dependencies
34-
run: npm ci
35+
- run: corepack enable
36+
- name: Install pnpm dependencies
37+
run: pnpm install --frozen-lockfile
3538

3639
- name: Run examples
3740
run: cd examples && npm run build

.gitignore

+24
Original file line numberDiff line numberDiff line change
@@ -1 +1,25 @@
11
node_modules
2+
dist
3+
4+
### JetBrains template
5+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
6+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
7+
8+
# User-specific stuff
9+
.idea/**/workspace.xml
10+
.idea/**/tasks.xml
11+
.idea/**/usage.statistics.xml
12+
.idea/**/dictionaries
13+
.idea/**/shelf
14+
15+
# Generated files
16+
.idea/**/contentModel.xml
17+
18+
# Sensitive or high-churn files
19+
.idea/**/dataSources/
20+
.idea/**/dataSources.ids
21+
.idea/**/dataSources.local.xml
22+
.idea/**/sqlDataSources.xml
23+
.idea/**/dynamic.xml
24+
.idea/**/uiDesigner.xml
25+
.idea/**/dbnavigator.xml

.idea/.gitignore

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/encodings.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

+14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/prettier.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/tailwindcss-oklch.iml

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

+13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.prettierignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
dist
3+
pnpm-lock.yaml

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2023 Martijn Cuppens
3+
Copyright (c) 2024 Alex Martossy
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+16-14
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Tailwind OKLCH
22

3-
view on: [npm](https://www.npmjs.com/package/tailwindcss-oklch) - [GitHub](https://github.com/MartijnCuppens/tailwindcss-oklch)
3+
view on: [npm](https://www.npmjs.com/package/@alexaka1/tailwindcss-oklch) - [GitHub](https://github.com/alexaka1/tailwindcss-oklch)
4+
5+
This repo was cloned from [Martijn Cuppens's tailwindcss-oklch](https://github.com/MartijnCuppens/tailwindcss-oklch). Special thanks to Martijn for creating this plugin.
46

57
Brings OKLCH to Tailwind and introduces these helpful utilities:
68

@@ -23,10 +25,8 @@ Then, enable the plugin in your Tailwind config:
2325
```js
2426
/** @type {import('tailwindcss').Config} */
2527
module.exports = {
26-
plugins: [
27-
require('tailwindcss-oklch')(),
28-
],
29-
}
28+
plugins: [require('tailwindcss-oklch')()],
29+
};
3030
```
3131

3232
## Features
@@ -65,13 +65,15 @@ Precision was added since color.js uses floats to calculate the OKLCH values, wh
6565
```js
6666
/** @type {import('tailwindcss').Config} */
6767
module.exports = {
68-
plugins: [require('tailwindcss-oklch')({
69-
contrastThreshold: .5,
70-
precision: 8,
71-
minContrastLightness: 0,
72-
maxContrastLightness: 1,
73-
})],
74-
}
68+
plugins: [
69+
require('tailwindcss-oklch')({
70+
contrastThreshold: 0.5,
71+
precision: 8,
72+
minContrastLightness: 0,
73+
maxContrastLightness: 1,
74+
}),
75+
],
76+
};
7577
```
7678

7779
## Demo
@@ -126,8 +128,8 @@ You can later on change the colors without recompiling by setting the LCH values
126128
```css
127129
@layer base {
128130
:root {
129-
--color-primary-l: .32;
130-
--color-primary-c: .1;
131+
--color-primary-l: 0.32;
132+
--color-primary-c: 0.1;
131133
--color-primary-h: 150;
132134
}
133135
}

examples/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
!/dist/main.css

0 commit comments

Comments
 (0)