Skip to content

Commit

Permalink
feat(core): more css variable to use
Browse files Browse the repository at this point in the history
  • Loading branch information
NWYLZW committed Jun 5, 2024
1 parent 8b63bfe commit ca08fed
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/core/src/creator/structureTransfomer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ export function shikitorStructureTransformer(
const bg = div.style.backgroundColor
const fg = div.style.color
target.style.setProperty(cssvar('fg-color'), fg)
for (let i = 1; i <= 9; i++) {
target.style.setProperty(
cssvar(`fg-color-op${i}`),
`color-mix(in oklch, var(${cssvar('fg-color')}), transparent ${i * 10}%)`
)
target.style.setProperty(
cssvar(`bg-color-op${i}`),
`color-mix(in oklch, var(${cssvar('bg-color')}), transparent ${i * 10}%)`
)
}
target.style.setProperty(cssvar('bg-color'), bg)
target.style.setProperty(
cssvar('caret-color'),
Expand Down

0 comments on commit ca08fed

Please sign in to comment.