bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

-subtle color background utility classes don't support opacity

Open coliff opened this issue 2 years ago • 3 comments

Prerequisites

Describe the issue

It's easy to change the opacity of a .bg-secondary div with the bg-opacity-50 class.. however I noticed that the bg-*-subtle classes do not support changing the opacity. It would be useful if they did. I assume the subtle colors would need RGB values added as CSS custom properties for this to be enabled

If support for this isn't planned perhaps should add a note to the docs mentioning that bg-opacity classes don't work with -subtle colors.

Reduced test cases

Stackblitz demo: https://stackblitz.com/edit/bootstrap-subtle-opacity?file=index.html

What operating system(s) are you seeing the problem on?

Windows

What browser(s) are you seeing the problem on?

No response

What version of Bootstrap are you using?

v5.3.0

coliff avatar Jul 18 '23 10:07 coliff

Right now we're not generating any -rgb variables for these colors, but we could. That feels like a slightly larger lift than a patch release, so removing the assigned project from here for now. @coliff Do you want to take a stab at something here?

mdo avatar Jul 24 '23 04:07 mdo

sorry, don't think I'll be able to do this anytime soon. I'd be happy for someone else to jump it and take this on though!

coliff avatar Jul 28 '23 15:07 coliff

Meanwhile, it'd be good to add a note in the documentation, as i've just been scratching my head for a little while trying to figure while the opacity utilities didn't work with my background before coming across this issue regarding -subtle support.

nkosi23 avatar Oct 03 '24 14:10 nkosi23