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

calc prefixes break complex values #228

Open
nsaunders opened this issue Mar 3, 2022 · 1 comment
Open

calc prefixes break complex values #228

nsaunders opened this issue Mar 3, 2022 · 1 comment

Comments

@nsaunders
Copy link
Contributor

It looks like browser prefixes aren't properly applied to complex values that include calc expressions.

Considering current widespread support, are the prefixes still needed anyway?

Given:

padding (px 1) (px 1) (px 1) (em 1.0 @-@ px 1)

Expected:

{
  padding:1px 1px 1px -webkit-calc(1em - 1px);
  padding:1px 1px 1px -moz-calc(1em - 1px);
  padding:1px 1px 1px -ms-calc(1em - 1px);
  padding:1px 1px 1px -o-calc(1em - 1px);
  padding:1px 1px 1px calc(1em - 1px);
}

Actual:

{
  padding:-webkit-1px 1px 1px calc(1em - 1px);
  padding:-moz-1px 1px 1px calc(1em - 1px);
  padding:-ms-1px 1px 1px calc(1em - 1px);
  padding:-o-1px 1px 1px calc(1em - 1px);
  padding:1px 1px 1px calc(1em - 1px);
}
@turion
Copy link
Collaborator

turion commented Mar 4, 2022

Considering current widespread support, are the prefixes still needed anyway?

Yes, I think it would be ok to remove them.

It's still interesting to understand how this error comes across: The trouble is in the Semigroup instance of Value, which boils down to:

merge (Plain x ) (Prefixed ys) = Prefixed (map (second (x <>)) ys)

When you do <> on values, and one of them has prefixes like the browsers, the prefixes will move to the outside. Spoiler alert: padding is defined using <>. Not sure what would be the cleanest solution, if not removing the browser prefixes for calc.

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