{"id":16349464,"url":"https://github.com/jednano/postcss-all-link-colors","last_synced_at":"2025-03-23T00:33:21.405Z","repository":{"id":35337649,"uuid":"39599828","full_name":"jednano/postcss-all-link-colors","owner":"jednano","description":"PostCSS plugin to insert colors for all link-related pseudo-classes.","archived":false,"fork":false,"pushed_at":"2017-11-02T16:42:17.000Z","size":75,"stargazers_count":16,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T16:04:58.831Z","etag":null,"topics":["active","colors","focus","hover","link","postcss","postcss-plugin","visited"],"latest_commit_sha":null,"homepage":"","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/jednano.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-23T23:38:20.000Z","updated_at":"2025-02-27T14:21:31.000Z","dependencies_parsed_at":"2022-08-19T17:40:43.540Z","dependency_job_id":null,"html_url":"https://github.com/jednano/postcss-all-link-colors","commit_stats":null,"previous_names":["jedmao/postcss-all-link-colors"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jednano%2Fpostcss-all-link-colors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jednano%2Fpostcss-all-link-colors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jednano%2Fpostcss-all-link-colors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jednano%2Fpostcss-all-link-colors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jednano","download_url":"https://codeload.github.com/jednano/postcss-all-link-colors/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245040235,"owners_count":20551297,"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":["active","colors","focus","hover","link","postcss","postcss-plugin","visited"],"created_at":"2024-10-11T00:59:51.356Z","updated_at":"2025-03-23T00:33:21.142Z","avatar_url":"https://github.com/jednano.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# postcss-all-link-colors\n\n\u003cimg align=\"right\" width=\"135\" height=\"95\"\n\ttitle=\"Philosopher’s stone, logo of PostCSS\"\n\tsrc=\"http://postcss.github.io/postcss/logo-leftp.png\"\u003e\n\n[![NPM version](http://img.shields.io/npm/v/postcss-all-link-colors.svg?style=flat)](https://www.npmjs.org/package/postcss-all-link-colors)\n[![npm license](http://img.shields.io/npm/l/postcss-all-link-colors.svg?style=flat-square)](https://www.npmjs.org/package/postcss-all-link-colors)\n[![Travis Build Status](https://img.shields.io/travis/jedmao/postcss-all-link-colors.svg)](https://travis-ci.org/jedmao/postcss-all-link-colors)\n[![codecov](https://codecov.io/gh/jedmao/postcss-all-link-colors/branch/master/graph/badge.svg)](https://codecov.io/gh/jedmao/postcss-all-link-colors)\n[![Dependency Status](https://gemnasium.com/badges/github.com/jedmao/postcss-all-link-colors.svg)](https://gemnasium.com/github.com/jedmao/postcss-all-link-colors)\n\n[![npm](https://nodei.co/npm/postcss-all-link-colors.svg?downloads=true)](https://nodei.co/npm/postcss-all-link-colors/)\n\n[PostCSS](https://github.com/postcss/postcss) plugin to insert colors for link-related pseudo-classes.\n\n## Introduction\n\nAdding [link-related](https://developer.mozilla.org/en-US/docs/Web/CSS/%3Ahover) [pseudo-classes](https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes) can be a total pain. Just look at how much garbage we have to write!\n\n```css\na {\n\tcolor: red;\n}\na:visited {\n\tcolor: red;\n}\na:focus {\n\tcolor: red;\n}\na:hover {\n\tcolor: red;\n}\na:active {\n\tcolor: red;\n}\n```\n\nThis plugin allows you to simplify the above syntax into the following:\n\n```css\na {\n\t@link-colors all red;\n}\n```\n\nYou can override individual pseudo-classs like so:\n\n```css\na {\n\t@link-colors all red {\n\t\tfocus: white;\n\t\thover: blue;\n\t}\n}\n```\n\nThis transpiles into:\n\n```css\na {\n\tcolor: red;\n}\na:visited {\n\tcolor: red;\n}\na:focus {\n\tcolor: white;\n}\na:hover {\n\tcolor: blue;\n}\na:active {\n\tcolor: red;\n}\n```\n\nOf course, you don't have to color _all_ link-related pseudo-classes if you don't want. Just get rid of the `all` parameter to make the colors inclusive:\n\n```css\na {\n\t@link-colors red {\n\t\thover: white;\n\t}\n}\n```\n\nThis transpiles into:\n\n```css\na {\n\tcolor: red;\n}\na:hover {\n\tcolor: white;\n}\n```\n\nLink-related pseudo-classes are written in _LVHA-order:_ `:link` — `:visited` — `:hover` — `:active` with the following variations:\n- The `:link` pseudo-class is replaced by just `color`, as it covers not only links, but buttons and other elements as well.\n- The `:focus` pseudo-class is placed before or after `:hover`, depending on the order in which you specify it; thus, the desired effect.\n\n## Installation\n\n```\n$ npm install postcss-all-link-colors\n```\n\n## Usage\n\n### JavaScript\n\n```js\npostcss([ require('postcss-all-link-colors') ]);\n```\n\n### TypeScript\n\n```ts\nimport * as postcssAllLinkColors from 'postcss-all-link-colors';\n\npostcss([ postcssAllLinkColors ]);\n```\n\n## Options\n\nNone at this time.\n\n## Testing\n\nRun the following command:\n\n```\n$ npm test\n```\n\nThis will build scripts, run tests and generate a code coverage report. Anything less than 100% coverage will throw an error.\n\n### Watching\n\nFor much faster development cycles, run the following commands in 2 separate processes:\n\n```\n$ npm run build:watch\n```\n\nCompiles TypeScript source into the `./dist` folder and watches for changes.\n\n```\n$ npm run watch\n```\n\nRuns the tests in the `./dist` folder and watches for changes.\n\n## Similar projects\n\n- [`postcss-link-colors`](https://github.com/steffenmllr/postcss-link-colors)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjednano%2Fpostcss-all-link-colors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjednano%2Fpostcss-all-link-colors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjednano%2Fpostcss-all-link-colors/lists"}