Unlike text and background color utilities, border color utilities redeclare the `border-color` property **without** an additional `--bs-border-opacity`, as opposed to resetting only `--bs-border-color`. This ensures the backward compatibility of border color utilities applying to other components while providing additional functionality through CSS variables.
Bootstrap `border-{color}` utilities are generated with Sass using CSS variables. This allows for real-time color changes without compilation and dynamic alpha transparency changes.
We use an RGB version of our `--bs-success` (with the value of `25, 135, 84`) CSS variable and attached a second CSS variable, `--bs-border-opacity`, for the alpha transparency (with a default value `1` thanks to a local CSS variable). That means anytime you use `.border-success` now, your computed `color` value is `rgba(25, 135, 84, 1)`. The local CSS variable inside each `.border-*` class avoids inheritance issues so nested instances of the utilities don't automatically have a modified alpha transparency.
### Example
To change that opacity, override `--bs-border-opacity` via custom styles or inline styles.
{{<example>}}
<divclass="border border-success p-2 mb-2">This is default success border</div>
<divclass="border border-success p-2"style="--bs-border-opacity: .5;">This is 50% opacity success border</div>
{{</example>}}
Or, choose from any of the `.border-opacity` utilities:
{{<example>}}
<divclass="border border-success p-2 mb-2">This is default success border</div>
<divclass="border border-success p-2 mb-2 border-opacity-75">This is 75% opacity success border</div>
<divclass="border border-success p-2 mb-2 border-opacity-50">This is 50% opacity success border</div>
<divclass="border border-success p-2 mb-2 border-opacity-25">This is 25% opacity success border</div>
<divclass="border border-success p-2 border-opacity-10">This is 10% opacity success border</div>
Border utilities are declared in our utilities API in `scss/_utilities.scss`. [Learn how to use the utilities API.]({{< docsref "/utilities/api#using-the-api" >}})