-
Notifications
You must be signed in to change notification settings - Fork 380
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
320ace5
commit e238722
Showing
8 changed files
with
43 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { divides } from '@unocss/preset-wind/rules' | ||
import { transformEmptyRule } from '../../utils/index.js' | ||
|
||
export default transformEmptyRule(divides) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { rings } from '@unocss/preset-mini/rules' | ||
import { transformEmptyRule } from '../../utils' | ||
|
||
export default transformEmptyRule(rings) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,19 @@ | ||
import { boxShadowsBase, boxShadows } from '@unocss/preset-mini/rules' | ||
import { colorableShadows, colorResolver, h, hasParseableColor } from '@unocss/preset-mini/utils' | ||
|
||
const findShadowColorRule = () => { | ||
return boxShadows.find(rule => { | ||
if (rule[0] instanceof RegExp && rule[0].test('shadow')) { | ||
return rule | ||
} | ||
return false | ||
}) || [] | ||
} | ||
|
||
const shadowColorRule = findShadowColorRule() | ||
const boxShadows = [ | ||
[/^shadow(?:-(.+))?$/, (match, context) => { | ||
const [, d] = match | ||
const { theme } = context | ||
const v = theme.boxShadow?.[d || 'DEFAULT'] | ||
const c = d ? h.bracket.cssvar(d) : undefined | ||
|
||
export default [ | ||
[shadowColorRule[0], (match, context) => { | ||
const rawHandler = shadowColorRule[1] | ||
const rawResult = rawHandler(match, context) | ||
if (rawResult['box-shadow']) { | ||
if ((v != null || c != null) && !hasParseableColor(c, theme, 'shadowColor')) { | ||
return { | ||
...boxShadowsBase, | ||
...rawResult | ||
'box-shadow': colorableShadows(v || c, '--un-shadow-color').join(',') | ||
} | ||
} else { | ||
// 工具类 | ||
return rawResult | ||
} | ||
return colorResolver('--un-shadow-color', 'shadow', 'shadowColor')(match, context) | ||
}] | ||
] | ||
|
||
export default boxShadows |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import { backgroundBlendModes } from '@unocss/preset-wind/rules' | ||
import { backgroundBlendModes, mixBlendModes } from '@unocss/preset-wind/rules' | ||
import { transformEmptyRule } from '../../utils/index.js' | ||
|
||
export default transformEmptyRule( | ||
backgroundBlendModes | ||
backgroundBlendModes, | ||
mixBlendModes | ||
) |