Skip to content

Commit

Permalink
feat: improved match accuracy (#3)
Browse files Browse the repository at this point in the history
* feat: 对颜色采用严格模式匹配

* refactor: use internal Color

* chore: add debug page

* chore: move demo

* chore: fix test error

* chore: update

* chore: revert fix error

* chore: update

* chore: revert demo

Co-authored-by: binyellow <binyellow@users.noreply.github.com>
  • Loading branch information
Wxh16144 and binyellow committed Dec 15, 2023
1 parent ef28e6c commit 46350e3
Show file tree
Hide file tree
Showing 15 changed files with 937 additions and 464 deletions.
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ LICENSE
.eslintcache
*.lock
yarn-error.log
_*.md
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@
]
},
"dependencies": {
"@ctrl/tinycolor": "^4"
"@ctrl/tinycolor": "^4",
"@rc-component/color-picker": "^1.4.1"
},
"devDependencies": {
"@commitlint/cli": "^17",
Expand Down
2 changes: 1 addition & 1 deletion playground/.dumirc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const isProdSite = process.env.PREVIEW !== '1' && isProd;
const githubRepoName = 'dumi-plugin-color-chunk';

export default defineConfig({
plugins: [githubRepoName],
plugins: [githubRepoName, 'dumi-plugin-code-snippets'],
themeConfig: {
name: 'color-chunk',
socialLinks: {
Expand Down
36 changes: 36 additions & 0 deletions playground/docs/example/_example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
`red`
`yellow`
`violet`
`deepskyblue`

`#123`
`#1677ff`
`#2333`
`#12345678`

`rgb(123,3,2)`
`rgba(12,3,2,.2)`
`rgba(12,3,2,12%)`

`hsv(12,3,12)`
`hsva(12,3,22,.8)`
`hsva(12,3,22,22%)`

`hsb(12,99,2)`
`hsba(124,233,2,.24)`

`hsl(12,3,198)`
`hsl(0, 100%, 75%)`
`hsla(12,3,52,.2)`
`hsla(9, 100%, 64%, 0.2)`

<!-- invalid -->
---

`[12,32,144]`

[`12`,`32`,`144`]

`123`

`#123456789`
11 changes: 11 additions & 0 deletions playground/docs/example/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: Examples
---

## input

<<< ./\_example.md

## output

<embed src="./_example.md"></embed>
1 change: 1 addition & 0 deletions playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
},
"devDependencies": {
"dumi": "^2",
"dumi-plugin-code-snippets": "^1",
"dumi-plugin-color-chunk": "workspace:*"
}
}
Loading

0 comments on commit 46350e3

Please sign in to comment.