chore(deps): update dependency postcss-custom-media to v9 (#4630)

* chore(deps): update dependency postcss-custom-media to v9

* fix custom media plugin

* make path absolute

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: pngwn <hello@pngwn.io>
This commit is contained in:
renovate[bot] 2023-06-22 13:43:34 +01:00 committed by GitHub
parent 870786672c
commit 2f488e782c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 62 additions and 23 deletions

View File

@ -3,12 +3,15 @@ import { svelte } from "@sveltejs/vite-plugin-svelte";
import sveltePreprocess from "svelte-preprocess";
// @ts-ignore
import custom_media from "postcss-custom-media";
import global_data from "@csstools/postcss-global-data";
// @ts-ignore
import prefixer from "postcss-prefix-selector";
import { readFileSync } from "fs";
import { join } from "path";
const version_path = join(__dirname, "..", "..", "gradio", "version.txt");
const theme_token_path = join(__dirname, "..", "theme", "src", "tokens.css");
const version = readFileSync(version_path, { encoding: "utf-8" })
.trim()
.replace(/\./g, "-");
@ -75,19 +78,7 @@ export default defineConfig(({ mode }) => {
return prefixedSelector;
}
}),
custom_media({
importFrom: [
{
customMedia: {
"--screen-sm": "(min-width: 640px)",
"--screen-md": "(min-width: 768px)",
"--screen-lg": "(min-width: 1024px)",
"--screen-xl": "(min-width: 1280px)",
"--screen-xxl": "(min-width: 1536px)"
}
}
]
})
custom_media()
]
}
},
@ -100,7 +91,10 @@ export default defineConfig(({ mode }) => {
hot: !process.env.VITEST && !production,
preprocess: sveltePreprocess({
postcss: {
plugins: [custom_media()]
plugins: [
global_data({ files: [theme_token_path] }),
custom_media()
]
}
})
}),

View File

@ -0,0 +1,5 @@
@custom-media --screen-sm (min-width: 640px);
@custom-media --screen-md (min-width: 768px);
@custom-media --screen-lg (min-width: 1024px);
@custom-media --screen-xl (min-width: 1280px);
@custom-media --screen-xxl (min-width: 1536px);

View File

