Backdrop-blur Utility #42187
Replies: 1 comment 2 replies
-
|
Your utility doesn't just blur, it also applies a strong saturate() filter, which feels very opinionated (it increases the colors underneath quite a lot, and could hurt accessibility), so that particular bit would have to disappear if this is to be introduced, as some of us have generated additional filter utilities, for example I'd love to see backdrop blur being added out of the box, but the main problem that I currently see is that the CSS size of Bootstrap v6 currently sits at 275kb~, it has almost doubled from 144kb~ in v4 (90%~ increase), which is pretty significant, and increased by about 45kb from v5 (20%~ increase). Loading times might actually become a problem if Bootstrap's CSS continues to grow in size, as most of the people will just hotload Boostrap from a CDN URL. Perhaps there's a good way to shave off some CSS from other parts to make room for new utilities. Or maybe this is the perfect case of just using the API... I'm personally using the following backdrop filter map (which maps to Tailwind's defaults), and as a suggestion/feedback I'd like to suggest using multiples of 4px (or just Something like |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Glass effects using
backdrop-filterare widely used in modern UI design. Happy to see this already in the v6 dialog/offcanvas backdrop. While Bootstrap provides the Utilities API to generate custom utilities, it may now be time to include abackdrop-blurutility by default.I'm currently using this (v5), which results in a small CSS output:
Demo: https://codepen.io/craftwerkberlin/pen/bNwqLMN
This creates a new utility
bd-blur-{1-5}that can be used in combination with other (v6) bg utilities (color, opacity), for examplebg-white fg-white bg-10 bd-blur-5. It can be used in sticky navbars, card overlays, or anywhere one layer overlaps another.If this is of interest, I’d be happy to fine-tune it and work on a PR. Let me know what you think.
Beta Was this translation helpful? Give feedback.
All reactions