Skip to content

Commit 2f3c1e4

Browse files
committed
docs: add further documentation about custom styles
1 parent 1dbb4fc commit 2f3c1e4

File tree

1 file changed

+58
-1
lines changed

1 file changed

+58
-1
lines changed

README.md

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
This repository contains a library of reusable React components extracted from the main [**BigBlueButton (BBB)**](https://github.com/bigbluebutton/bigbluebutton) project. These components provide a consistent and customizable interface that can be reused in other projects, allowing them to easily adopt the BBB visual identity.
44

5-
65
## Peer Dependencies
76

87
This library requires the following peer dependencies to be installed in your project:
@@ -22,6 +21,64 @@ react-icons ^5.5.0
2221

2322
Make sure to install these dependencies to avoid runtime errors and ensure compatibility.
2423

24+
## Color Customization with CSS Variables
25+
26+
This library supports overriding component colors using CSS custom properties (variables). You can define these variables in your project's global CSS or stylesheets to customize the appearance of components without modifying the library code. This is particularly useful for theming and maintaining consistency with your application's design system.
27+
28+
To use this feature:
29+
1. Define the CSS variables in your project's root styles (e.g., in a global CSS file or via styled-components' `createGlobalStyle`).
30+
2. The library's components will automatically pick up these variables if they are set on the `:root` element or a parent container.
31+
32+
**Note**: These variables are optional. If not defined, the components will fall back to their default styled-components theme values, which are derived from the project's `src/stylesheets/palette.ts` file.
33+
34+
### Available CSS Variables
35+
36+
The following table lists the supported CSS variables for color overriding, extracted from `src/stylesheets/palette.ts`. Each variable corresponds to a specific color aspect used in the components (e.g., neutrals, brands, semantics). The "Maps to BBB Core Variable" column indicates if the variable aligns with a standard BBB core color (based on the file's comments). The "Default Value" column shows the fallback color used if the variable is not set.
37+
38+
| Variable Name | Maps to BBB Core Variable | Default Value |
39+
|----------------------------|----------------------------|---------------|
40+
| `--color-neutral-2` | No | #717C91 |
41+
| `--color-neutral-3` | No | #B0BDC9 |
42+
| `--color-neutral-4` | No | #DCE4EC |
43+
| `--color-neutral-white` | No | #FFFFFF |
44+
| `--color-light-gray` | No | #F4F6FA |
45+
| `--color-gray` | No | #4E5A66 |
46+
| `--color-dark-gray` | No | #393C48 |
47+
| `--color-brand-1` | No | #1D65D4 |
48+
| `--color-brand-2` | No | #1D65D4 |
49+
| `--color-brand-3` | No | #1D65D4 |
50+
| `--color-brand-light` | Yes (`--color-blue-aux`) | #E5EFFB |
51+
| `--color-brand-aux` | Yes (`--color-brand-aux`) | #E5EFFB |
52+
| `--color-success` | No | #2DD36F |
53+
| `--color-warning` | No | #F59240 |
54+
| `--color-error` | Yes (`--color-danger`) | #D6232D |
55+
| `--color-error-dark` | Yes (`--color-danger-dark`)| #B91C25 |
56+
| `--color-background-white` | No | #FFFFFF |
57+
| `--color-background-light` | No | #F4F6FA |
58+
| `--color-background-blue` | No | #E5EFFB |
59+
| `--color-border-default` | No | #B0BDC9 |
60+
| `--color-border-selected` | No | #1D65D4 |
61+
| `--color-border-error` | No | #D6232D |
62+
| `--color-border-default` | Yes (`--default-border`) | #B0BDC9 |
63+
| `--color-text-default` | No | #393C48 |
64+
| `--color-text-light` | No | #717C91 |
65+
| `--color-icon-default` | No | #717C91 |
66+
| `--color-icon-blue` | No | #1D65D4 |
67+
| `--color-icon-white` | No | #FFFFFF |
68+
| `--color-hover-dark` | No | #1E53AF |
69+
| `--color-hover-light` | No | #D4E5FA |
70+
| `--color-hover-neutral` | No | #DCE4EC |
71+
72+
**Example Usage**:
73+
```css
74+
:root {
75+
--color-primary: #ff5733; /* Override primary brand color to a custom orange */
76+
--color-text-default: #333333; /* Darker text for better contrast */
77+
}
78+
```
79+
80+
If you need to override colors for specific components or add new variables, refer to the component's `styles.ts` file for implementation details.
81+
2582
## Installation
2683

2784
This library is under active development and has not yet been published on npm. For now, you can clone the repository and install it locally.

0 commit comments

Comments
 (0)