{"id":13564121,"url":"https://github.com/csstools/postcss-pseudo-class-enter","last_synced_at":"2025-04-28T17:31:02.324Z","repository":{"id":33743461,"uuid":"37398224","full_name":"csstools/postcss-pseudo-class-enter","owner":"csstools","description":"Use the :enter pseudo-class in CSS","archived":true,"fork":false,"pushed_at":"2020-10-24T07:40:19.000Z","size":37,"stargazers_count":28,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-21T21:38:04.810Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/csstools.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-14T03:56:20.000Z","updated_at":"2024-10-18T11:29:57.000Z","dependencies_parsed_at":"2022-08-26T12:12:16.356Z","dependency_job_id":null,"html_url":"https://github.com/csstools/postcss-pseudo-class-enter","commit_stats":null,"previous_names":["jonathantneal/postcss-pseudo-class-enter"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-pseudo-class-enter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-pseudo-class-enter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-pseudo-class-enter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-pseudo-class-enter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csstools","download_url":"https://codeload.github.com/csstools/postcss-pseudo-class-enter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250575044,"owners_count":21452669,"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-08-01T13:01:26.801Z","updated_at":"2025-04-28T17:31:02.289Z","avatar_url":"https://github.com/csstools.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# PostCSS Enter Pseudo Class [\u003cimg src=\"https://postcss.github.io/postcss/logo.svg\" alt=\"PostCSS\" width=\"90\" height=\"90\" align=\"right\"\u003e][PostCSS]\n\n[![NPM Version][npm-img]][npm-url]\n[![Build Status][cli-img]][cli-url]\n[![Support Chat][git-img]][git-url]\n\n[PostCSS Enter Pseudo Class] lets you use the proposed [`:enter`] pseudo-class\nin CSS.\n\n`:enter` simplifies selectors targeting elements that are “designated”, as in\ndesignated with a pointing device, rather than any device.\n\n\n```pcss\nnav :enter \u003e span {\n  background-color: yellow;\n}\n\n/* becomes */\n\nnav :hover \u003e span,\nnav :focus \u003e span {\n  background-color: yellow;\n}\n```\n\nFrom the [proposal]:\n\n\u003e The [`:enter`] pseudo-class applies while the user designates an element with\n\u003e a keyboard, pointing device, or other form of input. It matches an element if\n\u003e the element would match [`:focus`] or [`:hover`].\n\n## Usage\n\nAdd [PostCSS Enter Pseudo Class] to your project:\n\n```bash\nnpm install postcss-pseudo-class-enter --save-dev\n```\n\nUse [PostCSS Enter Pseudo Class] to process your CSS:\n\n```js\nconst postcssPseudoClassEnter = require('postcss-pseudo-class-enter');\n\npostcssPseudoClassEnter.process(YOUR_CSS /*, processOptions, pluginOptions */);\n```\n\nOr use it as a [PostCSS] plugin:\n\n```js\nconst postcss = require('postcss');\nconst postcssPseudoClassEnter = require('postcss-pseudo-class-enter');\n\npostcss([\n  postcssPseudoClassEnter(/* pluginOptions */)\n]).process(YOUR_CSS /*, processOptions */);\n```\n\n[PostCSS Enter Pseudo Class] runs in all Node environments, with special\ninstructions for:\n\n| [Node](INSTALL.md#node) | [PostCSS CLI](INSTALL.md#postcss-cli) | [Webpack](INSTALL.md#webpack) | [Create React App](INSTALL.md#create-react-app) | [Gulp](INSTALL.md#gulp) | [Grunt](INSTALL.md#grunt) |\n| --- | --- | --- | --- | --- | --- |\n\n## Options\n\n### prefix\n\nThe `prefix` option determines whether the `:enter` pseudo-class should use a\nprefix, and what that prefix will be.\n\n```js\npostcssPseudoClassEnter({ prefix: 'x' }); // transforms :-x-enter\n```\n\n#### outline\n\nType: `String`  \nDefault: unset\n\nThe `outline` option determines whether an outline declaration will be added to\nrules using the `:enter` pseudo-class. If a string is passed, its value will be\nused for the outline declaration.\n\n```js\npostcssPseudoClassEnter({ outline: true }); // adds outline: 0;\n```\n\n```js\npostcssPseudoClassEnter({ outline: 'none' }); // adds outline: none;\n```\n\n## Alternatives\n\nBelow are some other methods to recreate the effects of `:enter`.\n\n#### Use :focus and :hover (supported everywhere)\n\n```css\n:focus, :hover { /* ... */ }\n```\n\n#### Use :matches (supported in Firefox 4+, Chrome 12+, Opera 15+, Safari 5.1+)\n\n```css\n:matches(:focus, :hover) { /* ... */ }\n```\n\n#### Use @custom-selector (supported nowhere yet)\n\n```css\n@custom-selector :--enter :focus, :hover;\n\n:--enter { /* ... */ }\n```\n\n#### Use [Sass] mixins (requires preprocessing)\n\n```scss\n@mixin -enter { \u0026:focus, \u0026:hover { @content; } }\n\n@include -enter { /* ... */ }\n```\n\n[cli-img]: https://img.shields.io/travis/jonathantneal/postcss-pseudo-class-enter.svg\n[cli-url]: https://travis-ci.org/jonathantneal/postcss-pseudo-class-enter\n[git-img]: https://img.shields.io/badge/support-chat-blue.svg\n[git-url]: https://gitter.im/postcss/postcss\n[npm-img]: https://img.shields.io/npm/v/postcss-pseudo-class-enter.svg\n[npm-url]: https://www.npmjs.com/package/postcss-pseudo-class-enter\n\n[`:enter`]: https://discourse.specifiction.org/t/a-common-pseudo-class-for-hover-and-focus/877\n[`:focus`]: https://dev.w3.org/csswg/selectors/#focus-pseudo\n[`:hover`]: https://dev.w3.org/csswg/selectors/#visited-pseudo\n[PostCSS]: https://github.com/postcss/postcss\n[PostCSS Enter Pseudo Class]: https://github.com/jonathantneal/postcss-pseudo-class-enter\n[proposal]: https://discourse.specifiction.org/t/a-common-pseudo-class-for-hover-and-focus/877\n[Sass]: https://sass-lang.com/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsstools%2Fpostcss-pseudo-class-enter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsstools%2Fpostcss-pseudo-class-enter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsstools%2Fpostcss-pseudo-class-enter/lists"}