-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrated to faster PostCSS v8 API - thanks @ai
- Loading branch information
Showing
4 changed files
with
21 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,19 @@ | ||
import path from "path" | ||
|
||
import { Once } from "postcss" | ||
import { Declaration } from "postcss" | ||
|
||
import { declProcessor } from "./core/declProcessor" | ||
|
||
export default (options = {}) => ({ | ||
postcssPlugin: "postcss-dark-theme-class", | ||
Once(root, { result }) { | ||
const opts = result.opts | ||
const from = opts.from ? path.dirname(opts.from) : "." | ||
const to = opts.to ? path.dirname(opts.to) : from | ||
postcssPlugin: "postcss-smart-asset", | ||
Declaration(decl, { result }) { | ||
const opts = result.opts | ||
const from = opts.from ? path.dirname(opts.from) : "." | ||
const to = opts.to ? path.dirname(opts.to) : from | ||
|
||
const promises = [] | ||
return declProcessor(from, to, options, result, decl) | ||
} | ||
}) | ||
|
||
root.walkDecls((decl) => { | ||
promises.push(declProcessor(from, to, options, result, decl)) | ||
}) | ||
|
||
return Promise.all(promises) | ||
} | ||
}) | ||
|
||
// PostCSS v8 | ||
// PostCSS v8 marker | ||
export const postcss = true |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"include": ["src"], | ||
"lib": ["dom", "dom.iterable", "esnext"], | ||
"allowJs": true, | ||
"skipLibCheck": true, | ||
|