{"id":15379423,"url":"https://github.com/tadatuta/postcss-css-to-bem-css","last_synced_at":"2025-06-17T12:37:28.351Z","repository":{"id":50812324,"uuid":"139605655","full_name":"tadatuta/postcss-css-to-bem-css","owner":"tadatuta","description":"postcss plugin to convert CSS to rebem-css","archived":false,"fork":false,"pushed_at":"2022-06-10T14:33:49.000Z","size":565,"stargazers_count":6,"open_issues_count":6,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-17T21:37:01.963Z","etag":null,"topics":["bem","convention","css","methodology","naming","postcss"],"latest_commit_sha":null,"homepage":null,"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/tadatuta.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":"2018-07-03T15:46:17.000Z","updated_at":"2022-04-10T17:44:09.000Z","dependencies_parsed_at":"2022-09-26T21:40:38.287Z","dependency_job_id":null,"html_url":"https://github.com/tadatuta/postcss-css-to-bem-css","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/tadatuta/postcss-css-to-bem-css","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tadatuta%2Fpostcss-css-to-bem-css","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tadatuta%2Fpostcss-css-to-bem-css/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tadatuta%2Fpostcss-css-to-bem-css/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tadatuta%2Fpostcss-css-to-bem-css/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tadatuta","download_url":"https://codeload.github.com/tadatuta/postcss-css-to-bem-css/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tadatuta%2Fpostcss-css-to-bem-css/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260359990,"owners_count":22997401,"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","convention","css","methodology","naming","postcss"],"created_at":"2024-10-01T14:19:04.426Z","updated_at":"2025-06-17T12:37:23.334Z","avatar_url":"https://github.com/tadatuta.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PostCSS Css To Bem Css [![Build Status][ci-img]][ci]\n\n[PostCSS] plugin to convert CSS to different [BEM notations](https://en.bem.info/methodology/naming-convention/).\n\n[PostCSS]: https://github.com/postcss/postcss\n[ci-img]:  https://travis-ci.org/tadatuta/postcss-css-to-bem-css.svg\n[ci]:      https://travis-ci.org/tadatuta/postcss-css-to-bem-css\n\n```css\n/* Input example */\n.b1__e1 {\n\n}\n\n/* Output example */\n.B1-E1 {\n\n}\n```\n\n## Usage\n\n```js\npostcss([\n    require('postcss-css-to-bem-css')({\n        sourceNaming: 'origin',\n        targetNaming: 'react'\n    })\n])\n```\n\n### Options\n* sourceNaming\n* targetNaming\n* transforms\n* stringify\n* blacklist\n* whitelist\n\nFor examples please refer to [specs](https://github.com/tadatuta/postcss-css-to-bem-css/blob/master/index.test.js).\n\nSee [PostCSS] docs for examples for your environment.\n\n### Convert all files in a folder\n```js\nconst fs = require('fs');\nconst util = require('util');\nconst postcss = require('postcss');\n\nconst readFile = util.promisify(fs.readFile);\nconst writeFile = util.promisify(fs.writeFile);\nconst glob = util.promisify(require('glob'));\nconst bemCss = postcss([require('postcss-css-to-bem-css')]);\n\nglob('**/*.css').then(files =\u003e\n    files.map(file =\u003e\n        readFile(file).then(originalCss =\u003e\n            bemCss.process(originalCss, { from: file })\n                .then(css =\u003e writeFile(file, css))\n        )\n    ));\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftadatuta%2Fpostcss-css-to-bem-css","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftadatuta%2Fpostcss-css-to-bem-css","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftadatuta%2Fpostcss-css-to-bem-css/lists"}