Skip to content

Commit a3a51a8

Browse files
authored
[docs] Add blurb about current bp6 namespace prefix to docs (#7527)
1 parent 50b2809 commit a3a51a8

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

packages/core/src/docs/classes.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,22 @@ defines `.@ns-button`.
7474
This CSS namespace is versioned by major version of the library so two major versions of Blueprint
7575
can be used together on a single page.
7676

77-
### Custom namespace
77+
@### Current namespace prefix
78+
79+
Blueprint v6 uses the **`bp6-`** prefix for all CSS classes. For example, Button components have the class `.bp6-button`, Cards have `.bp6-card`, etc. This prefix changes with each major version of Blueprint (e.g., v5 used `bp5-`, v6 uses `bp6-`).
80+
81+
When writing custom styles that target Blueprint components, you should reference the namespace using the `$ns` Sass variable rather than hardcoding the prefix:
82+
83+
```scss
84+
@use "@blueprintjs/core/lib/scss/variables.scss" as bp;
85+
86+
.my-class .#{bp.$ns}-button {
87+
// Custom styles for Blueprint buttons within .my-class
88+
background-color: red;
89+
}
90+
```
91+
92+
@### Custom namespace
7893

7994
The CSS namespace can be changed _at build time_ to produce a custom Blueprint build.
8095
With this approach, you will import Blueprint's Sass sources from `/lib/scss/` instead of the CSS files from the

packages/docs-data/compile-docs-data.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ console.info(`[docs-data] successfully generated docs.json`);
5353
async function generateDocumentalistData() {
5454
const documentalist = new Documentalist({
5555
markdown: {
56-
renderer: markedRenderer,
5756
hooks,
57+
renderer: markedRenderer,
5858
},
59-
sourceBaseDir: monorepoRootDir,
6059
// must mark our @Decorator APIs as reserved so we can use them in code samples
61-
reservedTags: ["import", "ContextMenuTarget", "HotkeysTarget", "param", "returns"],
60+
reservedTags: ["import", "ContextMenuTarget", "HotkeysTarget", "param", "returns", "use"],
61+
sourceBaseDir: monorepoRootDir,
6262
})
6363
.use(".md", {
6464
compile: files =>

0 commit comments

Comments
 (0)