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

Is there any reason to use @supports here? #2

Closed
mirisuzanne opened this issue Oct 24, 2016 · 2 comments
Closed

Is there any reason to use @supports here? #2

mirisuzanne opened this issue Oct 24, 2016 · 2 comments

Comments

@mirisuzanne
Copy link

You have this example:

:root {
  --vh-offset: 0px;
}
main {
  min-height: calc(100vh);
  @supports (height: var(--vh-offset)) {
    min-height: calc(100vh - var(--vh-offset));
  }
}

but it seems like it should work just as well without @supports:

:root {
  --vh-offset: 0px;
}
main {
  min-height: calc(100vh);
  min-height: calc(100vh - var(--vh-offset));
}
  • If var() is not supported, that second value will be ignored, leaving you with the first 100vh value.
  • If var() is supported, but vh-offset isn't needed, it will be set to 0px still, and have no effect.
@Hiswe
Copy link
Owner

Hiswe commented Oct 25, 2016

@mirisuzanne You point it right, no real reason…

I think I was just in the mood of over-engineering :S

I will modify documentation accordingly. Thank you very much for this :)

@mirisuzanne
Copy link
Author

Great, thanks for the vh-check — very useful!

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

No branches or pull requests

2 participants