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

Error on grid component --minimum value #1

Closed
VirginiaDooley opened this issue Feb 8, 2021 · 3 comments
Closed

Error on grid component --minimum value #1

VirginiaDooley opened this issue Feb 8, 2021 · 3 comments

Comments

@VirginiaDooley
Copy link
Contributor

VirginiaDooley commented Feb 8, 2021

@supports (width: min(var(--minimum), 100%)) {

I'm getting this error:

b'sassc: error: Error: "var(--minumum)" is not a number for min'\n on line 14 of design-system/system/partials/_grid.scss\n>> @supports (width: min(var(--minumum), 100%)) {\n\n --------------------^'`

so I just wanted to check where exactly this is set (and maybe it's not available to me) or what data type should be passed into the style, assuming it needs to be set manually. Thank you!

@symroe
Copy link
Member

symroe commented Feb 10, 2021

Confirmed this is a problem that we see in Python's libsass implementation but not Dart scss.

In Dart, the grid is converted to the following CSS:

@supports (width: min(var(--minimum), 100%)) {                                                                                                                                   
  .ds-scope .ds-grid > * + * { 
    margin-top: 0;
  }
  .ds-scope .ds-grid {
    display: grid;
    grid-gap: var(--gridGap, 1.25rem);
    --gridCellMin: 30ch;
    grid-template-columns: repeat(auto-fit, minmax(min(var(--gridCellMin), 100%), 1fr));
  }
}

With Python libsass it tries to interpret --minumum as a sass var (I think) and returns null, resulting in the error Virginia pasted above.

@symroe
Copy link
Member

symroe commented Feb 10, 2021

Oh look:

we regularly see users confused as to why plain-CSS min() and max() don’t work and assuming Sass as a whole is at fault, when in fact it’s only LibSass that doesn’t support that feature.

https://sass-lang.com/blog/libsass-is-deprecated

Apparently LibSass is deprecated, meaning python users are left with no native bindings in to scss that is supported. The maintainer of the Python LibSass implementation suggests that this might not last, but it seems that the existing bugs are causing us problems already - this will only get worse as dart-sass and libsass diverge.

Let's have a chat about if we can work around it for the time being, or if we need to move to including npm in all of our project's build steps :/

@Heydon
Copy link
Collaborator

Heydon commented Feb 11, 2021

Fixed in master. Had to use a proxy Sass function to mock CSS's min().

Now, wherever we use min() it should render fine.

@Heydon Heydon closed this as completed Feb 11, 2021
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

3 participants