diff options
| author | harishhalodoc <[email protected]> | 2021-06-23 07:50:01 +0530 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-06-22 19:20:01 -0700 |
| commit | a816615efa9d4fbd311c58d79b096c5672a406a1 (patch) | |
| tree | a014ccac28127d9945f1e0b031b751877cdc722c | |
| parent | 2d8da8bcb0432daeb7de9d0042690af3be84f422 (diff) | |
| download | bootstrap-a816615efa9d4fbd311c58d79b096c5672a406a1.tar.xz bootstrap-a816615efa9d4fbd311c58d79b096c5672a406a1.zip | |
Add utility classes for opacity (#33781)
* Add responsive utility classes for opacity
- fix for #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 <[email protected]>
* Update site/content/docs/5.0/utilities/opacity.md
Co-authored-by: Mark Otto <[email protected]>
Co-authored-by: Harish <[email protected]>
Co-authored-by: XhmikosR <[email protected]>
Co-authored-by: Mark Otto <[email protected]>
Co-authored-by: Mark Otto <[email protected]>
Co-authored-by: alpadev <[email protected]>
| -rw-r--r-- | scss/_utilities.scss | 13 | ||||
| -rw-r--r-- | site/content/docs/5.0/utilities/opacity.md | 30 | ||||
| -rw-r--r-- | site/data/sidebar.yml | 1 |
3 files changed, 44 insertions, 0 deletions
diff --git a/scss/_utilities.scss b/scss/_utilities.scss index 3c927cf59..74f8a3a01 100644 --- a/scss/_utilities.scss +++ b/scss/_utilities.scss @@ -24,6 +24,19 @@ $utilities: map-merge( ) ), // scss-docs-end utils-float + // Opacity utilities + // scss-docs-start utils-opacity + "opacity": ( + property: opacity, + values: ( + 0: 0, + 25: .25, + 50: .5, + 75: .75, + 100: 1, + ) + ), + // scss-docs-end utils-opacity // scss-docs-start utils-overflow "overflow": ( property: overflow, diff --git a/site/content/docs/5.0/utilities/opacity.md b/site/content/docs/5.0/utilities/opacity.md new file mode 100644 index 000000000..a2fdc3807 --- /dev/null +++ b/site/content/docs/5.0/utilities/opacity.md @@ -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" >}} diff --git a/site/data/sidebar.yml b/site/data/sidebar.yml index 4e43255a3..70652afd8 100644 --- a/site/data/sidebar.yml +++ b/site/data/sidebar.yml @@ -101,6 +101,7 @@ - title: Flex - title: Float - title: Interactions + - title: Opacity - title: Overflow - title: Position - title: Shadows |
