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

[Optimization] Initial background #41

Closed
Semigradsky opened this issue Jan 13, 2022 · 1 comment
Closed

[Optimization] Initial background #41

Semigradsky opened this issue Jan 13, 2022 · 1 comment

Comments

@Semigradsky
Copy link

Semigradsky commented Jan 13, 2022

Before:

    .a {
        background: none
    }
    .b {
        background: none center
    }
    .c {
        background: url("test.png") transparent none repeat scroll
    }

After:

.a{background:#0000}.b{background:50% 50%}.c{background:url("test.png") transparent none repeat scroll}

For .a we even have deoptimization (none vs #0000).

Possible optimised output (from csso):

.a{background:0 0}.b{background:center}.c{background:url(test.png)}
@devongovett
Copy link
Member

background:url("test.png") transparent none repeat scroll is invalid (if you remove the none it works), which is why it doesn't minify (Parcel CSS simply passes through properties that cannot be parsed correctly). Changing it how csso does changes the behavior, which we'd like to avoid.

The others look like good optimizations though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants