{"id":21954184,"url":"https://github.com/cssobj/cssobj-plugin-extend","last_synced_at":"2026-04-15T08:38:10.393Z","repository":{"id":72105815,"uuid":"70122373","full_name":"cssobj/cssobj-plugin-extend","owner":"cssobj","description":"cssobj plugin to extend selector to another selector, like @extend in SCSS or $extend in LESS","archived":false,"fork":false,"pushed_at":"2016-10-19T06:39:14.000Z","size":6,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-21T12:38:21.599Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cssobj.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":"2016-10-06T04:22:14.000Z","updated_at":"2016-10-06T11:07:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"a937d5dd-c37c-4388-9a10-feda3b892c74","html_url":"https://github.com/cssobj/cssobj-plugin-extend","commit_stats":null,"previous_names":["futurist/cssobj-plugin-extend"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/cssobj/cssobj-plugin-extend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cssobj%2Fcssobj-plugin-extend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cssobj%2Fcssobj-plugin-extend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cssobj%2Fcssobj-plugin-extend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cssobj%2Fcssobj-plugin-extend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cssobj","download_url":"https://codeload.github.com/cssobj/cssobj-plugin-extend/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cssobj%2Fcssobj-plugin-extend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31833836,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T07:17:56.427Z","status":"ssl_error","status_checked_at":"2026-04-15T07:17:30.007Z","response_time":63,"last_error":"SSL_read: 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":[],"created_at":"2024-11-29T07:17:02.130Z","updated_at":"2026-04-15T08:38:10.361Z","avatar_url":"https://github.com/cssobj.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cssobj-plugin-extend\n\n[![Join the chat at https://gitter.im/css-in-js/cssobj](https://badges.gitter.im/css-in-js/cssobj.svg)](https://gitter.im/css-in-js/cssobj) [![Build Status](https://travis-ci.org/cssobj/cssobj-plugin-extend.svg?branch=master)](https://travis-ci.org/cssobj/cssobj-plugin-extend)\n\n[cssobj](https://github.com/cssobj/cssobj) plugin to extend selector to another selector, like @extend in SCSS or $extend in LESS.\n\n## Install\n\n- npm\n\n```shell\nnpm i cssobj-plugin-extend\n```\n\nThen\n\n```javascript\nvar cssobj = require('cssobj')\nvar cssobj_plugin_extend = require('cssobj-plugin-extend')\n\n// then consume the cssobj_plugin_extend below\ncssobj(obj, {\n  plugins: [ cssobj_plugin_extend(option) ]\n})\n```\n\n## Quick Start\n\n### **Extend single selector:**\n\n```javascript\nvar obj = {\n  'p': {\n    fontSize: '12px'\n  },\n  div:{\n    $extend: 'p',\n    color: 'red'\n  }\n}\n```\n\nResult css:\n\n``` css\np,div { font-size: 12px; }\ndiv { color: red; }\n```\n\n### **Extend with multiple selector:**\n\n\n```javascript\nvar obj = {\n  '.blue': {\n    color: 'blue'\n  },\n  'p': {\n    fontSize: '12px'\n  },\n  div:{\n    $extend: ['p', '.blue'],\n    color: 'red'\n  }\n}\n```\n\nResult css:\n\n``` css\n.blue,div { color: blue; }\np,div { font-size: 12px; }\ndiv { color: red; }\n```\n\n### **Extend with regexp:**\n\n```javascript\nvar obj = {\n  // clearfix hack\n  '.clearfix': {\n    '\u0026:before, \u0026:after': {\n      content: '\" \"',\n      display: 'table'\n    },\n    '\u0026:after': {\n      clear: 'both'\n    },\n    '\u0026': {\n      '*zoom': 1\n    }\n  },\n  div:{\n    $extend: /\\.clearfix/,\n    color: 'red'\n  }\n}\n```\n\nResult css:\n\n``` css\n.clearfix:before, .clearfix:after,div:before, div:after {\n  content: \" \";\n  display: table;\n}\n.clearfix:after,div:after {\n  clear: both;\n}\n.clearfix,div {\n  *zoom: 1;\n}\ndiv { color: red; }\n```\n\n## API\n\n#### cssobj_plugin_extend(option)\n\nreturn function as cssobj plugin.\n\n##### option.keyName\n\nDefault value: **$extend**, which means the intended key checking by this plugin is `$extend`, you can set it to any value start with `'$'`.\n\n```javascript\nvar obj = {\n  p: {color: 'red'},\n  div: {$ext: 'p'}\n}\n\n// use $ext as keyName\ncssobj(obj, {plugins: [cssobj_plugin_extend({keyName: '$ext'})]})\n```\n\n\n## Requirement\n\n**cssobj version \u003e= 0.5.5**\n\n## License\n\nMIT\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcssobj%2Fcssobj-plugin-extend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcssobj%2Fcssobj-plugin-extend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcssobj%2Fcssobj-plugin-extend/lists"}