- This topic has 5 replies, 2 voices, and was last updated 4 years ago by
Elvin.
-
AuthorPosts
-
October 5, 2021 at 8:32 pm #1954131
Samantha
hi,
I think I’m going mad. I’m trying to apply a floating shadow to the
.gb-buttonelement, by using the::afterpseudoelement, however no matter what I do the pseudoelement seems to be applying to the child.gb-iconclass ๐คthe CSS I’m trying to apply to
.gb-buttonis:.gb-button::after{ content: ""; position: absolute; bottom: -35px; background: #00bfdd; transform: scaleY(0.2); width: 90%; height: 30px; left: 5%; border-radius: 50%; filter: blur(10px); }similarly if I apply the above to
.gb-button-wrapper, the floating shadow appears on.gb-button, but of course it’s much wider than the button because the wrapper fills the width of its parent grid, andflex-stretch: 2;doesn’t help.I know the pseudoelement can’t appear outside the bounds of the flex-box, but I can’t think of a way to do this within the flex button layout of GP.
(the floating shadow is supposed to be underneath the rounded buttons, however it’s appearing under the down arrows – completely the wrong element)
what am I missing?
October 5, 2021 at 8:37 pm #1954134Samantha
I think I just solved it. mostly…
change
.gb-button-wrappertodisplay: inline-flex;, and apply the:afterpseudoelement to apply to.gb-button-wrapperand addjustify-content: center;phew!
thank you ๐
October 5, 2021 at 8:50 pm #1954138Elvin
StaffCustomer SupportHi Samantha,
Thanks for letting us know. Glad you got it sorted.
Reminder: Make sure you check it on all viewports. To make sure it’s working on all devices. ๐
October 7, 2021 at 8:34 pm #1956622Samantha
Thank you, will do!
You guys are so the best ๐
October 7, 2021 at 8:40 pm #1956624Samantha
P.P.S for anyone reading this, I ended up using
display: grid;to.gb-button-wrapperachieve the floating button shadow. So the full solution was:.gp-button-wrapper { display: grid; } .gb-button::after { content: ""; background: #00000011; /* mostly transparent */ margin-top: 6px; height: 30px; border-radius: 50%; width: 90%; margin-left: 5%; transform: scaleY(0.2); }nice and tidy ๐
October 7, 2021 at 9:05 pm #1956637Elvin
StaffCustomer SupportNice one! thanks for sharing it with us. ๐
Tip: Consider assigning an ID or unique class to the button so you can use it as the CSS selector.
.gb-buttonmay be too generic. The CSS will apply to ALL generateblocks buttons throughout the page and that maybe undesirable. ๐ -
AuthorPosts
- You must be logged in to reply to this topic.