{"id":13759140,"url":"https://github.com/zirkeldesign/tailwindcss-stuck-variant","last_synced_at":"2026-03-01T17:37:11.900Z","repository":{"id":48459721,"uuid":"297902881","full_name":"zirkeldesign/tailwindcss-stuck-variant","owner":"zirkeldesign","description":"Adds a `stuck:` (and `group-stuck:`) variant to Tailwind CSS.","archived":false,"fork":false,"pushed_at":"2021-08-27T13:28:30.000Z","size":44,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-31T10:56:51.151Z","etag":null,"topics":["sticky","stuck","tailwind","tailwind-variant","tailwindcss","tailwindcss-plugin"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/zirkeldesign.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}},"created_at":"2020-09-23T08:25:16.000Z","updated_at":"2025-07-03T11:46:11.000Z","dependencies_parsed_at":"2022-08-27T12:02:09.905Z","dependency_job_id":null,"html_url":"https://github.com/zirkeldesign/tailwindcss-stuck-variant","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/zirkeldesign/tailwindcss-stuck-variant","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zirkeldesign%2Ftailwindcss-stuck-variant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zirkeldesign%2Ftailwindcss-stuck-variant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zirkeldesign%2Ftailwindcss-stuck-variant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zirkeldesign%2Ftailwindcss-stuck-variant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zirkeldesign","download_url":"https://codeload.github.com/zirkeldesign/tailwindcss-stuck-variant/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zirkeldesign%2Ftailwindcss-stuck-variant/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29976289,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T16:35:47.903Z","status":"ssl_error","status_checked_at":"2026-03-01T16:35:44.899Z","response_time":124,"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":["sticky","stuck","tailwind","tailwind-variant","tailwindcss","tailwindcss-plugin"],"created_at":"2024-08-03T13:00:47.191Z","updated_at":"2026-03-01T17:37:11.846Z","avatar_url":"https://github.com/zirkeldesign.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Tailwind CSS stuck variant\n\nAdds a `stuck:` and `group-stuck:` variant to Tailwind CSS to style elements and child nodes which use the `.sticky` utility. Unfortunately since there is currently no CSS selector for `:stuck` Elements, this variant relies on a JavaScript helper, which uses the `IntersectionObserver` on those elements.\n\n## Installation\n\n```sh\n# Using npm\nnpm install @zirkeldesign/tailwindcss-stuck-variant\n\n# Using yarn\nyarn add @zirkeldesign/tailwindcss-stuck-variant\n```\n\n```js\n// tailwind.config.js\nmodule.exports = {\n  variants: {\n    height: [\"responsive\", \"stuck\"],\n    // or with extending the default variants\n    // @see https://tailwindcss.com/docs/configuring-variants#extending-default-variants\n    backgroundColor: ({ after }) =\u003e after([\"stuck\", \"group-stuck\"]),\n    // or in Tailwind CSS \u003e= v2.0\n    extend: {\n      backgroundColor: [\"stuck\", \"group-stuck\"],\n    },\n  },\n  plugins: [\n    // Other plugins...\n    require(\"@zirkeldesign/tailwindcss-stuck-variant\"),\n  ],\n};\n```\n\n```js\n// app.js\nrequire(\"@zirkeldesign/tailwindcss-stuck-variant/src/observer\")();\n```\n\nOR\n\n```js\n// Vue 2 app.js\nimport stuck from \"@zirkeldesign/tailwindcss-stuck-variant/src/observer\";\n\nconst app = new Vue({\n  el: \"#app\",\n  mounted() {\n    stuck();\n  },\n});\n```\n\n## Usage\n\n```html\n\u003c!-- Add shadow when the header is stuck. --\u003e\n\u003cheader class=\"sticky top-0 group stuck:shadow\"\u003e\n  \u003c!-- Take the full height when its parent is stuck. --\u003e\n  \u003cdiv class=\"h-12 group-stuck:h-8\"\u003eBrand\u003c/div\u003e\n\u003c/header\u003e\n```\n\n## Passing custom parameters\n\nUnder the hood, the following defaults are set:\n\n```js\n{\n  selector = \".sticky\",\n  stuckClass = \"is-stuck\",\n  helperClass = \"stuck-observer-helper\",\n  createHelperElement = true,\n  rootMargin = \"-1px 0px 0px 0px\",\n}\n```\n\nThese may be overridden by passing a configuration object to the initializer:\n\n```js\nimport stuck from \"@zirkeldesign/tailwindcss-stuck-variant/src/observer\";\n\nstuck({\n  rootMargin: \"-50px 0px 0px 0px\",\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzirkeldesign%2Ftailwindcss-stuck-variant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzirkeldesign%2Ftailwindcss-stuck-variant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzirkeldesign%2Ftailwindcss-stuck-variant/lists"}