Giter Site home page Giter Site logo

Comments (6)

ErikVeland avatar ErikVeland commented on June 11, 2024

If I remove the @supports it still doesn't calculate the offset. It definitely has

<style>​:root { --vh-offset: 69px; }​</style>​

in the DOM.

from vh-check.

ErikVeland avatar ErikVeland commented on June 11, 2024

Strangely it works if I removed the first declaration of min-height. If only I could get this to work with @supports now it would be perfect :/

from vh-check.

Hiswe avatar Hiswe commented on June 11, 2024

@ErikVeland I think It's because my example use a CSS pre-processor…

The code should be:

main {
  /* for browser supporting VH without buggy behaviour & no supporting of CSS var */
  min-height: calc(100vh);
}
/* make sure that CSS var are supported */
/* buggyFill will work on iOS 9.3+ only */
/* will degrade on a buggy 100vh on older version of iOS */
@supports (height: var(--vh-offset)) {
  main {
    min-height: calc(100vh - var(--vh-offset));
  }
}

I'll fix that ^^

from vh-check.

Hiswe avatar Hiswe commented on June 11, 2024

@ErikVeland I've updated the README and the examples.

Tell me if your problem is solved.

from vh-check.

ErikVeland avatar ErikVeland commented on June 11, 2024

Thank you. I got it working! Also noticed that the JavaScript example also assumes some sort of library with the require function (node.js?)

from vh-check.

Hiswe avatar Hiswe commented on June 11, 2024

@ErikVeland The JS code is build as an UMD module.

In the README, it's using browserify (I should make it more clear…)
But you could also use the file directly like in the test-global example

from vh-check.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.