@ -34,6 +34,7 @@
"dependencies": {
"@changesets/changelog-github": "^0.4.8",
"@changesets/cli": "^2.26.1",
"@csstools/postcss-global-data": "^1.0.3",
"@gradio/tootils": "workspace:^0.0.1",
"@playwright/test": "^1.35.1",
"@sveltejs/vite-plugin-svelte": "^2.0.0",
@ -59,7 +60,7 @@
"polka": "^1.0.0-next.22",
"pollen-css": "^4.6.1",
"postcss": "^8.4.6",
"postcss-custom-media": "8",
"postcss-custom-media": "9",
"postcss-nested": "^5.0.6",
"postcss-prefix-selector": "^1.16.0",
"prettier": "^2.6.2",

View File

@ -1,4 +1,4 @@
lockfileVersion: '6.0'
lockfileVersion: '6.1'
settings:
autoInstallPeers: true
@ -14,6 +14,9 @@ importers:
'@changesets/cli':
specifier: ^2.26.1
version: 2.26.1
'@csstools/postcss-global-data':
specifier: ^1.0.3
version: 1.0.3(postcss@8.4.6)
'@gradio/tootils':
specifier: workspace:^0.0.1
version: link:js/tootils
@ -90,8 +93,8 @@ importers:
specifier: ^8.4.6
version: 8.4.6
postcss-custom-media:
specifier: '8'
version: 8.0.2(postcss@8.4.6)
specifier: '9'
version: 9.0.0(postcss@8.4.6)
postcss-nested:
specifier: ^5.0.6
version: 5.0.6(postcss@8.4.6)
@ -1199,6 +1202,40 @@ packages:
w3c-keyname: 2.2.6
dev: false
/@csstools/css-parser-algorithms@1.0.0(@csstools/css-tokenizer@1.0.0):
resolution: {integrity: sha512-lPphY34yfV15tEXiz/SYaU8hwqAhbAwqiTExv5tOfc7QZxT70VVYrsiPBaX1osdWZFowrDEAhHe4H3JnyzbjhA==}
engines: {node: ^14 || ^16 || >=18}
peerDependencies:
'@csstools/css-tokenizer': ^1.0.0
dependencies:
'@csstools/css-tokenizer': 1.0.0
dev: false
/@csstools/css-tokenizer@1.0.0:
resolution: {integrity: sha512-xdFjdQ+zqqkOsmee+kYRieZD9Cqh4hr01YBQ2/8NtTkMMxbtRX18MC50LX6cMrtaLryqmIdZHN9e16/l0QqnQw==}
engines: {node: ^14 || ^16 || >=18}
dev: false
/@csstools/media-query-list-parser@1.0.0(@csstools/css-parser-algorithms@1.0.0)(@csstools/css-tokenizer@1.0.0):
resolution: {integrity: sha512-HsTj5ejI8NKKZ4IEd6kK2kQZA/JmIVlUV8+XvO/YS9ntrlYPnbmFT3rkqtbxOVfEafblYCNOpeNw1c+fKGkAqw==}
engines: {node: ^14 || ^16 || >=18}
peerDependencies:
'@csstools/css-parser-algorithms': ^1.0.0
'@csstools/css-tokenizer': ^1.0.0
dependencies:
'@csstools/css-parser-algorithms': 1.0.0(@csstools/css-tokenizer@1.0.0)
'@csstools/css-tokenizer': 1.0.0
dev: false
/@csstools/postcss-global-data@1.0.3(postcss@8.4.6):
resolution: {integrity: sha512-x2fZOl7RJJtKC9ZfG+1bdrQKeRfP1a3Ff4uF2/fykNUKly8E8Q7lw7oegsEnqenSEDC1xjk6qXJ/fcJkTAdcNg==}
engines: {node: ^14 || ^16 || >=18}
peerDependencies:
postcss: ^8.4
dependencies:
postcss: 8.4.6
dev: false
/@esbuild/android-arm64@0.17.14:
resolution: {integrity: sha512-eLOpPO1RvtsP71afiFTvS7tVFShJBCT0txiv/xjFBo5a7R7Gjw7X0IgIaFoLKhqXYAXhahoXm7qAmRXhY4guJg==}
engines: {node: '>=12'}
@ -5760,14 +5797,16 @@ packages:
prettier: 2.8.1
dev: false
/postcss-custom-media@8.0.2(postcss@8.4.6):
resolution: {integrity: sha512-7yi25vDAoHAkbhAzX9dHx2yc6ntS4jQvejrNcC+csQJAXjj15e7VcWfMgLqBNAbOvqi5uIa9huOVwdHbf+sKqg==}
engines: {node: ^12 || ^14 || >=16}
/postcss-custom-media@9.0.0(postcss@8.4.6):
resolution: {integrity: sha512-HZvWFVMRRkJ92N2Typx8AV9ecQKjkLALd3uHJvVoq41GWdKqiB3GHWrzSmPiGtNWdrPbZIXs5RkNjkSHmCIfqA==}
engines: {node: ^14 || ^16 || >=18}
peerDependencies:
postcss: ^8.3
postcss: ^8.4
dependencies:
'@csstools/css-parser-algorithms': 1.0.0(@csstools/css-tokenizer@1.0.0)
'@csstools/css-tokenizer': 1.0.0
'@csstools/media-query-list-parser': 1.0.0(@csstools/css-parser-algorithms@1.0.0)(@csstools/css-tokenizer@1.0.0)
postcss: 8.4.6
postcss-value-parser: 4.2.0
dev: false
/postcss-import@14.1.0(postcss@8.4.21):