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

Do not remove prefixes when using -webkit-line-clamp #1510

Closed
Goodwine opened this issue Feb 27, 2024 · 2 comments · Fixed by #1511
Closed

Do not remove prefixes when using -webkit-line-clamp #1510

Goodwine opened this issue Feb 27, 2024 · 2 comments · Fixed by #1511

Comments

@Goodwine
Copy link
Contributor

This was previously discussed offline by @ai and @nex3, I'm just summarizing here:

Given this input:

.foo {
  flex-direction: column;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

And passing "last 1 chrome version"

Results on this output:

.foo {
  flex-direction: column;
  display: -webkit-box;
  -webkit-line-clamp: 4;
}

The -webkit-box-orient declaration got deleted, and this causes browsers to fail doing their line-clamp thingy because:

“It only works in combination with the display property set to -webkit-box or -webkit-inline-box and the -webkit-box-orient property set to vertical.”
http://go/mdn/CSS/-webkit-line-clamp#content

@ai suggestion was (2023-Jul-10) to check for -webkit-line-clamp in the same rule. If it exists, don't remove -webkit-box-orient.

Note, this will not work 100% of the times, because I would write the declarations in separate rules:

.foo {
  display: -webkit-box;
}
.foo {
  flex-direction: column;
  -webkit-box-orient: vertical;
}
.foo {
  -webkit-line-clamp: 4;
}

And Autoprefixer would still delete -webkit-box-orient.

@Goodwine
Copy link
Contributor Author

This issue is somewhat related to #1322, but not entirely

@ai
Copy link
Member

ai commented Feb 27, 2024

Please, send PR

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

Successfully merging a pull request may close this issue.

2 participants