Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: CSS output extra details about lang(*) dir(*) #8405

Closed
1yasa opened this issue Nov 12, 2024 · 7 comments
Closed

[Bug]: CSS output extra details about lang(*) dir(*) #8405

1yasa opened this issue Nov 12, 2024 · 7 comments
Assignees
Labels
bug Something isn't working pending triage The issue/PR is currently untouched.

Comments

@1yasa
Copy link

1yasa commented Nov 12, 2024

System Info

System:
OS: macOS 14.4
CPU: (32) x64 13th Gen Intel(R) Core(TM) i9-13900KF
Memory: 6.79 GB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.8.0 - /usr/local/bin/node
npm: 10.8.2 - /usr/local/bin/npm
pnpm: 9.9.0 - /usr/local/bin/pnpm
bun: 1.1.24 - /usr/local/bin/bun
Watchman: 2024.06.10.00 - /usr/local/bin/watchman

Details

After update to rsapck version > 0.1.4 , build app then output css that has extra unnessary content:

Image

Here is the origin css:

.__editor_block_special {
	padding-inline-start: 0;
	padding-inline-end: 0;
	margin-inline-start: var(--editor_padding_x);
	margin-inline-end: var(--editor_padding_x);
}

Tried custom LightningCssMinimizerRspackPlugin options:

optimization: {
	minimizer: [
		new LightningCssMinimizerRspackPlugin({
			minimizerOptions: {
				exclude: {
					langSelectorList: true,
					dirSelector: true
				}
			}
		})
	]
}

Still dir selector exsit:

Image

Temp resolution is downgrading rspack version to 1.0.4 or set targets to chrome >= 120:

optimization: {
	minimizer: [
		new LightningCssMinimizerRspackPlugin({
			minimizerOptions: {
				targets: 'chrome >= 120'
			}
		})
	]
}

Reproduce link

No response

Reproduce Steps

see above.

@1yasa 1yasa added bug Something isn't working pending triage The issue/PR is currently untouched. labels Nov 12, 2024
@inottn
Copy link
Collaborator

inottn commented Nov 12, 2024

Refer to #7811.

@1yasa
Copy link
Author

1yasa commented Nov 12, 2024

Refer to #7811.

Seem not to solve the problem for default downgrade application css. This default behavior is unacceptable.

@chenjiahan
Copy link
Member

Hi, you should set a proper targets for lightningcss, as lightningcss will downgrade modern CSS features to fit to the current target browsers.

@1yasa
Copy link
Author

1yasa commented Dec 10, 2024

Hi, you should set a proper targets for lightningcss, as lightningcss will downgrade modern CSS features to fit to the current target browsers.

This behavior is unreasonable and unacceptable.

@chenjiahan
Copy link
Member

If lightningcss does not downgrade the CSS, it will not work in legacy browsers.

If you have any suggestions on the transformation results of lightingcss, please file an issue in the lightningcss repository: https://github.com/parcel-bundler/lightningcss

@1yasa
Copy link
Author

1yasa commented Dec 10, 2024

If lightningcss does not downgrade the CSS, it will not work in legacy browsers.

If you have any suggestions on the transformation results of lightingcss, please file an issue in the lightningcss repository: https://github.com/parcel-bundler/lightningcss

My concern stems from rspack's "default settings" here, which are unrelated to lightningcss. Rspak should establish a default configuration that prevents lightningcss from arbitrarily downgrading CSS on its own.

This aligns with developers' understanding of packaging tools like webpack, without the need to delve into any messy details beyond packaging.

@chenjiahan
Copy link
Member

I totally understand your claim. Unfortunately, lightningcss does not currently allow to do this. refer to parcel-bundler/lightningcss#792

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pending triage The issue/PR is currently untouched.
Projects
None yet
Development

No branches or pull requests

4 participants