{"id":14968208,"url":"https://github.com/jeff2ma/postcss-decls-ref","last_synced_at":"2026-02-02T03:01:42.059Z","repository":{"id":57144573,"uuid":"86725210","full_name":"Jeff2Ma/postcss-decls-ref","owner":"Jeff2Ma","description":"A PostCSS plugin that extend declaration block from an existed rule with target selector (like sass`@extend`).","archived":false,"fork":false,"pushed_at":"2020-06-03T08:47:08.000Z","size":85,"stargazers_count":1,"open_issues_count":10,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-06T15:37:40.919Z","etag":null,"topics":["css","declaration","extend","postcss","postcss-plugin","ref","sass"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/Jeff2Ma.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}},"created_at":"2017-03-30T16:36:26.000Z","updated_at":"2019-03-02T13:46:14.000Z","dependencies_parsed_at":"2022-09-06T08:53:47.109Z","dependency_job_id":null,"html_url":"https://github.com/Jeff2Ma/postcss-decls-ref","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Jeff2Ma/postcss-decls-ref","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jeff2Ma%2Fpostcss-decls-ref","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jeff2Ma%2Fpostcss-decls-ref/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jeff2Ma%2Fpostcss-decls-ref/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jeff2Ma%2Fpostcss-decls-ref/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jeff2Ma","download_url":"https://codeload.github.com/Jeff2Ma/postcss-decls-ref/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jeff2Ma%2Fpostcss-decls-ref/sbom","scorecard":{"id":71863,"data":{"date":"2025-08-11","repo":{"name":"github.com/Jeff2Ma/postcss-decls-ref","commit":"52dc2ab986bdb1ca84ea81fcbc85637e0881331f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/4 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 26 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-15T03:58:26.342Z","repository_id":57144573,"created_at":"2025-08-15T03:58:26.342Z","updated_at":"2025-08-15T03:58:26.342Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29002628,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-02T01:32:03.847Z","status":"online","status_checked_at":"2026-02-02T02:00:07.448Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","declaration","extend","postcss","postcss-plugin","ref","sass"],"created_at":"2024-09-24T13:39:32.050Z","updated_at":"2026-02-02T03:01:42.044Z","avatar_url":"https://github.com/Jeff2Ma.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# postcss-decls-ref\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/Jeff2Ma/postcss-decls-ref.svg)](https://greenkeeper.io/)\n\n\u003cimg align=\"right\" width=\"130\" height=\"130\" title=\"PostCSS\" src=\"http://postcss.github.io/postcss/logo.svg\"\u003e\n\n[![Build Status](https://travis-ci.org/Jeff2Ma/postcss-decls-ref.svg?branch=master)](https://travis-ci.org/Jeff2Ma/postcss-decls-ref)\n[![Windows Build Status](https://ci.appveyor.com/api/projects/status/github/Jeff2Ma/postcss-decls-ref?branch=master\u0026svg=true)](https://ci.appveyor.com/project/Jeff2Ma/postcss-decls-ref)\n[![npm version](https://badge.fury.io/js/postcss-decls-ref.svg)](https://www.npmjs.com/package/postcss-decls-ref)\n[![change-log](https://img.shields.io/badge/changelog-md-blue.svg)](https://github.com/Jeff2Ma/postcss-decls-ref/blob/master/CHANGELOG.md)\n\n\u003e A PostCSS plugin that extend declaration block from an existed rule with target selector (like sass `@extend`).\n\n\n## Example\n\n### Input\n\n```css\n.classA {\n\tbackground-image: url(logo.svg);\n\twidth: 12px;\n\theight: 12px;\n}\n.classB {\n\tfloat: left;\n\t@ref .classA;\n}\n\n```\n\n### Output\n\n### 1) when option `refMod: 'clone'`\n\n```css\n.classA {\n\tbackground-image: url(logo.svg);\n\twidth: 12px;\n\theight: 12px;\n}\n.classB {\n\tfloat: left;\n\tbackground-image: url(logo.svg);\n\twidth: 12px;\n\theight: 12px;\n}\n```\n\n### 2) when option `refMod: 'group'`\n\n```css\n.classA, .classB {\n\tbackground-image: url(logo.svg);\n\twidth: 12px;\n\theight: 12px;\n}\n.classB {\n\tfloat: left;\n}\n```\n\n## Features\n\n- Support `@media` condition.\n\n- AtRule name can dynamic (default is `@ref`).\n\n## Installation\n\n```bash\nnpm install postcss-decls-ref --save-dev\n```\n## Usage\n\nWork with [Gulp](//gulpjs.com)\n\nExample:\n\n```javascript\nvar gulp = require('gulp');\nvar postcss = require('gulp-postcss');\nvar ref = require('postcss-decls-ref');\n\ngulp.task('css', function () {\n\treturn gulp.src('./input.css')\n\t\t.pipe(postcss([ref()]))\n\t\t.pipe(gulp.dest('./output'));\n});\n```\n\n## Options\n\n### refMod\n\n\u003e Decide the output css result. The value is `clone` or `group`. \n\n- Default: `'clone'`\n- Required: `false`\n\n### dynamicAtRule\n\n\u003e Dynamic the atRule name, remember not to rename the css existed one (like `@media`, `@support` , etc). `@` character is not needed. Recommend: `@ref`, `@apply`.\n\n- Default: `'ref'`\n- Required: `false`\n\n## Contributing\n\nIssues and Pull requests are welcome.\n\n```bash\n$ git clone github.com/Jeff2Ma/postcss-decls-ref\n$ cd postcss-decls-ref\n$ npm i\n$ gulp # for dev\n$ gulp test # for test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeff2ma%2Fpostcss-decls-ref","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeff2ma%2Fpostcss-decls-ref","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeff2ma%2Fpostcss-decls-ref/lists"}