{"id":34745351,"url":"https://github.com/khaphanspace/100vh","last_synced_at":"2026-05-16T16:39:38.817Z","repository":{"id":280179476,"uuid":"309861162","full_name":"khaphanspace/100vh","owner":"khaphanspace","description":"100vh doesn't work as you expected","archived":false,"fork":false,"pushed_at":"2020-11-10T07:04:45.000Z","size":3,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-22T07:18:16.356Z","etag":null,"topics":["css","trick"],"latest_commit_sha":null,"homepage":"https://100vh.vercel.app/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/khaphanspace.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-04T02:31:49.000Z","updated_at":"2022-04-28T06:40:35.000Z","dependencies_parsed_at":"2025-03-01T19:39:47.056Z","dependency_job_id":"2c76fbdd-a6e1-47af-ab59-e7d3b997cd4a","html_url":"https://github.com/khaphanspace/100vh","commit_stats":null,"previous_names":["nhatkha1407/100vh","khaphanspace/100vh"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/khaphanspace/100vh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khaphanspace%2F100vh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khaphanspace%2F100vh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khaphanspace%2F100vh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khaphanspace%2F100vh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/khaphanspace","download_url":"https://codeload.github.com/khaphanspace/100vh/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khaphanspace%2F100vh/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33109925,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T04:41:52.686Z","status":"ssl_error","status_checked_at":"2026-05-16T04:41:52.009Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["css","trick"],"created_at":"2025-12-25T04:30:55.192Z","updated_at":"2026-05-16T16:39:38.813Z","avatar_url":"https://github.com/khaphanspace.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Hello There!\n\n`100vh`  is  `100% of the viewport height`. We often use this unit in the hero section, modal, header.. and it has a very common issue on mobile that you can see in an image below.\n\n\u003cimg width=\"1713\" alt=\"100vh.png (227.5 kB)\" src=\"https://img.esa.io/uploads/production/attachments/11171/2020/11/10/53804/e74a548e-398e-467f-9175-f288871526c1.png\"\u003e\n\nAs you can see we have a `navigation bar` at the bottom of the browser float on our site and `100vh` does not work properly. And each browser `navigation bar` has a different height, so we do `not have a fixed value` to calculate this height.\n\nTo resolve an issue we can use a trick below:\n\n```css\n.my-element {\n  height: 100vh; /* Fallback for browsers that do not support Custom Properties */\n  height: calc(var(--vh, 1vh) * 100);\n}\n```\n\n```js\n// We listen to the resize event\nwindow.addEventListener('resize', () =\u003e {\n  // We execute the same script as before\n  let vh = window.innerHeight * 0.01;\n  document.documentElement.style.setProperty('--vh', `${vh}px`);\n});\n```\n\nPlease be careful when using CSS variables, because your browser can be not supported, please check details here: https://caniuse.com/css-variables\n\n:point_right: **Demo**: https://100vh.vercel.app/ *(Please open on mobile to see what happens)*\n\nHope this helps!\n\n## Reference\n- https://css-tricks.com/the-trick-to-viewport-units-on-mobile/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhaphanspace%2F100vh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkhaphanspace%2F100vh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhaphanspace%2F100vh/lists"}