{"id":20414468,"url":"https://github.com/x-extends/dom-zindex","last_synced_at":"2025-04-12T16:44:44.900Z","repository":{"id":185658263,"uuid":"673851189","full_name":"x-extends/dom-zindex","owner":"x-extends","description":"Web common z-index style management","archived":false,"fork":false,"pushed_at":"2025-02-16T08:33:11.000Z","size":42,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-30T07:02:25.121Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/x-extends.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-08-02T15:06:30.000Z","updated_at":"2025-02-16T08:33:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"86b686f5-4f9a-4ebe-b734-10207f09dde6","html_url":"https://github.com/x-extends/dom-zindex","commit_stats":null,"previous_names":["x-extends/dom-zindex"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x-extends%2Fdom-zindex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x-extends%2Fdom-zindex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x-extends%2Fdom-zindex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x-extends%2Fdom-zindex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/x-extends","download_url":"https://codeload.github.com/x-extends/dom-zindex/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248600328,"owners_count":21131460,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-15T06:10:15.575Z","updated_at":"2025-04-12T16:44:44.894Z","avatar_url":"https://github.com/x-extends.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# z-index Manager\n\nEnglish | [简体中文](README.zh-CN.md)  \n\n[![gitee star](https://gitee.com/x-extends/dom-zindex/badge/star.svg?theme=dark)](https://gitee.com/x-extends/dom-zindex/stargazers)\n[![npm version](https://img.shields.io/npm/v/dom-zindex.svg?style=flat-square)](https://www.npmjs.com/package/dom-zindex)\n[![issues](https://img.shields.io/github/issues/x-extends/dom-zindex.svg)](https://github.com/x-extends/dom-zindex/issues)\n[![pull requests](https://img.shields.io/github/issues-pr/x-extends/dom-zindex.svg)](https://github.com/x-extends/dom-zindex/pulls)\n[![gzip size: JS](http://img.badgesize.io/https://unpkg.com/dom-zindex/dist/index.umd.min.js?compression=gzip\u0026label=gzip%20size:%20JS)](https://unpkg.com/dom-zindex/dist/index.umd.min.js)\n[![npm downloads](https://img.shields.io/npm/dm/dom-zindex.svg?style=flat-square)](http://npm-stat.com/charts.html?package=dom-zindex)\n[![npm license](https://img.shields.io/github/license/mashape/apistatus.svg)](LICENSE)\n\nWeb common z-index style management.\n\n## Browser Support\n\n![IE](https://raw.github.com/alrra/browser-logos/master/src/archive/internet-explorer_7-8/internet-explorer_7-8_48x48.png) | ![Edge](https://raw.github.com/alrra/browser-logos/master/src/edge/edge_48x48.png) | ![Chrome](https://raw.github.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png) | ![Firefox](https://raw.github.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png) | ![Opera](https://raw.github.com/alrra/browser-logos/master/src/opera/opera_48x48.png) | ![Safari](https://raw.github.com/alrra/browser-logos/master/src/safari/safari_48x48.png)\n--- | --- | --- | --- | --- | --- |\n7+ ✔ | 80+ ✔ | 44+ ✔ | 40+ ✔ | 60+ ✔ | 6+ ✔ |\n\n## Installing\n\n```shell\nnpm install dom-zindex\n```\n\n## CDN\n\npackage gzip \u003c= 900B\n\n```HTML\n\u003cscript src=\"https://unpkg.com/dom-zindex\"\u003e\u003c/script\u003e\n```\n\n## Example 1\n\n```javascript\nimport domZIndex from 'dom-zindex'\n\n// Gets the largest z-index on the page.\ndomZIndex.getMax()\n\n// Set main current z-index.\ndomZIndex.setCurrent(1000)\n\n// Get main current z-index.\ndomZIndex.getCurrent() // 1000\n\n// Get main next z-index.\ndomZIndex.getNext() // 1001\n\n// Get subordinate current z-index, the secondary z-index will always be greater than the primary z-index.\ndomZIndex.getSubCurrent() // 2001\n\n// Get subordinate next z-index.\ndomZIndex.getSubNext() // 2002\n```\n\n## Example 2\n\n```javascript\nimport domZIndex from 'dom-zindex'\n\n// If the incoming z-index is less than global, the next one is automatically fetched.\nlet currZIndex1 = 888\ncurrZIndex1 = domZIndex.getCurrent(currZIndex1) // 1000\n\n// If the z-index is greater than the global value, the value is returned.\nlet currZIndex2 = 2000\ncurrZIndex2 = domZIndex.getCurrent(currZIndex2) // 1500\n```\n\n## Css var\n\n* Built-in following variables\n  * ```--dom-main-z-index``` 等于 ```getCurrent```()\n  * ```--dom-sub-z-index``` 等于 ```getSubCurrent```()\n\n```css\n.my-popup {\n  z-index: var(--dom-main-z-index);\n}\n.my-msg {\n  z-index: var(--dom-sub-z-index);\n}\n```\n\n## Contributors\n\nThank you to everyone who contributed to this project.\n\n[![dom-zindex](https://contrib.rocks/image?repo=x-extends/dom-zindex)](https://github.com/x-extends/dom-zindex/graphs/contributors)\n\n## License\n\n[MIT](LICENSE) © 2019-present, Xu Liangzhan\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fx-extends%2Fdom-zindex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fx-extends%2Fdom-zindex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fx-extends%2Fdom-zindex/lists"}