{"id":18240677,"url":"https://github.com/mattlaue/bootstrap-compiler","last_synced_at":"2026-05-08T06:35:53.616Z","repository":{"id":96246784,"uuid":"314695781","full_name":"mattlaue/bootstrap-compiler","owner":"mattlaue","description":"A library to compile Bootstrap V5 SCSS that can be used in a browser.","archived":false,"fork":false,"pushed_at":"2020-11-24T00:10:19.000Z","size":75,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-14T13:37:47.615Z","etag":null,"topics":["bootstrap","bootstrap5","scss"],"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/mattlaue.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-20T23:47:06.000Z","updated_at":"2020-11-24T00:10:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"fa2f07f5-ce72-4201-97ed-b9cbd9f7f430","html_url":"https://github.com/mattlaue/bootstrap-compiler","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"c03eb23ed4b69f8c75a3ba24eef9002f7025d016"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattlaue%2Fbootstrap-compiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattlaue%2Fbootstrap-compiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattlaue%2Fbootstrap-compiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattlaue%2Fbootstrap-compiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattlaue","download_url":"https://codeload.github.com/mattlaue/bootstrap-compiler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247886634,"owners_count":21012874,"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":["bootstrap","bootstrap5","scss"],"created_at":"2024-11-05T05:04:20.700Z","updated_at":"2025-10-29T22:14:13.220Z","avatar_url":"https://github.com/mattlaue.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![GitHub](https://img.shields.io/github/license/mattlaue/bootstrap-compiler?label=License)\n![Coverage](./badges/coverage.svg)\n\nA library to compile [Bootstrap][bootstrap] V5 SCSS that can be used in a browser.\n\n[bootstrap]: https://v5.getbootstrap.com/\n\n## Overview\n`bootstrap-compiler` is a Javascript library that builds a CSS stylesheet from the Bootstrap sources.\nIt's primarily intended to customize Bootstrap in a browser-based application.\n\n## Getting Started\nHere is an example usage that builds bootstrap with default options:\n\n```js\nconst bootstrapCompiler = require('bootstrap-compiler/dist/bootstrap-compiler');\n\nlet result = bootstrapCompiler.compile(bootstrapCompiler.SOURCE_CACHE['bootstrap']);\nlet css = result.css.toString();\n```\n\nThe `css` variable contains the generated CSS.\n\n## Javascript API\nThe `bootstrap-compiler` library uses a version of Dart SASS built for the browser to generate a CSS file.\nSince the library file contains a SASS compiler (2M uncompressed) and all Bootstrap source files (44K), the resulting file size is *big*,\n1.5MB minified, so plan accordingly. \n\nThe API consists of a single function `compile()` and two variables `SOURCE_CACHE` and  `BOOTSTRAP_VERSION`.\n\n### `compile()`\n```js\nlet result = bootstrapCompler.compile(scss, options)\n```\n\n* **`scss`** - The custom SCSS file to build.\nThe intended input is one of the top level Bootstrap source SCSS files\ne.g. [this](https://github.com/twbs/bootstrap/blob/main/scss/bootstrap.scss)\nbut any SCSS file will work.\nAny imports statements will be automatically replaced with the corresponding Bootstrap source.\n* **`options`** - The [options](https://sass-lang.com/documentation/js-api#options) object passed directly to Dart-SASS.\nThis object is passed as-is except for `data` is replaced with the above `scss` value and `file` is ignored.\n \nThe `compile` function returns a Dart SASS [result](https://sass-lang.com/documentation/js-api#result-object) object.\n\n### `SOURCE_CACHE`\nThe SOURCE_CACHE constant is a mapping of the Bootstrap source files keyed by the base file name \ne.g. the contents of `_variables.scss` are found via `SOURCE_CACHE['variables']`.\nSubdirectories of source files are concatenated under the directory name as well as stored by individual file names.\nFor example, `SOURCE_CACHE['forms']` contains the concatenation of all files in the `forms` subdirectory and the\nindividual file contents for `forms/_form-text.scss` is found via `SOURCE_CACHE['forms/form-text']`.\n\n### `BOOTSTRAP_VERSION`\nBOOTSTRAP_VERSION contains the version number of the contained Bootstrap source code, currently `5.0.0-alpha3`.\n\n\n## CLI\nThis package contains a command-line tool `bootstrap-compiler` which may be used to test the compiler against a\nspecified source file.  To build the full BS5 source from the command line do:\n\n```shell script\nbootstrap-compiler init  # creates style.scss in the current directory\nbootstrap-compiler compile  # creates style.css and style.css.map\n```\nThe primary use for the CLI is validation of the resulting library builds.\n\n## Development/Testing\n\nPlease submit any issues that you encounter via [GitHub]()\n\n### Testing\n```\nnpm link\nnpm link bootstrap-compiler\nnpx webpack\nnpm run test\n```\n\nThe library must be build using webpack *before* running Jest because several\ntest cases depend on both the source and the compiled result.\n(This is to validate the webpack build itself).\n\nThe tests require Node v12 or higher.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattlaue%2Fbootstrap-compiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattlaue%2Fbootstrap-compiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattlaue%2Fbootstrap-compiler/lists"}