forked from twbs/bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add utility classes for opacity (twbs#33781)
* Add responsive utility classes for opacity - fix for twbs#33483 * remove responsive opacity utils as it has impact on bootstrap.css bundle size * Update opacity.md * Update site/content/docs/5.0/utilities/opacity.md Co-authored-by: Mark Otto <otto@github.com> * Update site/content/docs/5.0/utilities/opacity.md Co-authored-by: Mark Otto <otto@github.com> Co-authored-by: Harish <halodoc@ip-192-168-1-101.ap-southeast-1.compute.internal> Co-authored-by: XhmikosR <xhmikosr@gmail.com> Co-authored-by: Mark Otto <otto@github.com> Co-authored-by: Mark Otto <markd.otto@gmail.com> Co-authored-by: alpadev <2838324+alpadev@users.noreply.github.com>
- Loading branch information
1 parent
ba6e181
commit fd315fa
Showing
3 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
layout: docs | ||
title: Opacity | ||
description: Control the opacity of elements. | ||
group: utilities | ||
--- | ||
|
||
The `opacity` property sets the opacity level for an element. The opacity level describes the transparency level, where `1` is not transparent at all, `.5` is 50% visible, and `0` is completely transparent. | ||
|
||
Set the `opacity` of an element using `.opacity-{value}` utilities. | ||
|
||
<div class="bd-example d-sm-flex"> | ||
<div class="opacity-100 p-3 m-2 bg-primary text-light fw-bold rounded">100%</div> | ||
<div class="opacity-75 p-3 m-2 bg-primary text-light fw-bold rounded">75%</div> | ||
<div class="opacity-50 p-3 m-2 bg-primary text-light fw-bold rounded">50%</div> | ||
<div class="opacity-25 p-3 m-2 bg-primary text-light fw-bold rounded">25%</div> | ||
</div> | ||
|
||
```html | ||
<div class="opacity-100">...</div> | ||
<div class="opacity-75">...</div> | ||
<div class="opacity-50">...</div> | ||
<div class="opacity-25">...</div> | ||
``` | ||
|
||
### Utilities API | ||
|
||
Opacity utilities are declared in our utilities API in `scss/_utilities.scss`. [Learn how to use the utilities API.]({{< docsref "/utilities/api#using-the-api" >}}) | ||
|
||
{{< scss-docs name="utils-opacity" file="scss/_utilities.scss" >}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters