{"id":24071434,"url":"https://github.com/bike-js/postcss-bike","last_synced_at":"2025-04-28T13:44:48.628Z","repository":{"id":25806232,"uuid":"105662067","full_name":"Bike-JS/postcss-bike","owner":"Bike-JS","description":"PostCSS plugin for transformation of custom At-rules to BEM-like rules","archived":false,"fork":false,"pushed_at":"2023-06-12T02:46:03.000Z","size":139,"stargazers_count":4,"open_issues_count":6,"forks_count":2,"subscribers_count":1,"default_branch":"release/2.0.0","last_synced_at":"2025-04-26T18:44:53.015Z","etag":null,"topics":["bem","bike","css","plugin","postcss","postcss-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/Bike-JS.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,"governance":null}},"created_at":"2017-10-03T14:33:07.000Z","updated_at":"2020-09-23T17:52:14.000Z","dependencies_parsed_at":"2023-01-14T03:27:52.077Z","dependency_job_id":"8aae4d81-750d-4f74-8991-10e89e28992d","html_url":"https://github.com/Bike-JS/postcss-bike","commit_stats":{"total_commits":40,"total_committers":3,"mean_commits":"13.333333333333334","dds":0.5,"last_synced_commit":"f2f827a84396ec7efe4185802f358bf423b6742c"},"previous_names":["artem-tolstykh/postcss-bike"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bike-JS%2Fpostcss-bike","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bike-JS%2Fpostcss-bike/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bike-JS%2Fpostcss-bike/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bike-JS%2Fpostcss-bike/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bike-JS","download_url":"https://codeload.github.com/Bike-JS/postcss-bike/tar.gz/refs/heads/release/2.0.0","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251321626,"owners_count":21570765,"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":["bem","bike","css","plugin","postcss","postcss-plugin"],"created_at":"2025-01-09T16:53:51.285Z","updated_at":"2025-04-28T13:44:48.615Z","avatar_url":"https://github.com/Bike-JS.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bike plugin [![npm version][npm-image]][npm-url] [![Deps][deps-image]][deps-url]\n\n\u003cimg align=\"right\" width=\"135\" height=\"95\"\n     title=\"Philosopher’s stone, logo of PostCSS\"\n     src=\"http://postcss.github.io/postcss/logo-leftp.svg\"\u003e\n\n\u003e This [PostCSS] plugin for implements transformation of custom At-rules to BEM-like rules\n\n[PostCSS]: https://github.com/postcss/postcss\n[posthtml-bike]: https://github.com/Satanpit/posthtml-bike\n\n## Install\n\n```\nnpm install -S @bikejs/postcss-bem\n```\n\n## Usage\n\n```javascript\nconst { readFileSync } = require('fs');\nconst postcss = require('postcss');\nconst bike = require('postcss-bike');\n\nconst css = readFileSync('input.css');\n\npostcss([bike()]).process(css).then((res) =\u003e console.log(output.css));\n```\n\n## Example\n\n### Default\n\n```css\n@component example {\n  display: flex;\n  flex-flow: column nowrap;\n  justify-content: space-between;\n  background-color: #f5f5f5;\n  color: #333;\n\n  @mod theme[dark] {\n    background-color: #333;\n    color: #f5f5f5;\n\n    @elem header, footer {\n      background-color: #1b1b1b;\n      color: #fff;\n    }\n  }\n\n  @elem header {\n    flex: 0 0 50px;\n    background-color: #fff;\n    color: #000;\n  }\n\n  @elem main {\n    flex: 1 1 auto;\n\n    @mod hidden {\n      display: none;\n    }\n  }\n\n  @elem footer {\n    flex: 0 0 50px;\n    background-color: #fff;\n    color: #000;\n  }\n}\n```\n\nTransformed to:\n\n```css\n.example {\n  display: flex;\n  flex-flow: column nowrap;\n  justify-content: space-between;\n  background-color: #f5f5f5;\n  color: #333;\n}\n.example_theme_dark {\n  background-color: #333;\n  color: #f5f5f5;\n}\n.example_theme_dark .example__header,\n.example_theme_dark .example__footer {\n  background-color: #1b1b1b;\n  color: #fff;\n}\n.example__header {\n  flex: 0 0 50px;\n  background-color: #fff;\n  color: #000;\n}\n.example__main {\n  flex: 1 1 auto;\n}\n.example__main_hidden {\n  display: none;\n}\n.example__footer {\n  flex: 0 0 50px;\n  background-color: #fff;\n  color: #000;\n}\n```\n\n## Options\n\n### `component`\n\ntype: `String`  \ndefault: `{component: 'component'}`\n\nAllows to set custom name for component `@rule`.\n\n### `element`\n\ntype: `String`  \ndefault: `{element: 'elem'}`\n\nAllows to set custom name for element `@rule`.\n\n### `modifier`\n\ntype: `String`  \ndefault: `{modifier: 'mod'}`\n\nAllows to set custom name for modifier `@rule`.\n\n### `modifierRegExp`\n\ntype: `RegExp`  \ndefault: `{modifierRegExp: /(\\w+)\\[(\\w+)\\]/}`\n\nAllows to set custom regular expressions for modifier params. Where `$1` is Modifier Name and `$2` is Modifier Value. For \nchanging Modifier Value Separator, change default separator `\\[$2\\]`, which goes before and after `$2` (only this `[ ]` symbols).\n\n\n### License [MIT](LICENSE)\n\n[travis-url]: https://travis-ci.org/Bike-JS/postcss-bike\n[travis-image]: http://img.shields.io/travis/Bike-JS/postcss-bike.svg?style=flat-square\n\n[npm-url]: https://www.npmjs.org/package/postcss-bike\n[npm-image]: http://img.shields.io/npm/v/postcss-bike.svg?style=flat-square\n\n[deps-url]: https://david-dm.org/artem-tolstykh/postcss-bike\n[deps-image]: https://david-dm.org/artem-tolstykh/postcss-bike.svg?style=flat-square\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbike-js%2Fpostcss-bike","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbike-js%2Fpostcss-bike","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbike-js%2Fpostcss-bike/lists"}