Skip to content

Commit

Permalink
Upgrade postcss
Browse files Browse the repository at this point in the history
  • Loading branch information
diegohaz committed Apr 21, 2023
1 parent 3de008c commit f1c1fb6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 16 deletions.
14 changes: 9 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
"onigasm": "2.2.5",
"open-cli": "7.2.0",
"parse-numeric-range": "1.3.0",
"postcss": "8.4.21",
"postcss": "8.4.23",
"postcss-combine-duplicated-selectors": "10.0.3",
"postcss-import": "15.1.0",
"postcss-merge-selectors": "0.0.6",
Expand Down
13 changes: 3 additions & 10 deletions website/build-pages/parse-css-file.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { readFileSync } from "fs";
import { basename, dirname, extname } from "path";
import _postcss from "postcss";
import postcss from "postcss";
import combineDuplicatedSelectors from "postcss-combine-duplicated-selectors";
import postcssImport from "postcss-import";
// @ts-expect-error
Expand All @@ -11,10 +11,6 @@ import { format } from "prettier";
import { PurgeCSS } from "purgecss";
import _tailwindcss from "tailwindcss";

/** @type {import("postcss")["default"]} */
// @ts-expect-error
const postcss = _postcss;

/** @type {import("tailwindcss")["default"]} */
// @ts-expect-error
const tailwindcss = _tailwindcss;
Expand All @@ -31,6 +27,8 @@ const plugin = (opts = {}) => {
const rulesSeen = new Set();
return {
Rule(rule) {
// @ts-expect-error
if (rule.parent?.name === "keyframes") return;
if (rulesSeen.has(rule)) return;
rulesSeen.add(rule);
rule.selectors = rule.selectors.map((selector) => {
Expand Down Expand Up @@ -70,11 +68,6 @@ export async function parseCSSFile(filename, options) {
}

if (options.format) {
// processor.use(
// purgecss({
// content: [`${dirname(filename)}/**/*.{js,jsx,ts,tsx}`],
// })
// );
processor.use(
combineDuplicatedSelectors({ removeDuplicatedProperties: true })
);
Expand Down

1 comment on commit f1c1fb6

@vercel
Copy link

@vercel vercel bot commented on f1c1fb6 Apr 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

ariakit – ./

ariakit-git-main-ariakit.vercel.app
ariakit.org
ariakit-ariakit.vercel.app
www.ariakit.org

Please sign in to comment.